@@ -39,8 +39,8 @@ And you can run phpcs manually from shell:
39
39
phpcs -sw --standard=PSR1 file.php
40
40
41
41
It will show errors and describe how to fix them.
42
- It can also be helpful to include this command in a git hook.
43
- That way, branches which contain violations against the chosen standard cannot enter the repository until those
42
+ It can also be helpful to include the ` phpcs ` command in a git pre-commit hook with the ` --filter=GitStaged ` CLI argument .
43
+ That way, code which contain violations against the chosen standard cannot enter the repository until those
44
44
violations have been fixed.
45
45
46
46
If you have PHP_CodeSniffer, then you can fix the code layout problems reported by it, automatically, with the
@@ -65,8 +65,8 @@ Finally, a good supplementary resource for writing clean PHP code is [Clean Code
65
65
[ per-cs ] : https://www.php-fig.org/per/coding-style/
66
66
[ pear-cs ] : https://pear.php.net/manual/en/standards.php
67
67
[ symfony-cs ] : https://symfony.com/doc/current/contributing/code/standards.html
68
- [ phpcs ] : https://github.com/squizlabs /PHP_CodeSniffer
69
- [ phpcbf ] : https://github.com/squizlabs /PHP_CodeSniffer/wiki/Fixing-Errors-Automatically
68
+ [ phpcs ] : https://github.com/PHPCSStandards /PHP_CodeSniffer
69
+ [ phpcbf ] : https://github.com/PHPCSStandards /PHP_CodeSniffer/wiki/Fixing-Errors-Automatically
70
70
[ st-cs ] : https://github.com/benmatselby/sublime-phpcs
71
71
[ phpcsfixer ] : https://cs.symfony.com/
72
72
[ cleancode ] : https://github.com/jupeter/clean-code-php
0 commit comments