cakephp-codesniffer
cakephp-codesniffer copied to clipboard
CakePHP Code Sniffer
Refs https://github.com/slevomat/coding-standard/issues/1649 For existing (core) code we could skip/silence the sniff, so it mainly only reports for Model/ layer for now.
First stab at https://github.com/cakephp/cakephp-codesniffer/issues/368 It will also require test harness to be fixed up for 8.1+ > Declaration of PHP_CodeSniffer\Tests\TestSuite::run(?PHPUnit\Framework\TestResult $result = null) must be compatible with PHPUnit\Framework\TestSuite::run(?PHPUnit\Framework\TestResult $result =...
Related to #382 Just created a project with CakePHP 4 and configured PHPStorm to use phpcs and this standard. Issue 382 refers to a warning relating to slevomat/coding-standard. Version 4.7...
I see that current Cake5 sniffer version is still 7.2+ It seems to work with union types and other PHP 8+ topics, but still is PHP 7 Is there any...
Ran `phpcbf --colors -p src/ tests/` on my CakePHP 5 project: ``` Fatal error: Uncaught PHP_CodeSniffer\Exceptions\RuntimeException: Undefined property: PHPStan\PhpDocParser\Ast\PhpDoc\TypelessParamTagValueNode::$type in /srv/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/TypeHintSniff.php on line 104 in /srv/app/vendor/squizlabs/php_codesniffer/src/Runner.php:623 Stack trace: #0 /srv/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/TypeHintSniff.php(104):...
I recommend adding/porting a few snippets from the current leading collection of sane sniffs^^ - https://github.com/php-collective/code-sniffer/blob/master/PhpCollective/Sniffs/PHP/RemoveFunctionAliasSniff.php ( refs https://github.com/cakephp/cakephp/pull/17864#discussion_r1728959307 ) as well as a few other useful ones.