Open
Description
Preconditions
- Tested on Magento Open Source 2.4.4 and Adobe Commerce 2.4.4
- PHP 8.1 (I haven't tried 7.4)
- PHPStorm version is 2021.2.4
Steps to reproduce
- Configure PHP interpreter in PHPStorm
- Configure phpcs in PHPStorm to use the Magento coding standard
- Enable the phpcs inspections
Expected result
- PHPStorm displays phpcs rule violations according to the configuration
Actual result
In the PHStorm event log the message is shown
ERROR: Referenced sniff "PHPCompatibility.FunctionUse.RemovedFunctions" does not exist
Additional Information
Running phpcs on the command line works
vendor/bin/phpcs --standard=vendor/magento/magento-coding-standard/Magento2 path/to/check
The same PHPStorm configuration works on Magento 2.4.3 with PHP 7.4.
If I remove the reference to that sniff from the Magento2/ruleset.xml
, phpcs fails with a stacktrace where any other Magento2 rule extending from a PHPCompatibility
rule class can't find the parent class.
Maybe this points to an autoload error?
However, I quick test by adding "PHPCompatibility\\:": "vendor/phpcompatibility/php-compatibility/PHPCompatibility/"
to the root composer.json and dumping the composer autoloader did not change anything.
Metadata
Labels
Type
Projects
Status
Pull Request In Progress