@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | * @var array |
| 35 | 35 | */ |
| 36 | 36 | public $supportedTokenizers = array( |
| 37 | - 'PHP', |
|
| 38 | - 'JS', |
|
| 39 | - ); |
|
| 37 | + 'PHP', |
|
| 38 | + 'JS', |
|
| 39 | + ); |
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * An array of functions we don't want in the condition of loops. |
@@ -44,12 +44,12 @@ discard block |
||
| 44 | 44 | * @return array |
| 45 | 45 | */ |
| 46 | 46 | protected $forbiddenFunctions = array( |
| 47 | - 'PHP' => array( |
|
| 48 | - 'sizeof' => true, |
|
| 49 | - 'strlen' => true, |
|
| 50 | - 'count' => true, |
|
| 51 | - ), |
|
| 52 | - 'JS' => array('length' => true), |
|
| 47 | + 'PHP' => array( |
|
| 48 | + 'sizeof' => true, |
|
| 49 | + 'strlen' => true, |
|
| 50 | + 'count' => true, |
|
| 51 | + ), |
|
| 52 | + 'JS' => array('length' => true), |
|
| 53 | 53 | ); |
| 54 | 54 | |
| 55 | 55 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | return array( |
| 64 | 64 | T_WHILE, |
| 65 | 65 | T_FOR, |
| 66 | - ); |
|
| 66 | + ); |
|
| 67 | 67 | |
| 68 | 68 | }//end register() |
| 69 | 69 | |
@@ -167,9 +167,9 @@ discard block |
||
| 167 | 167 | if ($contentColumn !== $indent) { |
| 168 | 168 | $error = 'First line of embedded PHP code must be indented %s spaces; %s found'; |
| 169 | 169 | $data = array( |
| 170 | - $indent, |
|
| 171 | - $contentColumn, |
|
| 172 | - ); |
|
| 170 | + $indent, |
|
| 171 | + $contentColumn, |
|
| 172 | + ); |
|
| 173 | 173 | $fix = $phpcsFile->addFixableError($error, $firstContent, 'Indent', $data); |
| 174 | 174 | if ($fix === true) { |
| 175 | 175 | $padding = str_repeat(' ', $indent); |
@@ -225,9 +225,9 @@ discard block |
||
| 225 | 225 | if ($found > $expected) { |
| 226 | 226 | $error = 'Opening PHP tag indent incorrect; expected no more than %s spaces but found %s'; |
| 227 | 227 | $data = array( |
| 228 | - $expected, |
|
| 229 | - $found, |
|
| 230 | - ); |
|
| 228 | + $expected, |
|
| 229 | + $found, |
|
| 230 | + ); |
|
| 231 | 231 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'OpenTagIndent', $data); |
| 232 | 232 | if ($fix === true) { |
| 233 | 233 | $phpcsFile->fixer->replaceToken(($stackPtr - 1), str_repeat(' ', $expected)); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $indent, |
| 171 | 171 | $contentColumn, |
| 172 | 172 | ); |
| 173 | - $fix = $phpcsFile->addFixableError($error, $firstContent, 'Indent', $data); |
|
| 173 | + $fix = $phpcsFile->addFixableError($error, $firstContent, 'Indent', $data); |
|
| 174 | 174 | if ($fix === true) { |
| 175 | 175 | $padding = str_repeat(' ', $indent); |
| 176 | 176 | if ($contentColumn === 0) { |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | $expected, |
| 229 | 229 | $found, |
| 230 | 230 | ); |
| 231 | - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'OpenTagIndent', $data); |
|
| 231 | + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'OpenTagIndent', $data); |
|
| 232 | 232 | if ($fix === true) { |
| 233 | 233 | $phpcsFile->fixer->replaceToken(($stackPtr - 1), str_repeat(' ', $expected)); |
| 234 | 234 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | /** |
| 42 | 42 | * Returns an array of tokens this test wants to listen for. |
| 43 | 43 | * |
| 44 | - * @return array |
|
| 44 | + * @return integer[] |
|
| 45 | 45 | */ |
| 46 | 46 | public function register() |
| 47 | 47 | { |
@@ -44,11 +44,11 @@ |
||
| 44 | 44 | * @var array(string => string|null) |
| 45 | 45 | */ |
| 46 | 46 | public $forbiddenFunctions = array( |
| 47 | - 'sizeof' => 'count', |
|
| 48 | - 'delete' => 'unset', |
|
| 49 | - 'print' => 'echo', |
|
| 50 | - 'is_null' => null, |
|
| 51 | - 'create_function' => null, |
|
| 52 | - ); |
|
| 47 | + 'sizeof' => 'count', |
|
| 48 | + 'delete' => 'unset', |
|
| 49 | + 'print' => 'echo', |
|
| 50 | + 'is_null' => null, |
|
| 51 | + 'create_function' => null, |
|
| 52 | + ); |
|
| 53 | 53 | |
| 54 | 54 | }//end class |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | T_RETURN, |
| 46 | 46 | T_THROW, |
| 47 | 47 | T_EXIT, |
| 48 | - ); |
|
| 48 | + ); |
|
| 49 | 49 | |
| 50 | 50 | }//end register() |
| 51 | 51 | |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | $end = $phpcsFile->findEndOfStatement($stackPtr); |
| 117 | 117 | $next = $phpcsFile->findNext( |
| 118 | 118 | array( |
| 119 | - T_CASE, |
|
| 120 | - T_DEFAULT, |
|
| 121 | - T_CLOSE_CURLY_BRACKET, |
|
| 119 | + T_CASE, |
|
| 120 | + T_DEFAULT, |
|
| 121 | + T_CLOSE_CURLY_BRACKET, |
|
| 122 | 122 | ), |
| 123 | 123 | ($end + 1) |
| 124 | 124 | ); |
@@ -153,10 +153,10 @@ discard block |
||
| 153 | 153 | if (isset($tokens[$prev]['parenthesis_owner']) === true) { |
| 154 | 154 | $owner = $tokens[$prev]['parenthesis_owner']; |
| 155 | 155 | $ignore = array( |
| 156 | - T_IF => true, |
|
| 157 | - T_ELSE => true, |
|
| 158 | - T_ELSEIF => true, |
|
| 159 | - ); |
|
| 156 | + T_IF => true, |
|
| 157 | + T_ELSE => true, |
|
| 158 | + T_ELSEIF => true, |
|
| 159 | + ); |
|
| 160 | 160 | if (isset($ignore[$tokens[$owner]['code']]) === true) { |
| 161 | 161 | return; |
| 162 | 162 | } |
@@ -41,10 +41,10 @@ |
||
| 41 | 41 | * @var array(string => string|null) |
| 42 | 42 | */ |
| 43 | 43 | public $forbiddenFunctions = array( |
| 44 | - 'error_log' => null, |
|
| 45 | - 'print_r' => null, |
|
| 46 | - 'var_dump' => null, |
|
| 47 | - ); |
|
| 44 | + 'error_log' => null, |
|
| 45 | + 'print_r' => null, |
|
| 46 | + 'var_dump' => null, |
|
| 47 | + ); |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * If true, an error will be thrown; otherwise a warning. |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | * @var array |
| 37 | 37 | */ |
| 38 | 38 | public $supportedTokenizers = array( |
| 39 | - 'PHP', |
|
| 40 | - 'CSS', |
|
| 41 | - ); |
|
| 39 | + 'PHP', |
|
| 40 | + 'CSS', |
|
| 41 | + ); |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * If a comment is more than $maxPercentage% code, a warning will be shown. |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | T_ENCAPSED_AND_WHITESPACE => true, |
| 159 | 159 | T_NONE => true, |
| 160 | 160 | T_COMMENT => true, |
| 161 | - ); |
|
| 161 | + ); |
|
| 162 | 162 | |
| 163 | 163 | $numTokens = count($stringTokens); |
| 164 | 164 | |
@@ -124,9 +124,9 @@ |
||
| 124 | 124 | if ($content !== strtolower($content)) { |
| 125 | 125 | $error = 'Calls to inbuilt PHP functions must be lowercase; expected "%s" but found "%s"'; |
| 126 | 126 | $data = array( |
| 127 | - strtolower($content), |
|
| 128 | - $content, |
|
| 129 | - ); |
|
| 127 | + strtolower($content), |
|
| 128 | + $content, |
|
| 129 | + ); |
|
| 130 | 130 | |
| 131 | 131 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'CallUppercase', $data); |
| 132 | 132 | if ($fix === true) { |
@@ -62,13 +62,13 @@ |
||
| 62 | 62 | $prev = $phpcsFile->findPrevious($allowedTokens, ($stackPtr - 1), null, true); |
| 63 | 63 | |
| 64 | 64 | $allowedTokens = array( |
| 65 | - T_EQUAL => true, |
|
| 66 | - T_DOUBLE_ARROW => true, |
|
| 67 | - T_THROW => true, |
|
| 68 | - T_RETURN => true, |
|
| 69 | - T_INLINE_THEN => true, |
|
| 70 | - T_INLINE_ELSE => true, |
|
| 71 | - ); |
|
| 65 | + T_EQUAL => true, |
|
| 66 | + T_DOUBLE_ARROW => true, |
|
| 67 | + T_THROW => true, |
|
| 68 | + T_RETURN => true, |
|
| 69 | + T_INLINE_THEN => true, |
|
| 70 | + T_INLINE_ELSE => true, |
|
| 71 | + ); |
|
| 72 | 72 | |
| 73 | 73 | if (isset($allowedTokens[$tokens[$prev]['code']]) === false) { |
| 74 | 74 | $error = 'New objects must be assigned to a variable'; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | public function SelfMemberReferenceUnitTestExample() |
| 15 | 15 | { |
| 16 | - $testResults =& $this->testResults; |
|
| 16 | + $testResults = & $this->testResults; |
|
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | // Correct call to self. |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | MyClass::test($value); |
| 58 | 58 | }; |
| 59 | 59 | |
| 60 | - $array = array(1,2,3); |
|
| 60 | + $array = array(1, 2, 3); |
|
| 61 | 61 | array_walk($array, $callback); |
| 62 | 62 | } |
| 63 | 63 | } |