Skip to content

Commit

Permalink
Allow curly braces to occur within brackets of condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuswilms committed Mar 23, 2011
1 parent ed94386 commit eb5c34c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Rule/ControlStructuresSpacingRule.php
Expand Up @@ -38,7 +38,21 @@ protected function doCheck()
$this->file->prev();
}

if ($this->file->seekTokenId(T_OPEN_CURLY)) {
while ($this->file->valid()) {
$this->file->seekTokenId(T_CLOSE_BRACKET);

while ($this->file->valid()) {
$this->file->next();

if ($this->file->current()->getId() !== T_WHITESPACE) {
continue(2);
}
if ($this->file->current()->getId() !== T_OPEN_CURLY) {
break(2);
}
}
}
if ($this->file->current()->getId() === T_OPEN_CURLY) {
$curlyToken = $this->file->current();

if ($controlToken->getLine() == $curlyToken->getLine()) {
Expand Down

0 comments on commit eb5c34c

Please sign in to comment.