Versions Compared

Key

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

...

 
Inspection nameError messageExample codeProblem descriptionSolved
 Drupal_Sniffs_Formatting_SpaceOperatorSniffA 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
colourRedGreen
titleNo
 
YES
Drupal_Sniffs_Array_ArraySniffA 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
  
Green
titleYES
PEAR_Sniffs_Functions_FunctionCallSignatureSniffMulti-line function call not indented correctly; expected 7 spaces but found 4
Code Block
languagephp
str_replace(
	'one',
	'two',
	'three'
);

Inspection thinks, that spaces need to be used to indent stuff and not TABs. It's not an error inside an inspection, because it's PEAR standard inspection, where this exactly is needed to be done.

We need to either found similar inspection, that uses TABs or create our own based on this one.

 

Status
colourGreen
titleYES
     
      

Coding standards used by other software