0

I am looking into setting up the PHPCS to run at build time and report any issues.

Something that I find more readable is a start indentation based on an open PHP tag:

enter image description here

But PHPCS seems determined that I need to have something like this:

enter image description here

I understand that this may be a slippery slope and highly biased, but I would very much like to have this particular rule configured.

As a result, I get:

 2 | ERROR   | [ ] Missing file doc comment
 3 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 4
 3 | ERROR   | [ ] Expected "if (...) {\n"; found "if (...)\n    {\n"
 3 | WARNING | [ ] Line exceeds 85 characters; contains 94 characters
 3 | ERROR   | [x] There must be a single space between the closing parenthesis and the opening brace of a multi-line IF statement; found newline
 5 | ERROR   | [x] File is being conditionally included; use "include" instead
 5 | WARNING | [ ] Line exceeds 85 characters; contains 89 characters
 6 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 4

I am interested in this error in particular:

 3 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 4

So far, I have identified that this error came from:

/usr/share/php/PHP/CodeSniffer/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php#955

Is there a way to do that?

Jovan Perovic
  • 19,846
  • 5
  • 44
  • 85

0 Answers0