phpcs Questions
2
Solved
I have the following code:
/**
* @param TranscodingJob $transcodingJob
*
* @return TranscodingJob
* @throws \Lexik\Bundle\WorkflowBundle\Exception\WorkflowException
*/
public function onTran...
2
I am using PHPCS and PHPCBF for WordPress development in VS Code.( as per instructions mentioned in https://github.com/tommcfarlin/phpcs-wpcs-vscode )
While PHPCBF is formatting the codes as per WP...
Berezniki asked 9/10, 2020 at 17:55
3
Solved
I want to configure multiple installed paths for phpcs.
I can add one via:
phpcs --config-set installed_paths the/dir/to/standard
I tried adding multiple by using : yet it did not work and the m...
Napier asked 19/6, 2015 at 8:51
2
Solved
PHPCS is checking my JS files on PhpStorm,
I need to disable this feature
I added this line in the file phpcs.xml.dist but no luck
<exclude-pattern>*\.(inc|css|js)</exclude-pattern>
...
Cheat asked 23/11, 2018 at 21:39
3
I want to add PHP CodeSniffer to VScode.
Within VScode I am getting the error 'phpcs: Referenced sniff "WordPress-Core" does not exist'
However when I run the following command in the terminal:...
Claar asked 18/2, 2020 at 16:2
2
Solved
I am currently working on cleaning up an existing codebase and one of the aspects involve using PHPCS. This is my phpcs.xml file at the moment:
<?xml version='1.0'?>
<ruleset name='MyAppl...
4
Solved
My TestMyClass.php has two class definitions in the same file (unit testing class), and PHP Code Sniffer complains about each class must be in a file by itself. How can I suppress this warning?
cl...
3
Solved
I understand how phpcs is configurated with xml, but can not find how I disable some sniffs. This ist my current conf (don‘t even know if this is correct):
<?xml version="1.0" encoding="UTF-8"?...
Drava asked 20/6, 2018 at 9:35
1
Solved
My attempt to exclude the check for the EOL char on my Windows machine always results in this error message:
>vendor\bin\phpcs.bat --standard=PSR2 --exclude=Generic.Files.LineEndings.InvalidEOL...
Halinahalite asked 11/3, 2019 at 9:31
1
Solved
I want to run phpcs tool, but this error is coming,
ERROR: Referenced sniff "PHPCompatibility" does not exist
I ran phpcs -i. That gave me ,
The installed coding standards are PEAR, PSR1, Zend, S...
1
Solved
How to resolve this phpcs error? It shows up for the class Keyword in all Laravel migrations files. The error message is:
Each class must be in a namespace of at least one level (a top-level
ve...
1
Solved
I spent hours on Google searching for an answer too this before asking, in phpcs I had this error "PHP version not specified", but I couldn't find an answer on Google, eventually I've just came acr...
1
I am new to VS code. I am trying to work with PHP, but I keep getting this notification.
phpcs: Request workspace/configuration failed with message:unable to
locate phpcs. please add phpcs to y...
Vent asked 28/4, 2018 at 15:51
2
Solved
I've spent now over 2h on trying to figure out how to require the { in the same line as the method declaration instead of the default requirement being the next line. How can I get this done? I've ...
Bord asked 15/9, 2015 at 12:18
1
Solved
I'm working on a proprietary legacy code base and some variables are camel-cased while others are snake-cased. I'd like to clean up and enforce only camel-cased variable names but I can't seem to f...
Fates asked 6/8, 2017 at 9:49
1
Solved
Not sure if this a better question for here or SuperUser. If it belongs there feel free to move it.
I'm using php-cs-fixer, and I have a unique requirement on indentations - I need two spaces rath...
Ingeborg asked 12/5, 2016 at 17:18
1
Solved
Scenario
Some times, I want to run PHPCS, but have it ignore one rule, in this case the Camel Case Method Name rule.
I know that I can create a new ruleset which inherits all from another ruleset...
Contemplative asked 26/2, 2016 at 12:54
1
Solved
When running phpcs, I am getting an error of Protected member variable "myMethod" must contain a leading underscore. How do I exclude/ignore this error on the ruleset.xml?
<?xml version="1.0"?&...
Perlite asked 23/5, 2016 at 19:29
1
© 2022 - 2024 — McMap. All rights reserved.