Download the PHP package perceptiontech/php-coding-standard without Composer
On this page you can find all versions of the php package perceptiontech/php-coding-standard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download perceptiontech/php-coding-standard
More information about perceptiontech/php-coding-standard
Files in perceptiontech/php-coding-standard
Package php-coding-standard
Short Description PHP coding standard to use with PHPCodeSniffer
License MIT
Informations about the package php-coding-standard
Perception PHP coding standard
This standard follows the (Symfony standards)[https://symfony.com/doc/current/contributing/code/standards.html] with with the following exceptions:
- It does not require the license on top of every file.
- It allows to have multiline function arguments.
Installation steps
- Install PHP code sniffer: https://github.com/squizlabs/PHP_CodeSniffer#installation
-
Require package globally using composer:
-
Add the coding standard to the PHP_CodeSniffer install path (under MacOS and Linux):
Be aware that, if you already have installed paths, they will be lost. If so, you will have to execute:
- Check the installed standards for "Perception":
PHPStorm configuration
Code_Sniffer configuration
-
Go to quality tools, unfold the Code Sniffer option and toggle the configuration by clicking on
...
: -
Set the path to your local PHPCode_Sniffer binary and validate it:
Ruleset configuration
-
Go to Editor > Inspections > PHP > Quality tools > PHP Code Sniffer validation
-
Enable the configuration, refresh the "Coding standard" and select "Perception". Configuration should be as it follows:
(NOTE: set the severity as "warning". Otherwise, it is difficult to spot the errors within the editor)
-
After this configuration, PHPStorm should inform you whenever a piece of code is not correct according to the rules:
All versions of php-coding-standard with dependencies
escapestudios/symfony2-coding-standard Version ^3.5.2