@@ -2,5 +2,5 @@ |
||
| 2 | 2 | |
| 3 | 3 | function foobar($one, $two, $three) |
| 4 | 4 | { |
| 5 | - return 'Foobar'; |
|
| 5 | + return 'Foobar'; |
|
| 6 | 6 | } |
| 7 | 7 | \ No newline at end of file |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public function register() |
| 18 | 18 | { |
| 19 | - return [T_FUNCTION]; |
|
| 19 | + return [ T_FUNCTION ]; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -30,19 +30,19 @@ discard block |
||
| 30 | 30 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
| 31 | 31 | { |
| 32 | 32 | $tokens = $phpcsFile->getTokens(); |
| 33 | - $token = $tokens[$stackPtr]; |
|
| 33 | + $token = $tokens[ $stackPtr ]; |
|
| 34 | 34 | |
| 35 | 35 | // Skip function without body. |
| 36 | - if (isset($token['scope_opener']) === false) { |
|
| 36 | + if (isset($token[ 'scope_opener' ]) === false) { |
|
| 37 | 37 | return; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - $openParenthesisIndex = $token['parenthesis_opener']; |
|
| 41 | - $closedParenthesisIndex = $token['parenthesis_closer']; |
|
| 40 | + $openParenthesisIndex = $token[ 'parenthesis_opener' ]; |
|
| 41 | + $closedParenthesisIndex = $token[ 'parenthesis_closer' ]; |
|
| 42 | 42 | |
| 43 | 43 | $numberOfParameters = 0; |
| 44 | - for ($index=$openParenthesisIndex+1; $index <= $closedParenthesisIndex ; $index++) { |
|
| 45 | - if ($tokens[$index]['type'] == 'T_VARIABLE') { |
|
| 44 | + for ($index = $openParenthesisIndex + 1; $index <= $closedParenthesisIndex; $index++) { |
|
| 45 | + if ($tokens[ $index ][ 'type' ] == 'T_VARIABLE') { |
|
| 46 | 46 | $numberOfParameters++; |
| 47 | 47 | } |
| 48 | 48 | } |