For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > November 2007 > CodeSniffer padding question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author CodeSniffer padding question
Tim Rupp

2007-11-14, 7:06 pm

Hi list,

I'm trying out the PHP_CodeSniffer package and ran into a slight
quirk. I was hoping someone could point me in the right direction.

I'm using the MultipleStatementAlignmentSniff.php sniff, and have code
that looks like this.

$log = steLog::getInstance();
$string = removeWhitespace($message);
$log->log($string);

The space after the $log line is a tab. The space after the $string
line is also a tab.

phpcs flags this as

--------------------------------------------------------------------------------
142 | WARNING | Equals sign not aligned with surrounding assignments; expected
| | 4 spaces but found 1 space
--------------------------------------------------------------------------------

I can make the error go away if I turn the first tab into 4 spaces,
but this is not what I want to do. I want to keep the tab and have
phpcs notice that they are properly aligned.

Any suggestions? Or is this a bug that should be reported?

Thanks,
Tim
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com