This package provides PHPCS rule set for coding standards in Pixel Federation. It should be included into each project maintained by Pixel Federation that uses PHP Code Sniffer PHPCS.
Generic ruleset was removed. Now there are only rulesets for specific PHP versions.
Replace (in your ruleset) reference to file
vendor/pixelfederation/coding-standards/phpcs.ruleset.xml
with
vendor/pixelfederation/coding-standards/phpcs.ruleset.84.xml
for PHP 8.4.
composer require --dev pixelfederation/coding-standards:^5.0
For each php version there are 2 versions of the ruleset. One for DDD projects and one for Non-DDD projects.
For example for PHP 8.4:
vendor/pixelfederation/coding-standards/phpcs.ruleset.84.xml
OR
vendor/pixelfederation/coding-standards/phpcs.ruleset.84.non-ddd.xml
Create a file named phpcs.ruleset.xml
in the root folder of your project with the following content:
<?xml version="1.0"?>
<ruleset name="PixelFederation">
<description>PixelFederation rule set.</description>
<exclude-pattern>tests/</exclude-pattern>
<rule ref="vendor/pixelfederation/coding-standards/phpcs.ruleset.84.xml"> <!-- Insert version for your php version -->
<!-- You can exclude some rules here -->
<exclude name="SlevomatCodingStandard.Files.FunctionLength"/>
</rule>
</ruleset>
In your project directory run this command:
vendor/bin/phpcs --standard=phpcs.ruleset.xml src
In your project directory run this command:
vendor/bin/phpcbf --standard=phpcs.ruleset.xml src
Sniffs documentation for slevomat coding standards are here: https://github.com/slevomat/coding-standard