Commit: 9867c4ecadc507d6660ff6ac855cd3c95b910e6b

Author: David Persson | Date: 2009-12-03 22:05:40 +0100
Converting tabs to spaces in rules to comply with PHPca standard.
diff --git a/extensions/phpca/Rule/EmptyLineBeforeCloseTagRule.php b/extensions/phpca/Rule/EmptyLineBeforeCloseTagRule.php index e8dcefb..e7d221a 100644 --- a/extensions/phpca/Rule/EmptyLineBeforeCloseTagRule.php +++ b/extensions/phpca/Rule/EmptyLineBeforeCloseTagRule.php @@ -13,19 +13,19 @@ class EmptyLineBeforeCloseTagRule extends Rule * @returns null */ protected function doCheck() - { - $this->file->seekTokenId(T_CLOSE_TAG); - $this->file->prev(); - $token = $this->file->current(); + { + $this->file->seekTokenId(T_CLOSE_TAG); + $this->file->prev(); + $token = $this->file->current(); - if (!$token) { - return null; - } - $lineEndings = $this->configuration->getLineEndings(); + if (!$token) { + return null; + } + $lineEndings = $this->configuration->getLineEndings(); - if (addcslashes($token->getText(), "\0..\37") != $lineEndings . $lineEndings) { + if (addcslashes($token->getText(), "\0..\37") != $lineEndings . $lineEndings) { $this->addViolation('File has no empty line before PHP close tag', $token); - } + } } } ?> \ No newline at end of file diff --git a/extensions/phpca/Rule/MaximumLineLengthRule.php b/extensions/phpca/Rule/MaximumLineLengthRule.php index 5a41845..0dcae67 100644 --- a/extensions/phpca/Rule/MaximumLineLengthRule.php +++ b/extensions/phpca/Rule/MaximumLineLengthRule.php @@ -15,17 +15,17 @@ class MaximumLineLengthRule extends Rule * @returns null */ protected function doCheck() - { - $lines = explode( - stripcslashes($this->configuration->getLineEndings()), - $this->file->getSourceCode() - ); - foreach ($lines as $i => $line) { - if (strlen($line) > $this->settings['line_length']) { - $token = new Token(T_ANY, $line, $i + 1, $this->settings['line_length'] + 1); - $this->addViolation('Maximum line length exceeded', $token); - } - } - } + { + $lines = explode( + stripcslashes($this->configuration->getLineEndings()), + $this->file->getSourceCode() + ); + foreach ($lines as $i => $line) { + if (strlen($line) > $this->settings['line_length']) { + $token = new Token(T_ANY, $line, $i + 1, $this->settings['line_length'] + 1); + $this->addViolation('Maximum line length exceeded', $token); + } + } + } } ?> \ No newline at end of file diff --git a/extensions/phpca/Rule/NoEolAtEofRule.php b/extensions/phpca/Rule/NoEolAtEofRule.php index 8122b0d..b8ac56c 100644 --- a/extensions/phpca/Rule/NoEolAtEofRule.php +++ b/extensions/phpca/Rule/NoEolAtEofRule.php @@ -15,16 +15,16 @@ class NoEolAtEofRule extends Rule * @returns null */ protected function doCheck() - { - $content = $this->file->getSourceCode(); - $eol = stripcslashes($this->configuration->getLineEndings()); - $eof = substr($content, - strlen($eol)); + { + $content = $this->file->getSourceCode(); + $eol = stripcslashes($this->configuration->getLineEndings()); + $eof = substr($content, - strlen($eol)); - if ($eof == $eol) { - $line = substr_count($content, $eol); - $token = new Token(T_WHITESPACE, $eof, $line - 1); - $this->addViolation('EOL at EOF', $token); - } - } + if ($eof == $eol) { + $line = substr_count($content, $eol); + $token = new Token(T_WHITESPACE, $eof, $line - 1); + $this->addViolation('EOL at EOF', $token); + } + } } ?> \ No newline at end of file diff --git a/extensions/phpca/Rule/OneClassPerFileRule.php b/extensions/phpca/Rule/OneClassPerFileRule.php index b8b28d3..bd6ca74 100644 --- a/extensions/phpca/Rule/OneClassPerFileRule.php +++ b/extensions/phpca/Rule/OneClassPerFileRule.php @@ -16,7 +16,7 @@ class OneClassPerFileRule extends Rule { $count = 0; - while ($this->file->seekTokenId(T_CLASS)) { + while ($this->file->seekTokenId(T_CLASS)) { $count++; $token = $this->file->current(); @@ -27,6 +27,6 @@ class OneClassPerFileRule extends Rule $this->file->seekToken($token); $this->file->next(); } - } + } } ?> \ No newline at end of file