Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • which PHP_CodeSniffer inspections are failing
  • what are exact test case
  • what we can do about it

Problematic inspections

Inspection nameError messageExample codeProblem descriptionSolved
 A opeator statement must be followed by a single space
Code Block
languagephp
$this->Application =& kApplication::Instance();

Inspections should check, that operands are separated from operators by a single space.

Code Block
languagephp
titleGood
$a + $b
Code Block
languagephp
titleBad
$a+$b

However symbols "=" and "&" are operators on it's own ("equals" and "bitwise and") and probably during syntax check inspection isn't aware, that together ("=&") they represent assigning a value by reference.

Status
colourRed
titleNo
 A comma should follow the last multiline array item. Found: /*'k2',*/
Code Block
languagephp
$array = Array (
	'k1',
	/*'k2',*/
); 
   
Inspection forces usage of trailing comma after last array element. However in this example commented out code is present before array declaration end, which makes inspection go crazy and not notice actual comma after 'k1' code.
Status
colourRed
titleNo