aik099 / CodingStandard

The PHP_CodeSniffer coding standard I'm using on all of my projects
BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

Blank line inside IF detection with inline comments #40

Closed aik099 closed 9 years ago

aik099 commented 9 years ago

For code below I'm having strange error: Expected 0 blank lines at start of "if" control structure; -1 found:

if ( count($list->Records) > $list->GetSelectedCount() ) { // Has more records for next page.
    $next_block_params = $this->prepareTagParams($params);
}

Technically comment after { isn't on new line, so error message is wrong. I guess we can make an exception and allow such comments that follow { or } on same line.

aik099 commented 9 years ago

Only error message should be adapted because fixing properly shifts comment to next line.