@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | /** |
68 | 68 | * Processes the function tokens within the class. |
69 | 69 | * |
70 | - * @param PHP_CodeSniffer_File $phpcsFile The file where this token was found. |
|
70 | + * @param File $phpcsFile The file where this token was found. |
|
71 | 71 | * @param int $stackPtr The position where the token was found. |
72 | 72 | * @param int $currScope The current scope opener token. |
73 | 73 | * |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * Processes a token that is found within the scope that this test is |
151 | 151 | * listening to. |
152 | 152 | * |
153 | - * @param PHP_CodeSniffer_File $phpcsFile The file where this token was found. |
|
153 | + * @param File $phpcsFile The file where this token was found. |
|
154 | 154 | * @param int $stackPtr The position in the stack where this |
155 | 155 | * token was found. |
156 | 156 | * |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | /** |
191 | 191 | * Returns the namespace declaration of a file. |
192 | 192 | * |
193 | - * @param PHP_CodeSniffer_File $phpcsFile The file where this token was found. |
|
193 | + * @param File $phpcsFile The file where this token was found. |
|
194 | 194 | * @param int $stackPtr The position where the search for the |
195 | 195 | * namespace declaration will start. |
196 | 196 | * |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * Returns an array of tokens this test wants to listen for. |
22 | 22 | * |
23 | - * @return array |
|
23 | + * @return integer[] |
|
24 | 24 | */ |
25 | 25 | public function register() |
26 | 26 | { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | /** |
36 | 36 | * Processes this test, when one of its tokens is encountered. |
37 | 37 | * |
38 | - * @param PHP_CodeSniffer_File $phpcsFile The current file being processed. |
|
38 | + * @param File $phpcsFile The current file being processed. |
|
39 | 39 | * @param int $stackPtr The position of the current token in the |
40 | 40 | * stack passed in $tokens. |
41 | 41 | * |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | return array( |
42 | 42 | T_CLASS, |
43 | 43 | T_INTERFACE, |
44 | - ); |
|
44 | + ); |
|
45 | 45 | |
46 | 46 | }//end register() |
47 | 47 | |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | $type = ucfirst($tokens[$stackPtr]['content']); |
85 | 85 | $error = '%s name "%s" is not in camel caps format'; |
86 | 86 | $data = array( |
87 | - $type, |
|
88 | - $name, |
|
89 | - ); |
|
87 | + $type, |
|
88 | + $name, |
|
89 | + ); |
|
90 | 90 | $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $data); |
91 | 91 | $phpcsFile->recordMetric($stackPtr, 'CamelCase class name', 'no'); |
92 | 92 | } else { |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * Process the return comment of this function comment. |
22 | 22 | * |
23 | - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
|
23 | + * @param File $phpcsFile The file being scanned. |
|
24 | 24 | * @param int $stackPtr The position of the current token |
25 | 25 | * in the stack passed in $tokens. |
26 | 26 | * @param int $commentStart The position in the stack where the comment started. |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | /** |
145 | 145 | * Process any throw tags that this function comment has. |
146 | 146 | * |
147 | - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
|
147 | + * @param File $phpcsFile The file being scanned. |
|
148 | 148 | * @param int $stackPtr The position of the current token |
149 | 149 | * in the stack passed in $tokens. |
150 | 150 | * @param int $commentStart The position in the stack where the comment started. |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | /** |
214 | 214 | * Process the function parameter comments. |
215 | 215 | * |
216 | - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
|
216 | + * @param File $phpcsFile The file being scanned. |
|
217 | 217 | * @param int $stackPtr The position of the current token |
218 | 218 | * in the stack passed in $tokens. |
219 | 219 | * @param int $commentStart The position in the stack where the comment started. |
@@ -88,9 +88,9 @@ discard block |
||
88 | 88 | if ($content !== $suggestedType) { |
89 | 89 | $error = 'Expected "%s" but found "%s" for function return type'; |
90 | 90 | $data = array( |
91 | - $suggestedType, |
|
92 | - $content, |
|
93 | - ); |
|
91 | + $suggestedType, |
|
92 | + $content, |
|
93 | + ); |
|
94 | 94 | $fix = $phpcsFile->addFixableError($error, $return, 'InvalidReturn', $data); |
95 | 95 | if ($fix === true) { |
96 | 96 | $phpcsFile->fixer->replaceToken(($return + 2), $suggestedType); |
@@ -277,10 +277,10 @@ discard block |
||
277 | 277 | $varSpace = strlen($matches[3]); |
278 | 278 | $comment = $matches[4]; |
279 | 279 | $commentLines[] = array( |
280 | - 'comment' => $comment, |
|
281 | - 'token' => ($tag + 2), |
|
282 | - 'indent' => $varSpace, |
|
283 | - ); |
|
280 | + 'comment' => $comment, |
|
281 | + 'token' => ($tag + 2), |
|
282 | + 'indent' => $varSpace, |
|
283 | + ); |
|
284 | 284 | |
285 | 285 | // Any strings until the next tag belong to this comment. |
286 | 286 | if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) { |
@@ -298,10 +298,10 @@ discard block |
||
298 | 298 | |
299 | 299 | $comment .= ' '.$tokens[$i]['content']; |
300 | 300 | $commentLines[] = array( |
301 | - 'comment' => $tokens[$i]['content'], |
|
302 | - 'token' => $i, |
|
303 | - 'indent' => $indent, |
|
304 | - ); |
|
301 | + 'comment' => $tokens[$i]['content'], |
|
302 | + 'token' => $i, |
|
303 | + 'indent' => $indent, |
|
304 | + ); |
|
305 | 305 | } |
306 | 306 | } |
307 | 307 | } else { |
@@ -319,13 +319,13 @@ discard block |
||
319 | 319 | }//end if |
320 | 320 | |
321 | 321 | $params[] = array( |
322 | - 'tag' => $tag, |
|
323 | - 'type' => $type, |
|
324 | - 'var' => $var, |
|
325 | - 'comment' => $comment, |
|
326 | - 'commentLines' => $commentLines, |
|
327 | - 'type_space' => $typeSpace, |
|
328 | - 'var_space' => $varSpace, |
|
322 | + 'tag' => $tag, |
|
323 | + 'type' => $type, |
|
324 | + 'var' => $var, |
|
325 | + 'comment' => $comment, |
|
326 | + 'commentLines' => $commentLines, |
|
327 | + 'type_space' => $typeSpace, |
|
328 | + 'var_space' => $varSpace, |
|
329 | 329 | ); |
330 | 330 | }//end foreach |
331 | 331 | |
@@ -353,9 +353,9 @@ discard block |
||
353 | 353 | if ($typeName !== $suggestedName) { |
354 | 354 | $error = 'Expected "%s" but found "%s" for parameter type'; |
355 | 355 | $data = array( |
356 | - $suggestedName, |
|
357 | - $typeName, |
|
358 | - ); |
|
356 | + $suggestedName, |
|
357 | + $typeName, |
|
358 | + ); |
|
359 | 359 | |
360 | 360 | $fix = $phpcsFile->addFixableError($error, $param['tag'], 'IncorrectParamVarName', $data); |
361 | 361 | if ($fix === true) { |
@@ -397,9 +397,9 @@ discard block |
||
397 | 397 | if ($typeHint === '') { |
398 | 398 | $error = 'Type hint "%s" missing for %s'; |
399 | 399 | $data = array( |
400 | - $suggestedTypeHint, |
|
401 | - $param['var'], |
|
402 | - ); |
|
400 | + $suggestedTypeHint, |
|
401 | + $param['var'], |
|
402 | + ); |
|
403 | 403 | |
404 | 404 | $errorCode = 'TypeHintMissing'; |
405 | 405 | if ($suggestedTypeHint === 'string' |
@@ -414,10 +414,10 @@ discard block |
||
414 | 414 | } else if ($typeHint !== substr($suggestedTypeHint, (strlen($typeHint) * -1))) { |
415 | 415 | $error = 'Expected type hint "%s"; found "%s" for %s'; |
416 | 416 | $data = array( |
417 | - $suggestedTypeHint, |
|
418 | - $typeHint, |
|
419 | - $param['var'], |
|
420 | - ); |
|
417 | + $suggestedTypeHint, |
|
418 | + $typeHint, |
|
419 | + $param['var'], |
|
420 | + ); |
|
421 | 421 | $phpcsFile->addError($error, $stackPtr, 'IncorrectTypeHint', $data); |
422 | 422 | }//end if |
423 | 423 | } else if ($suggestedTypeHint === '' && isset($realParams[$pos]) === true) { |
@@ -425,9 +425,9 @@ discard block |
||
425 | 425 | if ($typeHint !== '') { |
426 | 426 | $error = 'Unknown type hint "%s" found for %s'; |
427 | 427 | $data = array( |
428 | - $typeHint, |
|
429 | - $param['var'], |
|
430 | - ); |
|
428 | + $typeHint, |
|
429 | + $param['var'], |
|
430 | + ); |
|
431 | 431 | $phpcsFile->addError($error, $stackPtr, 'InvalidTypeHint', $data); |
432 | 432 | } |
433 | 433 | }//end if |
@@ -445,9 +445,9 @@ discard block |
||
445 | 445 | if ($param['type_space'] !== $spaces) { |
446 | 446 | $error = 'Expected %s spaces after parameter type; %s found'; |
447 | 447 | $data = array( |
448 | - $spaces, |
|
449 | - $param['type_space'], |
|
450 | - ); |
|
448 | + $spaces, |
|
449 | + $param['type_space'], |
|
450 | + ); |
|
451 | 451 | |
452 | 452 | $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamType', $data); |
453 | 453 | if ($fix === true) { |
@@ -485,8 +485,8 @@ discard block |
||
485 | 485 | if ($realName !== $param['var']) { |
486 | 486 | $code = 'ParamNameNoMatch'; |
487 | 487 | $data = array( |
488 | - $param['var'], |
|
489 | - $realName, |
|
488 | + $param['var'], |
|
489 | + $realName, |
|
490 | 490 | ); |
491 | 491 | |
492 | 492 | $error = 'Doc comment for parameter %s does not match '; |
@@ -514,9 +514,9 @@ discard block |
||
514 | 514 | if ($param['var_space'] !== $spaces) { |
515 | 515 | $error = 'Expected %s spaces after parameter name; %s found'; |
516 | 516 | $data = array( |
517 | - $spaces, |
|
518 | - $param['var_space'], |
|
519 | - ); |
|
517 | + $spaces, |
|
518 | + $param['var_space'], |
|
519 | + ); |
|
520 | 520 | |
521 | 521 | $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamName', $data); |
522 | 522 | if ($fix === true) { |
@@ -91,7 +91,7 @@ |
||
91 | 91 | $suggestedType, |
92 | 92 | $content, |
93 | 93 | ); |
94 | - $fix = $phpcsFile->addFixableError($error, $return, 'InvalidReturn', $data); |
|
94 | + $fix = $phpcsFile->addFixableError($error, $return, 'InvalidReturn', $data); |
|
95 | 95 | if ($fix === true) { |
96 | 96 | $phpcsFile->fixer->replaceToken(($return + 2), $suggestedType); |
97 | 97 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | /** |
31 | 31 | * Processes the function tokens within the class. |
32 | 32 | * |
33 | - * @param PHP_CodeSniffer_File $phpcsFile The file where this token was found. |
|
33 | + * @param File $phpcsFile The file where this token was found. |
|
34 | 34 | * @param int $stackPtr The position where the token was found. |
35 | 35 | * @param int $currScope The current scope opener token. |
36 | 36 | * |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | * Processes a token that is found within the scope that this test is |
181 | 181 | * listening to. |
182 | 182 | * |
183 | - * @param PHP_CodeSniffer_File $phpcsFile The file where this token was found. |
|
183 | + * @param File $phpcsFile The file where this token was found. |
|
184 | 184 | * @param int $stackPtr The position in the stack where this |
185 | 185 | * token was found. |
186 | 186 | * |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | if ($tokens[$nextToken]['code'] === T_NEW) { |
107 | 107 | $currException = $phpcsFile->findNext( |
108 | 108 | array( |
109 | - T_NS_SEPARATOR, |
|
110 | - T_STRING, |
|
109 | + T_NS_SEPARATOR, |
|
110 | + T_STRING, |
|
111 | 111 | ), |
112 | 112 | $currPos, |
113 | 113 | $currScopeEnd, |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | if ($currException !== false) { |
120 | 120 | $endException = $phpcsFile->findNext( |
121 | 121 | array( |
122 | - T_NS_SEPARATOR, |
|
123 | - T_STRING, |
|
122 | + T_NS_SEPARATOR, |
|
123 | + T_STRING, |
|
124 | 124 | ), |
125 | 125 | ($currException + 1), |
126 | 126 | $currScopeEnd, |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | if ($tokenCount !== $tagCount) { |
180 | 180 | $error = 'Expected %s @throws tag(s) in function comment; %s found'; |
181 | 181 | $data = array( |
182 | - $tokenCount, |
|
183 | - $tagCount, |
|
184 | - ); |
|
182 | + $tokenCount, |
|
183 | + $tagCount, |
|
184 | + ); |
|
185 | 185 | $phpcsFile->addError($error, $commentEnd, 'WrongNumber', $data); |
186 | 186 | return; |
187 | 187 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * Returns the token types that this sniff is interested in. |
28 | 28 | * |
29 | - * @return int[] |
|
29 | + * @return integer[] |
|
30 | 30 | */ |
31 | 31 | public function register() |
32 | 32 | { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | /** |
39 | 39 | * Processes the tokens that this sniff is interested in. |
40 | 40 | * |
41 | - * @param PHP_CodeSniffer_File $phpcsFile The file where the token was found. |
|
41 | + * @param File $phpcsFile The file where the token was found. |
|
42 | 42 | * @param int $stackPtr The position in the stack where |
43 | 43 | * the token was found. |
44 | 44 | * |
@@ -70,9 +70,9 @@ |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | $find = array( |
73 | - T_CLOSE_CURLY_BRACKET, |
|
74 | - T_COMMENT, |
|
75 | - T_OPEN_TAG, |
|
73 | + T_CLOSE_CURLY_BRACKET, |
|
74 | + T_COMMENT, |
|
75 | + T_OPEN_TAG, |
|
76 | 76 | ); |
77 | 77 | |
78 | 78 | while ($next !== false) { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | /** |
67 | 67 | * Returns an array of tokens this test wants to listen for. |
68 | 68 | * |
69 | - * @return array |
|
69 | + * @return string[] |
|
70 | 70 | */ |
71 | 71 | public function register() |
72 | 72 | { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | /** |
87 | 87 | * Processes this test, when one of its tokens is encountered. |
88 | 88 | * |
89 | - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
|
89 | + * @param File $phpcsFile The file being scanned. |
|
90 | 90 | * @param int $stackPtr The position of the current token in |
91 | 91 | * the stack passed in $tokens. |
92 | 92 | * |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | /** |
129 | 129 | * Generates the error or warning for this sniff. |
130 | 130 | * |
131 | - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
|
131 | + * @param File $phpcsFile The file being scanned. |
|
132 | 132 | * @param int $stackPtr The position of the forbidden style |
133 | 133 | * in the token array. |
134 | 134 | * @param string $style The name of the forbidden style. |
@@ -44,15 +44,15 @@ |
||
44 | 44 | * @var array(string => string|null) |
45 | 45 | */ |
46 | 46 | protected $forbiddenStyles = array( |
47 | - '-moz-border-radius' => 'border-radius', |
|
48 | - '-webkit-border-radius' => 'border-radius', |
|
49 | - '-moz-border-radius-topleft' => 'border-top-left-radius', |
|
50 | - '-moz-border-radius-topright' => 'border-top-right-radius', |
|
51 | - '-moz-border-radius-bottomright' => 'border-bottom-right-radius', |
|
52 | - '-moz-border-radius-bottomleft' => 'border-bottom-left-radius', |
|
53 | - '-moz-box-shadow' => 'box-shadow', |
|
54 | - '-webkit-box-shadow' => 'box-shadow', |
|
55 | - ); |
|
47 | + '-moz-border-radius' => 'border-radius', |
|
48 | + '-webkit-border-radius' => 'border-radius', |
|
49 | + '-moz-border-radius-topleft' => 'border-top-left-radius', |
|
50 | + '-moz-border-radius-topright' => 'border-top-right-radius', |
|
51 | + '-moz-border-radius-bottomright' => 'border-bottom-right-radius', |
|
52 | + '-moz-border-radius-bottomleft' => 'border-bottom-left-radius', |
|
53 | + '-moz-box-shadow' => 'box-shadow', |
|
54 | + '-webkit-box-shadow' => 'box-shadow', |
|
55 | + ); |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * A cache of forbidden style names, for faster lookups. |
@@ -149,7 +149,7 @@ |
||
149 | 149 | * |
150 | 150 | * @return void |
151 | 151 | */ |
152 | - protected function addError($phpcsFile, $stackPtr, $style, $pattern=null) |
|
152 | + protected function addError($phpcsFile, $stackPtr, $style, $pattern = null) |
|
153 | 153 | { |
154 | 154 | $data = array($style); |
155 | 155 | $error = 'The use of style %s is '; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | /** |
42 | 42 | * Returns the token types that this sniff is interested in. |
43 | 43 | * |
44 | - * @return int[] |
|
44 | + * @return string[] |
|
45 | 45 | */ |
46 | 46 | public function register() |
47 | 47 | { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | /** |
54 | 54 | * Processes the tokens that this sniff is interested in. |
55 | 55 | * |
56 | - * @param PHP_CodeSniffer_File $phpcsFile The file where the token was found. |
|
56 | + * @param File $phpcsFile The file where the token was found. |
|
57 | 57 | * @param int $stackPtr The position in the stack where |
58 | 58 | * the token was found. |
59 | 59 | * |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | * @var array |
45 | 45 | */ |
46 | 46 | public $excludeStyles = array( |
47 | - 'background-position' => 'background-position', |
|
48 | - 'box-shadow' => 'box-shadow', |
|
49 | - 'transform-origin' => 'transform-origin', |
|
50 | - '-webkit-transform-origin' => '-webkit-transform-origin', |
|
51 | - '-ms-transform-origin' => '-ms-transform-origin', |
|
47 | + 'background-position' => 'background-position', |
|
48 | + 'box-shadow' => 'box-shadow', |
|
49 | + 'transform-origin' => 'transform-origin', |
|
50 | + '-webkit-transform-origin' => '-webkit-transform-origin', |
|
51 | + '-ms-transform-origin' => '-ms-transform-origin', |
|
52 | 52 | ); |
53 | 53 | |
54 | 54 | |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | |
166 | 166 | $error = 'Size definitions must use shorthand if available; expected "%s" but found "%s"'; |
167 | 167 | $data = array( |
168 | - $expected, |
|
169 | - $content, |
|
170 | - ); |
|
168 | + $expected, |
|
169 | + $content, |
|
170 | + ); |
|
171 | 171 | |
172 | 172 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotUsed', $data); |
173 | 173 | if ($fix === true) { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * Returns the token types that this sniff is interested in. |
29 | 29 | * |
30 | - * @return int[] |
|
30 | + * @return integer[] |
|
31 | 31 | */ |
32 | 32 | public function register() |
33 | 33 | { |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * Processes the tokens that this sniff is interested in. |
41 | 41 | * |
42 | - * @param PHP_CodeSniffer_File $phpcsFile The file where the token was found. |
|
42 | + * @param File $phpcsFile The file where the token was found. |
|
43 | 43 | * @param int $stackPtr The position in the stack where |
44 | 44 | * the token was found. |
45 | 45 | * |
46 | - * @return void |
|
46 | + * @return null|integer |
|
47 | 47 | * @throws PHP_CodeSniffer_Exception If jslint.js could not be run |
48 | 48 | */ |
49 | 49 | public function process(File $phpcsFile, $stackPtr) |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | /** |
43 | 43 | * Processes this test, when one of its tokens is encountered. |
44 | 44 | * |
45 | - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
|
45 | + * @param File $phpcsFile The file being scanned. |
|
46 | 46 | * @param int $stackPtr The position of the current token in the |
47 | 47 | * stack passed in $tokens. |
48 | 48 | * |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | /** |
238 | 238 | * Add and fix the missing brackets error. |
239 | 239 | * |
240 | - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
|
240 | + * @param File $phpcsFile The file being scanned. |
|
241 | 241 | * @param int $stackPtr The position of the current token in the |
242 | 242 | * stack passed in $tokens. |
243 | 243 | * |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | * @var array |
37 | 37 | */ |
38 | 38 | public $supportedTokenizers = array( |
39 | - 'PHP', |
|
40 | - 'JS', |
|
41 | - ); |
|
39 | + 'PHP', |
|
40 | + 'JS', |
|
41 | + ); |
|
42 | 42 | |
43 | 43 | |
44 | 44 | /** |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | T_OPEN_SQUARE_BRACKET, |
139 | 139 | T_CLOSE_SQUARE_BRACKET, |
140 | 140 | T_MODULUS, |
141 | - ); |
|
141 | + ); |
|
142 | 142 | |
143 | 143 | for ($prev = ($stackPtr - 1); $prev > $bracket; $prev--) { |
144 | 144 | if (in_array($tokens[$prev]['code'], $allowed) === true) { |
@@ -202,13 +202,13 @@ discard block |
||
202 | 202 | // A list of tokens that indicate that the token is not |
203 | 203 | // part of an arithmetic operation. |
204 | 204 | $invalidTokens = array( |
205 | - T_COMMA, |
|
206 | - T_COLON, |
|
207 | - T_OPEN_PARENTHESIS, |
|
208 | - T_OPEN_SQUARE_BRACKET, |
|
209 | - T_OPEN_SHORT_ARRAY, |
|
210 | - T_CASE, |
|
211 | - ); |
|
205 | + T_COMMA, |
|
206 | + T_COLON, |
|
207 | + T_OPEN_PARENTHESIS, |
|
208 | + T_OPEN_SQUARE_BRACKET, |
|
209 | + T_OPEN_SHORT_ARRAY, |
|
210 | + T_CASE, |
|
211 | + ); |
|
212 | 212 | |
213 | 213 | if (in_array($tokens[$previousToken]['code'], $invalidTokens) === false) { |
214 | 214 | $this->addMissingBracketsError($phpcsFile, $stackPtr); |
@@ -225,8 +225,8 @@ discard block |
||
225 | 225 | // check is that we are not also enclosed in square brackets |
226 | 226 | // like this: ($array[$index + 1]), which is invalid. |
227 | 227 | $brackets = array( |
228 | - T_OPEN_SQUARE_BRACKET, |
|
229 | - T_CLOSE_SQUARE_BRACKET, |
|
228 | + T_OPEN_SQUARE_BRACKET, |
|
229 | + T_CLOSE_SQUARE_BRACKET, |
|
230 | 230 | ); |
231 | 231 | |
232 | 232 | $squareBracket = $phpcsFile->findPrevious($brackets, ($stackPtr - 1), $lastBracket); |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | T_MODULUS => true, |
282 | 282 | T_ISSET => true, |
283 | 283 | T_ARRAY => true, |
284 | - ); |
|
284 | + ); |
|
285 | 285 | |
286 | 286 | // Find the first token in the expression. |
287 | 287 | for ($before = ($stackPtr - 1); $before > 0; $before--) { |