Closed (fixed)
Project:
Drupal Code Sniffer
Version:
7.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Aug 2012 at 23:42 UTC
Updated:
11 Sep 2012 at 06:21 UTC
example:
function blah() {
...
return ($a['Hours'] < $b['Hours']) ? -1 : 1;
}
Gives: ERROR | Expected 1 space after "-"; 0 found
Encapsulating -1 in brackets causes it to pass but shouldn't be necessary. Like so:
return ($a['Hours'] < $b['Hours']) ? (-1) : 1;
Comments
Comment #1
das-peter commentedTo check this style we simply use
Squiz_Sniffs_WhiteSpace_OperatorSpacingSniff.Klausi fixed the issue you mention in
Squiz_Sniffs_WhiteSpace_OperatorSpacingSniffitself and sent a pull request, which was accepted: https://github.com/klausi/PHP_CodeSniffer/commit/38272abf05d20398b19246f...Thus an upgrade of PHP_CodeSniffer should fix this issue:
pear upgrade PHP_CodeSniffer