I have PhpStorm on my PC, to launch it I have to go to phpstorm/bin/ and launch phpstorm.sh, how can I pin this to launcher so that I dont have to go into folders every time? Ask Ubuntu Meta your communities. Sign up or log in to customize your list. More stack exchange communities company blog. Ask Ubuntu is a question and answer site for.
- Meta Stack Overflow your communities. Sign up or log in to customize your list. I am using PHPStorm and have written a class that utilises the SimpleXML class. Everything is fine, except when I traverse an XML string I will get 'Undefined Property' warnings.
- PhpStorm meta data for expected arguments completion. Awesome Open Source. Awesome Open Source. Symfony Phpstorm Meta. PhpStorm meta data for expected arguments completion. Most Recent Commit. Related Projects. Php (16,074)symfony (454)metadata (168).
In this build, we’re adding support for prefixed table names in SQL queries. Read on to learn more.
The Early Access Program is coming to a close, and we are now focusing on stabilizing and polishing PhpStorm for the release. This is a good time to report any lingering issues that you’ve encountered to our tracker as there is still time to fix them before release.
Check out the What’s Coming in PhpStorm 2021.1 video, which also covers things not mentioned in this blog post, on the JetBrains YouTube channel.
Support for prefixed table names in SQL
Many content management systems and frameworks allow you to specify a table prefix. This can be useful, for example, if you’re using the same database for multiple different applications.
In previous versions, PhpStorm would lose database integration in such cases because SQL queries contained markers for prefixes.
With PhpStorm 2021.1, it will be possible to specify prefixes in the .phpstorm.meta.php file. If you are not familiar with meta files, check out our help article on the topic.
Let’s say we have the following query in a Drupal app:
You’ll notice how PhpStorm is unable to resolve either the table name or the columns. That’s because we have specified a table prefix in the Drupal config.
To fix this, add a .phpstorm.meta.php file anywhere in the project with the following content:
Note how we specified a prefix replacement here.
With this file, PhpStorm will be able to link SQL queries to data sources and provide you with all its smart features, such as completion, resolve, and so on.
This works with concatenation as well. See the following example:
Extensions in the `suggest` section of composer.json now considered
Your codebase may have classes from PHP extensions. Previously, PhpStorm checked if such extensions were added in the `require`
section.
However, extensions may sometimes be optional and the existence of the classes from the `suggest` section may be checked for before usage.
In v2021.1, PhpStorm will consider extensions in both `require`
and `suggest`
sections.
When an extension is registered in `composer.json`
as suggested but is used without checks, like extension_loaded()
or function_exists()
, then PhpStorm will warn you about this. You can use a quick-fix to move extensions to `require/require-dev`
.
The full list of changes in this build is available in the release notes.
- Important! PhpStorm EAP builds are not fully tested and may be unstable.
- You can install an EAP build side by side with a stable PhpStorm version to try out the latest features.
- EAP builds are free to use but expire 30 days after the build date.
Please report any problems you find to our issue tracker or by commenting on this post.
Your JetBrains PhpStorm team
The Drive to Develop
PHP
Set the PHP language level in the status bar
Set any PHP version for the project without modifying composer.json
. This can be helpful, for example, to see how compatible the codebase is with a newer PHP version before actually switching to it.
Locate PHP settings more easily
To make it easier to find and change PHP-related settings, we’ve moved this section to the top level Settings / Preferences | PHP.
Preview PHP and HTML files in the editor
In the Editor, there is a new icon in the top-right corner that opens a tab for previewing files inside of PhpStorm. It works with HTML and PHP files.
Open a PHP file, type your code, and you can immediately see the result alongside it. There is no need to switch to other windows! Any changes in linked CSS and JavaScript files will be reflected in the preview as well.
PhpStorm uses a local PHP interpreter that is specified in the project settings under Settings/Preferences | PHP. Docker and other remote interpreters are not supported.
You can turn on the preview icon by enabling at least one browser under Preferences | Tools | Web Browsers and checking the For HTML files checkbox.
You can also use the shortcut Alt+F2 to open a preview tab.
Use table prefixes in SQL queries
Many content management systems and frameworks allow you to specify a table prefix, which is useful when using the same database for multiple applications.
In previous versions, PhpStorm would lose database integration in such cases because SQL queries contained markers for prefixes.
Now it is possible to specify prefixes via the .phpstorm.meta.php file. Learn more about meta files and how to specify SQL prefixes in the help article.
Inspections and quick-fixes
Boolean expression can be simplified
If a boolean expression contains true
or false
literals, PhpStorm can help simplify it. Use an Alt+Enter quick fix to remove redundancies and improve readability.
Strict comparison of operands with incompatible types
The operator for strict comparison will always result in false
if one operand type is not the same as the other.
PhpStorm will highlight such cases, as they can potentially be a source of bugs. PhpStorm takes into account all type-inferred information, and will help you find issues in less obvious cases.
PHP 8: Replace assignment in the function call with named argument
It used to be common practice to add a variable assignment in a function call to mimic a parameter name.
With PHP 8, use Alt+Enter to replace the assignment with a real named argument.
Replace `isset` with coalesce
This code snippet isset($a) ? $a : $b;
is exactly the same as $a ?? $b
, so PhpStorm will suggest an Alt+Enter quick-fix to replace it.
Simplify `if` blocks with the common body
Some if
or else
blocks may become redundant after changes that make their bodies the same. PhpStorm will offer either to extract common parts or to merge blocks.
Invert `if` statement
Press Alt-Enter on any if
and choose Invert `if` statement from the menu. This will change the condition to its opposite and make the necessary code adjustments to preserve the logic. If you are a fan of the early return practice, this action will help you refactor your code.
Unnecessary leading ‘’ in ‘use’ statement
In some cases, the leading backslash is redundant for namespaces. PhpStorm helps determine where it can be removed.
`foreach` variable overwrites already defined variables
Variables for key and value in a foreach loop can clash with the names of other variables or parameters. PhpStorm highlights all of the places where errors could occur.
Unnecessary curly braces syntax for variables
PhpStorm highlights when the curly braces in the context of string interpolation are redundant and can be safely removed to make the code cleaner.
Change parameter type based on a default value
If the declared type does not match the type of a value, you can quickly update the type using Alt+Enter. Or with PHP 8, PhpStorm will offer to use a union type.
Replace `isset` with `! null`
Using the isset()
function is only effective for arrays and variables. In all other cases, it makes sense to verify whether the operand is not null
. Use Alt+Enter to replace isset()
checks with null
checks.
Highlight unsafe http:// links
PhpStorm highlights http://
protocol usages in strings and offers an Alt-Enter quick-fix to change them to https://
. You can also add URLs to the ignore list with a quick-fix.
Suspicious name combination
PhpStorm highlights some typical misusages of parameter names or return values, for example $
needle
and $haystack
or $x
and $y
. This could be a potential bug or at least very confusing for those who read the code.
Configure pre-commit inspections
You can now choose a code inspection profile before committing changes to the VCS. Click the gear icon to show commit options, then tick the Analyze code checkbox, click Configure, and choose the desired profile. Profiles can be created in Preferences/Settings | Editor | Inspections.
Other
Synthetic scope for better refactoring
In PHP, loop constructs like foreach
, for
, while
, and catch
blocks do not have isolated scopes. This can be inconvenient if you want to rename a variable only inside a block.
In PhpStorm 2021.1, we have introduced a synthetic scope for such blocks, so the rename refactoring (Shift+F6) will be more intuitive.
Better automatic language injection
PhpStorm 2021.1 analyzes how variables are used and injects language references automatically.
For example, if a variable is used in a preg_*
function, PhpStorm knows it’s a pattern and highlights RegExp.
Extensions in `suggest` section of composer.json
PhpStorm now considers extensions in both require
and suggest
sections.
PhpStorm will warn you when an extension is registered in composer.json
as suggested but is used without checks, like extension_loaded()
or function_exists()
. You can use a quick-fix to move extensions to require/require-dev
.
Notable fixes
In this release, our main focus was stability and quality. In total, we fixed 2246 issues submitted to our issue tracker by users and JetBrains team members. Here are just a few of the most interesting ones:
- Debugging WSL 2 projects in Docker is now possible.
- Quality tools now properly resolve paths with docker-compose in exec mode.
- Large files (more than 5k lines) are handled correctly.
- We’ve significantly improved performance in projects with many aliases.
Code With Me
Code With Me is a JetBrains tool for collaborative development and pair programming. We initially introduced it in PhpStorm 2020.3, and this release delivers a number of significant improvements.
Set the needed level of access to your project and share the link with your guests. Peers do not even need to have their own IDEs installed to collaborate, and the platform features embedded audio and video calls, along with chat messaging.
For businesses that require extra security, Code With Me on-premises can be installed and securely run on a company’s own private network.
Phpstorm Maven
HTTP Client
Support for SSL
You can now define SSL settings in the HTTP client by clicking Add environment file and selecting Private. The IDE will automatically create a file where you can add your SSL configurations: clientCertificate
, hasCertificatePassphrase
, clientCertificateKey
, verifyHostCertificate
.
UI improvements
There is a new eye icon that contains options for the way the body is displayed. You can switch modes between Text / JSON / HTML / XML, you can enable line numbers, and there is a new button to quickly Copy Response Body to Clipboard.
IDE
Maximize tabs in split view
Split the editor by dragging a tab to the corners of the IDE window. Then double-click the tab to maximize the editor area for it. Google play music manager download. Double-click it again to restore it to its original size.
JSONPath support
Use the JSONPath query language to search through JSON documents. New actions are available under Edit | Find | Evaluate JSONPath.
JSON Lines format support
PhpStorm now supports the newline-delimited JSON Lines format used for working with structured data and logs. The IDE will recognize .jsonl, .jslines, .ldjson, and .ndjson file types.
Typography settings
It is now possible to adjust font variations and a fallback font. Find the new options under Typography Settings in Settings / Preferences | Editor | Fonts.
Web Technologies
All the new features and improvements from WebStorm 2021.1 are also available in PhpStorm 2021.1, either out of the box or with free plugins from the plugin repository.
Improved support for Stylelint
You can now fix problems in CSS with Stylelint in just a few clicks. Hover over a problem in your file or place the caret on it and press Alt+Enter, then select Stylelint: Fix current file.
Additionally, you can now specify a path to the configuration file under Settings / Preferences | Languages & Frameworks | Style Sheets | Stylelint.
Check the specificity of your selectors
.phpstorm.meta.php File
When working with style sheets, you can now check the specificity of your selectors – just hover over a selector that you want to check. Alternatively, focus on a selector and press F1/Ctrl+Q to see this information in the Documentation popup.
Phpstorm Metadata
GitHub pull request improvements
To create a new pull request, click on the + icon or go to Git | GitHub | Create Pull Request.
The new dialog includes everything you might need:
- Select base and head branches from a list that includes all the branches available.
- Review changed files in the Files tab.
- Edit PR title and description, appoint reviewers and assignees, and add labels.
- Create draft pull requests.
Database Tools
Take a look at What’s new in DataGrip 2021.1 – all these features are available in PhpStorm, too. Here are just a couple of them.
UI for grants
Phpstorm Metallic
The Modify user window, which you can invoke on a user in the database explorer with Cmd/Ctrl+F6, now has a UI for adding grants to objects.
This is available for PostgreSQL, Redshift, Greenplum, MySQL, MariaDB, DB2, SQL Server, and Sybase.
Context live templates
This is our solution for anyone wanting to generate simple statements straight from the database explorer. When you right-click on an object in the explorer, the list that appears will contain special live template items.
Phpstorm Method
Learn more about how to create your own context live templates.