@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | T_WHILE, |
50 | 50 | T_TRY, |
51 | 51 | T_CATCH, |
52 | - ); |
|
52 | + ); |
|
53 | 53 | |
54 | 54 | }//end register() |
55 | 55 | |
@@ -71,10 +71,10 @@ discard block |
||
71 | 71 | if ($content !== strtolower($content)) { |
72 | 72 | $error = '%s keyword must be lowercase; expected "%s" but found "%s"'; |
73 | 73 | $data = array( |
74 | - strtoupper($content), |
|
75 | - strtolower($content), |
|
76 | - $content, |
|
77 | - ); |
|
74 | + strtoupper($content), |
|
75 | + strtolower($content), |
|
76 | + $content, |
|
77 | + ); |
|
78 | 78 | |
79 | 79 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'FoundUppercase', $data); |
80 | 80 | if ($fix === true) { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | return array( |
42 | 42 | T_CONSTANT_ENCAPSED_STRING, |
43 | 43 | T_DOUBLE_QUOTED_STRING, |
44 | - ); |
|
44 | + ); |
|
45 | 45 | |
46 | 46 | }//end register() |
47 | 47 | |
@@ -102,24 +102,24 @@ discard block |
||
102 | 102 | }//end if |
103 | 103 | |
104 | 104 | $allowedChars = array( |
105 | - '\0', |
|
106 | - '\1', |
|
107 | - '\2', |
|
108 | - '\3', |
|
109 | - '\4', |
|
110 | - '\5', |
|
111 | - '\6', |
|
112 | - '\7', |
|
113 | - '\n', |
|
114 | - '\r', |
|
115 | - '\f', |
|
116 | - '\t', |
|
117 | - '\v', |
|
118 | - '\x', |
|
119 | - '\b', |
|
120 | - '\e', |
|
121 | - '\u', |
|
122 | - '\'', |
|
105 | + '\0', |
|
106 | + '\1', |
|
107 | + '\2', |
|
108 | + '\3', |
|
109 | + '\4', |
|
110 | + '\5', |
|
111 | + '\6', |
|
112 | + '\7', |
|
113 | + '\n', |
|
114 | + '\r', |
|
115 | + '\f', |
|
116 | + '\t', |
|
117 | + '\v', |
|
118 | + '\x', |
|
119 | + '\b', |
|
120 | + '\e', |
|
121 | + '\u', |
|
122 | + '\'', |
|
123 | 123 | ); |
124 | 124 | |
125 | 125 | foreach ($allowedChars as $testChar) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | return array( |
40 | 40 | T_ARRAY, |
41 | 41 | T_OPEN_SHORT_ARRAY, |
42 | - ); |
|
42 | + ); |
|
43 | 43 | |
44 | 44 | }//end register() |
45 | 45 | |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $data = array( |
200 | 200 | $content, |
201 | 201 | $spaceLength, |
202 | - ); |
|
202 | + ); |
|
203 | 203 | |
204 | 204 | $fix = $phpcsFile->addFixableError($error, $nextArrow, 'SpaceBeforeDoubleArrow', $data); |
205 | 205 | if ($fix === true) { |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $data = array( |
225 | 225 | $content, |
226 | 226 | $spaceLength, |
227 | - ); |
|
227 | + ); |
|
228 | 228 | |
229 | 229 | $fix = $phpcsFile->addFixableError($error, $nextArrow, 'SpaceAfterDoubleArrow', $data); |
230 | 230 | if ($fix === true) { |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | $data = array( |
272 | 272 | $content, |
273 | 273 | $spaceLength, |
274 | - ); |
|
274 | + ); |
|
275 | 275 | |
276 | 276 | $fix = $phpcsFile->addFixableError($error, $comma, 'SpaceAfterComma', $data); |
277 | 277 | if ($fix === true) { |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | $data = array( |
288 | 288 | $content, |
289 | 289 | $spaceLength, |
290 | - ); |
|
290 | + ); |
|
291 | 291 | |
292 | 292 | $fix = $phpcsFile->addFixableError($error, $comma, 'SpaceBeforeComma', $data); |
293 | 293 | if ($fix === true) { |
@@ -330,8 +330,8 @@ discard block |
||
330 | 330 | $found = ($tokens[$arrayEnd]['column'] - 1); |
331 | 331 | $error = 'Closing parenthesis not aligned correctly; expected %s space(s) but found %s'; |
332 | 332 | $data = array( |
333 | - $expected, |
|
334 | - $found, |
|
333 | + $expected, |
|
334 | + $found, |
|
335 | 335 | ); |
336 | 336 | |
337 | 337 | $fix = $phpcsFile->addFixableError($error, $arrayEnd, 'CloseBraceNotAligned', $data); |
@@ -467,9 +467,9 @@ discard block |
||
467 | 467 | |
468 | 468 | $error = 'Expected 0 spaces between "%s" and comma; %s found'; |
469 | 469 | $data = array( |
470 | - $content, |
|
471 | - $spaceLength, |
|
472 | - ); |
|
470 | + $content, |
|
471 | + $spaceLength, |
|
472 | + ); |
|
473 | 473 | |
474 | 474 | $fix = $phpcsFile->addFixableError($error, $nextToken, 'SpaceBeforeComma', $data); |
475 | 475 | if ($fix === true) { |
@@ -638,9 +638,9 @@ discard block |
||
638 | 638 | if ($found !== $expected) { |
639 | 639 | $error = 'Array value not aligned correctly; expected %s spaces but found %s'; |
640 | 640 | $data = array( |
641 | - $expected, |
|
642 | - $found, |
|
643 | - ); |
|
641 | + $expected, |
|
642 | + $found, |
|
643 | + ); |
|
644 | 644 | |
645 | 645 | $fix = $phpcsFile->addFixableError($error, $value['value'], 'ValueNotAligned', $data); |
646 | 646 | if ($fix === true) { |
@@ -737,8 +737,8 @@ discard block |
||
737 | 737 | $found = ($tokens[$index['index']]['column'] - 1); |
738 | 738 | $error = 'Array key not aligned correctly; expected %s spaces but found %s'; |
739 | 739 | $data = array( |
740 | - $expected, |
|
741 | - $found, |
|
740 | + $expected, |
|
741 | + $found, |
|
742 | 742 | ); |
743 | 743 | |
744 | 744 | $fix = $phpcsFile->addFixableError($error, $index['index'], 'KeyNotAligned', $data); |
@@ -758,8 +758,8 @@ discard block |
||
758 | 758 | $found = ($tokens[$index['arrow']]['column'] - (strlen($index['index_content']) + $tokens[$index['index']]['column'])); |
759 | 759 | $error = 'Array double arrow not aligned correctly; expected %s space(s) but found %s'; |
760 | 760 | $data = array( |
761 | - $expected, |
|
762 | - $found, |
|
761 | + $expected, |
|
762 | + $found, |
|
763 | 763 | ); |
764 | 764 | |
765 | 765 | $fix = $phpcsFile->addFixableError($error, $index['arrow'], 'DoubleArrowNotAligned', $data); |
@@ -783,9 +783,9 @@ discard block |
||
783 | 783 | |
784 | 784 | $error = 'Array value not aligned correctly; expected %s space(s) but found %s'; |
785 | 785 | $data = array( |
786 | - $expected, |
|
787 | - $found, |
|
788 | - ); |
|
786 | + $expected, |
|
787 | + $found, |
|
788 | + ); |
|
789 | 789 | |
790 | 790 | $fix = $phpcsFile->addFixableError($error, $index['arrow'], 'ValueNotAligned', $data); |
791 | 791 | if ($fix === true) { |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | $data = array( |
874 | 874 | $content, |
875 | 875 | $spaceLength, |
876 | - ); |
|
876 | + ); |
|
877 | 877 | |
878 | 878 | $fix = $phpcsFile->addFixableError($error, $nextComma, 'SpaceBeforeComma', $data); |
879 | 879 | if ($fix === true) { |
@@ -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--) { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | private $_ignore = array( |
43 | 43 | T_WHITESPACE, |
44 | 44 | T_COMMENT, |
45 | - ); |
|
45 | + ); |
|
46 | 46 | |
47 | 47 | |
48 | 48 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | 'http_response_header', |
73 | 73 | 'HTTP_RAW_POST_DATA', |
74 | 74 | 'php_errormsg', |
75 | - ); |
|
75 | + ); |
|
76 | 76 | |
77 | 77 | // If it's a php reserved var, then its ok. |
78 | 78 | if (in_array($varName, $phpReservedVars) === true) { |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | if (substr($varName, 0, 1) === '_') { |
164 | 164 | $error = '%s member variable "%s" must not contain a leading underscore'; |
165 | 165 | $data = array( |
166 | - ucfirst($memberProps['scope']), |
|
167 | - $errorData[0], |
|
168 | - ); |
|
166 | + ucfirst($memberProps['scope']), |
|
167 | + $errorData[0], |
|
168 | + ); |
|
169 | 169 | $phpcsFile->addError($error, $stackPtr, 'PublicHasUnderscore', $data); |
170 | 170 | return; |
171 | 171 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | 'http_response_header', |
212 | 212 | 'HTTP_RAW_POST_DATA', |
213 | 213 | 'php_errormsg', |
214 | - ); |
|
214 | + ); |
|
215 | 215 | |
216 | 216 | if (preg_match_all('|[^\\\]\${?([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)|', $tokens[$stackPtr]['content'], $matches) !== 0) { |
217 | 217 | foreach ($matches[1] as $varName) { |
@@ -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 '; |
@@ -70,10 +70,10 @@ |
||
70 | 70 | // Find the first blank line before this opening brace, unless we get |
71 | 71 | // to another style definition, comment or the start of the file. |
72 | 72 | $endTokens = array( |
73 | - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, |
|
74 | - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, |
|
75 | - T_OPEN_TAG => T_OPEN_TAG, |
|
76 | - ); |
|
73 | + T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, |
|
74 | + T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, |
|
75 | + T_OPEN_TAG => T_OPEN_TAG, |
|
76 | + ); |
|
77 | 77 | $endTokens += PHP_CodeSniffer_Tokens::$commentTokens; |
78 | 78 | |
79 | 79 | $prev = $phpcsFile->findPrevious(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr - 1), null, true); |
@@ -69,7 +69,7 @@ |
||
69 | 69 | |
70 | 70 | // Find the first blank line before this opening brace, unless we get |
71 | 71 | // to another style definition, comment or the start of the file. |
72 | - $endTokens = array( |
|
72 | + $endTokens = array( |
|
73 | 73 | T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, |
74 | 74 | T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, |
75 | 75 | T_OPEN_TAG => T_OPEN_TAG, |
@@ -44,24 +44,24 @@ |
||
44 | 44 | * @var array |
45 | 45 | */ |
46 | 46 | public $colourNames = array( |
47 | - 'aqua' => 'aqua', |
|
48 | - 'black' => 'black', |
|
49 | - 'blue' => 'blue', |
|
50 | - 'fuchsia' => 'fuchsia', |
|
51 | - 'gray' => 'gray', |
|
52 | - 'green' => 'green', |
|
53 | - 'lime' => 'lime', |
|
54 | - 'maroon' => 'maroon', |
|
55 | - 'navy' => 'navy', |
|
56 | - 'olive' => 'olive', |
|
57 | - 'orange' => 'orange', |
|
58 | - 'purple' => 'purple', |
|
59 | - 'red' => 'red', |
|
60 | - 'silver' => 'silver', |
|
61 | - 'teal' => 'teal', |
|
62 | - 'white' => 'white', |
|
63 | - 'yellow' => 'yellow', |
|
64 | - ); |
|
47 | + 'aqua' => 'aqua', |
|
48 | + 'black' => 'black', |
|
49 | + 'blue' => 'blue', |
|
50 | + 'fuchsia' => 'fuchsia', |
|
51 | + 'gray' => 'gray', |
|
52 | + 'green' => 'green', |
|
53 | + 'lime' => 'lime', |
|
54 | + 'maroon' => 'maroon', |
|
55 | + 'navy' => 'navy', |
|
56 | + 'olive' => 'olive', |
|
57 | + 'orange' => 'orange', |
|
58 | + 'purple' => 'purple', |
|
59 | + 'red' => 'red', |
|
60 | + 'silver' => 'silver', |
|
61 | + 'teal' => 'teal', |
|
62 | + 'white' => 'white', |
|
63 | + 'yellow' => 'yellow', |
|
64 | + ); |
|
65 | 65 | |
66 | 66 | |
67 | 67 | /** |
@@ -132,9 +132,9 @@ |
||
132 | 132 | } else if ($foundIndent !== $expectedIndent) { |
133 | 133 | $error = 'Line indented incorrectly; expected %s spaces, found %s'; |
134 | 134 | $data = array( |
135 | - $expectedIndent, |
|
136 | - $foundIndent, |
|
137 | - ); |
|
135 | + $expectedIndent, |
|
136 | + $foundIndent, |
|
137 | + ); |
|
138 | 138 | |
139 | 139 | $fix = $phpcsFile->addFixableError($error, $i, 'Incorrect', $data); |
140 | 140 | if ($fix === true) { |