Skip to end of metadataGo to start of metadata
- PHPStan plugin for PhpStorm This plugin adds dedicated functionality for PHPStanto PhpStorm. The plugin is under active development and will be bundled into PhpStorm.
- In PhpStorm, we’ve already annotated some internal PHP functions like parseurl with # ArrayShape, so you can benefit from the attributes right away. Fortunately, the syntax of one-line attributes is backward-compatible.
PHP | Feature | WI-56627 | ArrayShape for params: add completion for keys in function/method calls |
Bug | WI-52799 | Advanced Metadata: class::traitMethod in expectedArguments(functionFQN,...) not working | |
Bug | WI-57386 | Wrong string concatenation with PHP 8 | |
Usability | WI-57392 | Resolve PhpStorm attributes only to vendor folder in case of both stubs+vendor packages installed | |
PHP Inspections | Exception | WI-57502 | Dead code: CCE when processing promoted properties |
PHP Interpreters | Exception | WI-57965 | NPE on attempt to add remote interpreter using ssh connection |
PHP Quality Tools | Bug | WI-57853 | Inspections not working via dockerized phpstan when project is in subdirectory |
Plugin: PHPStan | Bug | WI-57015 | Inspect code with enabled PHPStan inspection spawns many PHP processes, seems never to finish |
Core. Debugger | Bug | IDEA-255769 | Inline watches: inline hint may stuck with Collecting Data |
Core. Diagrams | Bug | IDEA-257774 | 'Show usages' on module dependencies diagram always shows 'No matches found' |
Core. File System | Bug | IDEA-256953 | File chooser: show WSL UNC roots with backslashes |
Core. Image Viewer | Bug | IDEA-258686 | No preview for WebP images in the IDE on Apple Silicon |
Core. Licensing | Bug | IDEA-253899 | Missing icons for disabled paid plugins in the license dialog |
Bug | IDEA-256058 | I can't register my license and open plugin market place | |
Core. Platform API | Bug | IDEA-255566 | Collisions across Search Everywhere contributors' weights aren't detected |
Core. Project Settings | Bug | IDEA-258722 | Reopening project removes 'Android' and 'Android-Gradle' facets from 'app' module |
Bug | IDEA-257495 | Last facet removed from module restores after reopen | |
Bug | IDEA-257867 | Workspace model should survive broken cache | |
Bug | IDEA-257045 | Adding module groups are not working anymore | |
Core. Run. Configurations | Bug | IDEA-256792 | New run configuration show red error for Main class comes from libraries (when enabling 'Include non-project items') |
Bug | IDEA-253019 | [new run config UI] Run Configuration is missing 'Use module path' checkbox after upgrade to 2020.3 | |
Core. Run. Targets | Feature | IDEA-252713 | Support wizard-based SSH target creation |
Bug | IDEA-253239 | Run Targets: the remote java is shown in the Application Run Configuration when the remote target is selected, but not in the Spring Boot Run Configuration | |
Bug | IDEA-257608 | Make Project path on target browsable in SSH target wizard | |
Bug | IDEA-257136 | Run Targets: Introspection for SSH target during wizard completed with errors | |
Bug | IDEA-258081 | Run Targets: the Next button remains disabled in the New Target: SSH dialog if the existing connection is selected using the SSH Configurations dialog invoked by browse button | |
Bug | IDEA-257610 | Changes in Project path and JDK path in SSH wizard are not applied | |
Bug | IDEA-256133 | Run Targets: new maven configuration with docker run target have duplicated name to existed configuration | |
Bug | IDEA-258066 | Run Targets: SSH: all maven run configurations fail on resources copying stage trying to access /project folder | |
Bug | IDEA-255466 | Run Targets: When create new project and new ssh target on attempt to browse jdk get 'failed to find ssh settings' | |
Bug | IDEA-258863 | SSH: Rsync upload fails on local/remote paths with spaces | |
Exception | IDEA-257536 | NPE at com.jetbrains.plugins.remotesdk.target.ssh.target.wizard.SshTargetLanguageStep._init | |
Core. SSH | Cosmetics | IDEA-258310 | Log throwables from wrapBlockingSshCall at most once |
Lang. XPath and XSLT | Exception | IDEA-259818 | Running XSLT debugger with Saxon engine fails with exception |
User Interface | Bug | IDEA-257931 | Big Sur: Empty grey bar appears above the tool bar if opening a third project in full screen |
Bug | IDEA-236086 | Find field: second line appears if a search string does not fit the filed size | |
Bug | IDEA-257810 | Big Sur: Empty grey line remains a project window after drag-and-drop a project tab out of the window | |
Bug | IDEA-257811 | Big Sur: Toolbar hides after opening a project in a separate tab | |
User Interface. Focus | Bug | IDEA-244511 | IDE steals focus when dragging a file over its window |
Version Control | Usability | IDEA-235910 | Double-click behavior in Local Changes could be optional |
Version Control. Git | Bug | IDEA-253948 | Git Merge Dialog: manually entered branch name is not used in some cases |
Bug | IDEA-256372 | Git Merge dialog: the dialog doesn't remember last used branch | |
Bug | IDEA-258364 | Committing a file in the ignored directory via staging area fails. | |
Performance | IDEA-254138 | Git Rebase dialog opening takes a very long time for big project | |
Usability | IDEA-256325 | Git Rebase: Rebase dialog clears the base field if dialog was closed without performing rebase | |
Usability | IDEA-254606 | [Regression] Degrated expirience when working with remote branches in online and offline mode. | |
Version Control. GitHub | Bug | IDEA-228590 | GitHub PullRequests: timeline width does not allow to see all content |
Bug | IDEA-254431 | 'Add Account' using OAuth shows 'Your connection is not private' error if HSTS is configured for 'localhost' for some reason | |
Usability | IDEA-255031 | Thread reply field is too wide in timeline | |
Task | IDEA-244516 | 'Share Project on GitHub' action shows old 'password or token' dialog if no GH accounts configured | |
Task | IDEA-244514 | 'Create Gist' action shows old 'password or token' dialog if no GH accounts configured | |
Version Control. Log | Cosmetics | IDEA-258478 | Incorrect background color for file history progress |
DB Connectivity | Feature | DBE-10828 | Do not include password to data source name for 'Data sources from URL' action |
Performance | DBE-12398 | Test Connection allocates memory but never frees it, when encountering UnknownHostException | |
Usability | DBE-11884 | Make data source URL field expandable | |
DB Diff | Bug | DBE-12384 | Problem with some schema comparisons |
Bug | DBE-12351 | 'Set Do nothing' option does not affect on result migration script | |
DB Introspection | Bug | DBE-12367 | Athena introspection does not work after latest update |
DB Refactoring | Feature | DBE-12357 | Additional option 'purge' in drop confirmation dialog for Oracle |
Data Views | Bug | DBE-12255 | SQL Server - Wrong hierarchyid values representation |
Usability | DBE-11774 | Table is read-only when there is no schema qualifier (unresolved table references) | |
Usability | DBE-12168 | No 'Submit changes immediately' option on IDEA 2020.3 ,so you must manually submit a data change. | |
SQL Generation | Bug | DBE-12303 | Invalid sql script in modify object for Oracle materialized view |
No subsystem | Bug | WEB-48777 | JavaScript 'forof' template: unstable order of elements in completion / suggestion |
Bug | WEB-48856 | Highlights with ERROR severity cancels SYMBOL_TYPE syntax highlighting in injections | |
Task | WEB-49047 | Updated the Getting Started link under the Learn WebStorm tab | |
CSS | Bug | WEB-48210 | Valid value 'break-spaces' of CSS property 'white-space' is highlighted as error. |
Bug | WEB-49011 | TailwindCSS completion/css-preview on hover doesn't work when using breakpoint prefixes with utilities | |
Bug | WEB-48207 | CSS parsing error when using negative function arguments in min()/max() functions | |
Bug | WEB-48695 | Don't report 'Redundant measure unit' error for css-grid 'fr' | |
Bug | WEB-45868 | Parsing error when using DOM element selectors CSS injection if CSS dialect is set to 'PostCSS' | |
Dart | Feature | WEB-25687 | Add 'VM Options' field to the Dart Test run configuration editor. |
Bug | WEB-43142 | Contents of typed_data does not show up in the debugger | |
Usability | WEB-48264 | 'Dart Command Line App' and 'Dart Test' run configurations should start Observatory only when debugging | |
Debugger | Bug | WEB-48918 | Mocha: Debugger doesn't stop on breakpoints when use WSL interpreter |
Bug | WEB-46619 | WSL debugging is not working while using npm run configuration | |
Bug | WEB-48816 | Chrome custom user data gets cleared on IDE restart | |
HTML | Bug | WEB-49051 | Adding a new JSX tag causes simultaneous editing of non-related closing tag |
JavaScript | Bug | WEB-48606 | Incorrect type definition in 2020.3 |
Bug | WEB-49037 | RejectedExecutionException when comment a piece of code | |
Bug | WEB-49003 | Deadlock in JSResolvedTypeIdCache | |
Bug | WEB-48976 | Comma expression without parentheses inside a string interpolation expression marked as a syntax error | |
Bug | WEB-42605 | JSX fragment closing tag with a space breaks syntax highlighting | |
Bug | WEB-48719 | Having a colon in JSX results in a syntax error | |
JavaScript. Frameworks | Feature | WEB-43318 | No code completion in dynamically evaluated classname attribute value |
Feature | WEB-44150 | Vue: support type inference for component props within template | |
Bug | WEB-48837 | Nuxt: Issue auto-importing components from paths ending with '/' | |
Bug | WEB-48899 | webpack config analysis is infinite if node_modules were deleted | |
JavaScript. Refactoring | Task | WEB-48813 | Support `RefactoringEventListener` in JS refactorings |
TypeScript | Bug | WEB-48741 | 'a module cannot have multiple default exports' with overloaded default function |
Bug | WEB-48114 | When changing a method signature in TypeScript, the caller code is not updated | |
Bug | WEB-48675 | TS 4.1 template string literal type isn't being fully computed for switch statements ('Possibly infinite type substitution' error) | |
Unit Tests | Bug | WEB-48835 | .../null error when trying to run cucumber tests |
Bug | WEB-48931 | Running cucumber-js 7.0 test generates error 'formatter.finished is not a function'/ |
PhpStorm is a fast and exceptionally smart IDE tailored for PHP developers. PhpStorm truly understands your code. It provides intelligent coding assistance and refactoring capabilities, highlights and fixes errors on the fly, and allows you to debug and test your code easily. But that’s not all!
In addition to built-in coding assistance, PhpStorm provides checking the source code through integration with the PHP CS Fixer tool, which detects coding standards problems in your code.
To use PHP CS Fixer from PhpStorm instead of command line, you need to register it in PhpStorm and configure it as a PhpStorm code inspection. Once installed and enabled in PhpStorm, the tool is available in any opened PHP file, and no additional steps are required to launch it. The on-the-fly code check is activated upon every update in the file thus making it easy to get rid of discovered problems.
Errors and warnings reported by PHP CS Fixer on-the-fly are displayed as popup messages. When the tool is run in the batch mode, the errors and warnings are displayed in the Inspection Results tool window. Each message has the PHP CS Fixer
prefix to distinguish it from PhpStorm internal inspections.
Phpstan Phpstorm Docker
You can have predefined rules applied or define your own custom set of rules.
Prerequisites
Prior to integrating PHP CS Fixer in PhpStorm, make sure the following prerequisites are met:
You are working with PHP CS Fixer version 2.8.0 and later.
The directory containing the PHP engine executable must be added to the system
path
. This allows code quality tool scripts execute calls to the system-wide PHP engine.For Docker Compose-based remote interpreters, make sure to use
exec
mode to avoid spawning additional containers.In the Settings/Preferences dialog Ctrl+Alt+S, go to PHP.
On the PHP page that opens, click next to the CLI Interpreter list.
In the CLI Interpreters dialog that opens, set the Lifecycle mode for the selected interpreter to Connect to existing container ('docker-compose exec').
Install and configure PHP CS Fixer
PHP CS Fixer scripts can be used as local scripts, the scripts associated with PHP interpreters, or scripts declared as project dependencies and installed via Composer, which is the preferable and recommended way.
Install PHP CS Fixer with Composer
Before you start, make sure Composer is installed on your machine and initialized in the current project as described in Composer dependency manager.
When you install PHP CS Fixer with Composer, PhpStorm automatically downloads the necessary scripts, registers them in the IDE, and, optionally, enables and configures the corresponding code inspection.
Inside composer.json, add the friendsofphp/php-cs-fixer dependency record to the
require
orrequire-dev
section. Press Ctrl+Space to get code completion for the package name and version.Do one of the following:
Click the Install shortcut link on top of the editor panel.
If the Non-installed Composer packages inspection is enabled, PhpStorm will highlight the declared dependencies that are not currently installed. Press Alt+Enter and select whether you want to install a specific dependency or all dependencies at once.
Click next to the package record in the composer.json editor gutter to jump to the corresponding Settings/Preferences page and configure PHP CS Fixer manually.
Reset PHP CS Fixer configuration
After PHP CS Fixer is initially configured, further modifications in composer.json will not affect the inspection configuration. To apply newer changes, reset the PHP CS Fixer configuration.
In the Settings/Preferences dialog Ctrl+Alt+S, navigate to PHP | Quality Tools.
On the Quality Tools page that opens, expand the PHP CS Fixer area and click next to the Configuration list.
In the PHP CS Fixer dialog that opens, empty the PHP CS Fixer path field.
Update the project Composer dependencies by clicking Update on top of the composer.json editor panel. See Update dependencies for details.
PhpStorm will perform the PHP CS Fixer configuration anew and thus apply the changes in composer.json.
Configure PHP CS Fixer manually
You can use the manually downloaded local PHP code quality tool scripts or scripts associated with PHP interpreters. There can be a number of local and remote PHP interpreters, the one specified on the PHP page of the Settings/Preferences dialog is considered Project Default. Learn more about configuring PHP interpreters in Configure remote PHP interpreters or in Configure local PHP interpreters.
Choose a PHP CS Fixer script to use
In the Settings/Preferences dialog Ctrl+Alt+S, navigate to PHP | Quality Tools.
On the Quality Tools page that opens, expand the PHP CS Fixer area. From the Configuration list, choose the PHP CS Fixer script:
To use the script associated with a specific remote PHP interpreter, choose the name of this interpreter.
To use a local script, choose Local. In this case the local PHP CS Fixer will be executed no matter which PHP interpreter - local or remote - is used in the project. Note that there can be only one Local configuration for PHP CS Fixer because PhpStorm runs a script (php-cs-fixer.bat for Windows or php-cs-fixer for Linux and macOS) that contains a path to a PHP engine.
To use the script associated with the default project interpreter, that is, the one chosen on the PHP page of the Settings/Preferences dialog, choose By default project interpreter.
Configure a local PHP CS Fixer script
Download and install the PHP CS Fixer scripts.
To check the PHP CS Fixer installation, switch to the installation directory and run the following command:
If the tool is available, you will get a message in the following format:
PHP CS Fixer 2.13.0 Yogi's BBQ by Fabien Potencier and Dariusz RuminskiTo have code checked against your own custom coding standard, create it. Store the rules and the .php_cs or php_cs.dist file that points to them in the rulesets root directory.
Register the local PHP CS Fixer script in PhpStorm:
In the Settings/Preferences dialog Ctrl+Alt+S, navigate to PHP | Quality Tools.
On the Quality Tools page that opens, expand the PHP CS Fixer area and click next to the Configuration list.
In the PHP CS Fixer dialog that opens, specify the location of the php-cs-fixer.bat or php-cs-fixer PHP CS Fixer executable in the PHP CS Fixer path field. Type the path manually or click and select the relevant folder in the dialog that opens.
To check that the specified path to php-cs-fixer.bat or php-cs-fixer ensures interaction between PhpStorm and PHP CS Fixer, that is, the tool can be launched from PhpStorm and PhpStorm will receive problem reports from it, click the Validate button. This validation is equal to running the
php-cs-fixer --version
command. If validation passes successfully, PhpStorm displays the information on the detected PHP CS Fixer version.
If necessary, in the Tool process timeout field, specify how long you want PhpStorm to wait for a result from PHP CS Fixer, whereupon the process is terminated to prevent excessive CPU and memory usage.
Configure a PHP CS Fixer script associated with a PHP interpreter
In the Settings/Preferences dialog Ctrl+Alt+S, navigate to PHP | Quality Tools.
On the Quality Tools page that opens, expand the PHP CS Fixer area and click next to the Configuration list. The PHP CS Fixer dialog opens showing the list of all the configured PHP CS Fixer scripts in the left-hand pane, one of them is of the type Local and others are named after the PHP interpreters with which the scripts are associated.
Click on the toolbar. In the PHP CS Fixer by Remote Interpreter dialog that opens, choose the remote PHP interpreter to use the associated script from. If the list does not contain a relevant interpreter, click and configure a remote interpreter in the CLI Interpreters dialog as described in Configure remote PHP interpreters.
When you click OK, PhpStorm brings you back to the PHP CS Fixer dialog where the new PHP CS Fixer configuration is added to the list and the right-hand pane shows the chosen remote PHP interpreter, the path to the PHP CS Fixer associated with it, and the advanced PHP CS Fixer options.
If necessary, in the Tool process timeout field, specify how long you want PhpStorm to wait for a result from PHP CS Fixer, whereupon the process is terminated to prevent excessive CPU and memory usage.
Configure PHP CS Fixer as a PhpStorm inspection
Configure the PHP CS Fixer inspection with Composer
You can include the information on the default and custom PHP CS Fixer rulesets inside the scripts section of composer.json. When you install or update project dependencies, the specified rulesets will be detected and the PHP CS Fixer validation inspection will be enabled automatically.
If no ruleset is specified in the scripts
section of composer.json, PhpStorm will additionally check the project root to locate the ruleset with the .php_cs or .php_cs.dist default name. If the file is present, it will be automatically selected as the inspection's Custom ruleset.
In the
scripts
section of composer.json, add thephp-cs-fixer
PHP CS Fixer launch command into one of the leaf elements.Provide the
--rules
argument to denote the coding standard used. For example, adding the following record will set the coding standard to PSR1:'scripts': { 'php-cs-fixer': 'php-cs-fixer --rules=@PSR1' }Alternatively, provide the
--config
argument and the path to the ruleset file, which will set the coding standard to Custom:'scripts': { 'php-cs-fixer': 'php-cs-fixer --config=./.php_cs' }
After PHP CS Fixer is initially configured, further modifications in composer.json will not affect the inspection configuration. To apply newer changes, reset the PHP CS Fixer configuration on the PHP | Quality Tools page of the Settings/Preferences dialog Ctrl+Alt+S and update project dependencies.
Configure the PHP CS Fixer inspection manually
In the Settings/Preferences dialog Ctrl+Alt+S, click Inspections under Editor.
On the Inspections page that opens, expand the PHP | Quality Tools node and select the checkbox next to PHP CS Fixer validation.
If you have installed PHP CS Fixer with Composer but the corresponding inspection is currently disabled, PhpStorm highlights its record in composer.json. Press Alt+Enter and use the provided Enable inspection quick-fix to enable the inspection and open the Inspections page.
On the right-hand pane of the page, configure the PHP CS Fixer tool using the controls in the Options area:
From the Severity list, choose the severity degree for the PHP CS Fixer inspection. The selected value determines how serious the detected discrepancies will be treated by PhpStorm and presented in the inspection results.
From the Scope list, choose the scope to limit the inspection application to.
To allow risky rules, that is, the rules that can change code behavior, select the Allow risky rules for built-in rulesets checkbox. By default, risky rules are not allowed.
Appoint the coding standard to apply.
To use one of the predefined coding standards, select it the Coding standard list, appoint the coding style to check your code against. The list contains all the coding standards declared inside the main php-cs-fixer directory structure.
To have your code checked against your own previously defined coding standard, choose Custom. Click Browse and in the Custom Coding Standard dialog that opens, specify the path to the .php_cs or .php_cs.dist file for your own coding standard in the Path to ruleset field. Type the path manually or click Browse and choose the relevant folder in the dialog that opens.
Share a custom coding style with the team
Put the root directory of your coding standard under the project root.
Configure PHP CS Fixer as a PhpStorm inspection.
Appoint your coding standard.
Make sure that a project profile is selected at the top of the Inspections page. Such profiles are saved in a particular project's .idea directory (for example, $PROJECT_DIR$/.idea/inspectionProfiles ). See Configure profiles for details.
On the Version Control page of the Settings/Preferences dialog, make sure that the .idea directory is put under version control.
Run PHP CS Fixer in the batch mode
Phpstan For Phpstorm
From the main menu, select Code | Inspect code.
Select the inspection profile from the list, or click to configure a new profile in the Inspections dialog that opens. You can also click to check, which fixes will be applied and make sure that the PHP CS Fixer validation inspection is enabled.
View the inspection results in the Inspection results tool window. Errors and warnings reported by PHP CS Fixer are prefixed with
PHP CS Fixer
to distinguish them from PhpStorm internal inspections.
Exclude files from PHP CS Fixer inspection
When waiting for PHP CS Fixer response exceeds the limit specified in the Tool process timeout field in the PHP CS Fixer dialog, PhpStorm suggests adding the file to the ignore list.
In the Settings/Preferences dialog Ctrl+Alt+S, navigate to PHP | Quality Tools.
On the Quality Tools page that opens, expand the PHP CS Fixer area and click the Show ignored files link.
To add a file, click and locate the desired file in the dialog that opens.
To delete a file from the list and have PHP CS Fixer process it again, select the file and click .
To remove all the files from the list, click .