I want to make sure all classes in some dir (src/Controller/CP) extend some other class AbstractCPController. So that would show PHPCS error, and would be fine. Is that possible with PHPCS? Answer I ended up creating my own Sniff. Its far from perfect but may serve as a base for somebody in the future:
Tag: phpcs
How do I prevent PHP CS Fixer from fixing specific function names?
When using PHP CS Fixer to resolve syntax errors on file save and using the Symfony rule set, any function names that are not camelCase will be corrected (as expected). However when writing PHP Unit based tests, it’s often common practice to make the function names snake_case. This normally means that PHP CS Fixer will resolve the issue automatically, even
Is there a way to break down a namespace in PHP?
I found myself looking on the internet for someone who has already answered it, but I can’t find any. I was cleaning up some code with a strict PSR12 standard, and I found this issue with namespace …
PHP CodeSniffer Error: The phpcs report contains invalid json
I want to add PHP CodeSniffer to VScode. Within VScode I am getting the error ‘phpcs: The phpcs report contains invalid json’ However when I run the following command in the terminal: phpcs –…