@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | |
64 | 64 | $properties = array(); |
65 | 65 | $wantedTokens = array( |
66 | - T_PROPERTY, |
|
67 | - T_OBJECT, |
|
66 | + T_PROPERTY, |
|
67 | + T_OBJECT, |
|
68 | 68 | ); |
69 | 69 | |
70 | 70 | $next = $phpcsFile->findNext($wantedTokens, ($stackPtr + 1), $tokens[$stackPtr]['bracket_closer']); |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | if (isset($properties[$propName]) === true) { |
78 | 78 | $error = 'Duplicate property definition found for "%s"; previously defined on line %s'; |
79 | 79 | $data = array( |
80 | - $propName, |
|
81 | - $tokens[$properties[$propName]]['line'], |
|
82 | - ); |
|
80 | + $propName, |
|
81 | + $tokens[$properties[$propName]]['line'], |
|
82 | + ); |
|
83 | 83 | $phpcsFile->addError($error, $next, 'Found', $data); |
84 | 84 | } |
85 | 85 |
@@ -91,9 +91,9 @@ discard block |
||
91 | 91 | $type = strtolower($tokens[$stackPtr]['content']); |
92 | 92 | $error = 'Expected 0 spaces before %s keyword; %s found'; |
93 | 93 | $data = array( |
94 | - $type, |
|
95 | - $spaces, |
|
96 | - ); |
|
94 | + $type, |
|
95 | + $spaces, |
|
96 | + ); |
|
97 | 97 | |
98 | 98 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeKeyword', $data); |
99 | 99 | if ($fix === true) { |
@@ -188,9 +188,9 @@ discard block |
||
188 | 188 | if ($difference !== -1 && $difference !== 1) { |
189 | 189 | $error = 'Closing brace of a %s must be followed by a single blank line; found %s'; |
190 | 190 | $data = array( |
191 | - $tokens[$stackPtr]['content'], |
|
192 | - $difference, |
|
193 | - ); |
|
191 | + $tokens[$stackPtr]['content'], |
|
192 | + $difference, |
|
193 | + ); |
|
194 | 194 | $fix = $phpcsFile->addFixableError($error, $closeBrace, 'NewlinesAfterCloseBrace', $data); |
195 | 195 | if ($fix === true) { |
196 | 196 | if ($difference === 0) { |
@@ -191,7 +191,7 @@ |
||
191 | 191 | $tokens[$stackPtr]['content'], |
192 | 192 | $difference, |
193 | 193 | ); |
194 | - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'NewlinesAfterCloseBrace', $data); |
|
194 | + $fix = $phpcsFile->addFixableError($error, $closeBrace, 'NewlinesAfterCloseBrace', $data); |
|
195 | 195 | if ($fix === true) { |
196 | 196 | if ($difference === 0) { |
197 | 197 | $first = $phpcsFile->findFirstOnLine(array(), $nextContent, true); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | return array( |
43 | 43 | T_CLASS, |
44 | 44 | T_INTERFACE, |
45 | - ); |
|
45 | + ); |
|
46 | 46 | |
47 | 47 | }//end register() |
48 | 48 | |
@@ -71,10 +71,10 @@ discard block |
||
71 | 71 | if ($tokens[$decName]['content'] !== $fileName) { |
72 | 72 | $error = '%s name doesn\'t match filename; expected "%s %s"'; |
73 | 73 | $data = array( |
74 | - ucfirst($tokens[$stackPtr]['content']), |
|
75 | - $tokens[$stackPtr]['content'], |
|
76 | - $fileName, |
|
77 | - ); |
|
74 | + ucfirst($tokens[$stackPtr]['content']), |
|
75 | + $tokens[$stackPtr]['content'], |
|
76 | + $fileName, |
|
77 | + ); |
|
78 | 78 | $phpcsFile->addError($error, $stackPtr, 'NoMatch', $data); |
79 | 79 | } |
80 | 80 |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | * @var array |
51 | 51 | */ |
52 | 52 | public $supportedTokenizers = array( |
53 | - 'PHP', |
|
54 | - 'JS', |
|
55 | - ); |
|
53 | + 'PHP', |
|
54 | + 'JS', |
|
55 | + ); |
|
56 | 56 | |
57 | 57 | |
58 | 58 | /** |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | if ($spaceAfterOpen !== $this->requiredSpacesAfterOpen) { |
107 | 107 | $error = 'Expected %s spaces after opening bracket; %s found'; |
108 | 108 | $data = array( |
109 | - $this->requiredSpacesAfterOpen, |
|
110 | - $spaceAfterOpen, |
|
111 | - ); |
|
109 | + $this->requiredSpacesAfterOpen, |
|
110 | + $spaceAfterOpen, |
|
111 | + ); |
|
112 | 112 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterOpen', $data); |
113 | 113 | if ($fix === true) { |
114 | 114 | $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | if ($this->requiredSpacesBeforeClose !== $spaceBeforeClose) { |
137 | 137 | $error = 'Expected %s spaces before closing bracket; %s found'; |
138 | 138 | $data = array( |
139 | - $this->requiredSpacesBeforeClose, |
|
140 | - $spaceBeforeClose, |
|
141 | - ); |
|
139 | + $this->requiredSpacesBeforeClose, |
|
140 | + $spaceBeforeClose, |
|
141 | + ); |
|
142 | 142 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeClose', $data); |
143 | 143 | if ($fix === true) { |
144 | 144 | $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $this->requiredSpacesAfterOpen, |
110 | 110 | $spaceAfterOpen, |
111 | 111 | ); |
112 | - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterOpen', $data); |
|
112 | + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterOpen', $data); |
|
113 | 113 | if ($fix === true) { |
114 | 114 | $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); |
115 | 115 | if ($spaceAfterOpen === 0) { |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $this->requiredSpacesBeforeClose, |
140 | 140 | $spaceBeforeClose, |
141 | 141 | ); |
142 | - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeClose', $data); |
|
142 | + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeClose', $data); |
|
143 | 143 | if ($fix === true) { |
144 | 144 | $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); |
145 | 145 | if ($spaceBeforeClose === 0) { |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | if ($spaceAfterOpen !== $this->requiredSpacesAfterOpen) { |
104 | 104 | $error = 'Expected %s spaces after opening bracket; %s found'; |
105 | 105 | $data = array( |
106 | - $this->requiredSpacesAfterOpen, |
|
107 | - $spaceAfterOpen, |
|
108 | - ); |
|
106 | + $this->requiredSpacesAfterOpen, |
|
107 | + $spaceAfterOpen, |
|
108 | + ); |
|
109 | 109 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterOpen', $data); |
110 | 110 | if ($fix === true) { |
111 | 111 | $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); |
@@ -133,9 +133,9 @@ discard block |
||
133 | 133 | if ($spaceBeforeClose !== $this->requiredSpacesBeforeClose) { |
134 | 134 | $error = 'Expected %s spaces before closing bracket; %s found'; |
135 | 135 | $data = array( |
136 | - $this->requiredSpacesBeforeClose, |
|
137 | - $spaceBeforeClose, |
|
138 | - ); |
|
136 | + $this->requiredSpacesBeforeClose, |
|
137 | + $spaceBeforeClose, |
|
138 | + ); |
|
139 | 139 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeClose', $data); |
140 | 140 | if ($fix === true) { |
141 | 141 | $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); |
@@ -160,8 +160,8 @@ discard block |
||
160 | 160 | $expected = strtolower($content); |
161 | 161 | $error = 'AS keyword must be lowercase; expected "%s" but found "%s"'; |
162 | 162 | $data = array( |
163 | - $expected, |
|
164 | - $content, |
|
163 | + $expected, |
|
164 | + $content, |
|
165 | 165 | ); |
166 | 166 | |
167 | 167 | $fix = $phpcsFile->addFixableError($error, $asToken, 'AsNotLower', $data); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $this->requiredSpacesAfterOpen, |
107 | 107 | $spaceAfterOpen, |
108 | 108 | ); |
109 | - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterOpen', $data); |
|
109 | + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterOpen', $data); |
|
110 | 110 | if ($fix === true) { |
111 | 111 | $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); |
112 | 112 | if ($spaceAfterOpen === 0) { |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $this->requiredSpacesBeforeClose, |
137 | 137 | $spaceBeforeClose, |
138 | 138 | ); |
139 | - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeClose', $data); |
|
139 | + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeClose', $data); |
|
140 | 140 | if ($fix === true) { |
141 | 141 | $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); |
142 | 142 | if ($spaceBeforeClose === 0) { |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | * @var array |
33 | 33 | */ |
34 | 34 | public $supportedTokenizers = array( |
35 | - 'PHP', |
|
36 | - 'JS', |
|
37 | - ); |
|
35 | + 'PHP', |
|
36 | + 'JS', |
|
37 | + ); |
|
38 | 38 | |
39 | 39 | |
40 | 40 | /** |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | T_ELSE, |
56 | 56 | T_ELSEIF, |
57 | 57 | T_SWITCH, |
58 | - ); |
|
58 | + ); |
|
59 | 59 | |
60 | 60 | }//end register() |
61 | 61 | |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | if ($found !== 1) { |
93 | 93 | $error = 'Expected 1 space after %s keyword; %s found'; |
94 | 94 | $data = array( |
95 | - strtoupper($tokens[$stackPtr]['content']), |
|
96 | - $found, |
|
97 | - ); |
|
95 | + strtoupper($tokens[$stackPtr]['content']), |
|
96 | + $found, |
|
97 | + ); |
|
98 | 98 | |
99 | 99 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterKeyword', $data); |
100 | 100 | if ($fix === true) { |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | * @var array |
38 | 38 | */ |
39 | 39 | public $supportedTokenizers = array( |
40 | - 'PHP', |
|
41 | - 'JS', |
|
42 | - ); |
|
40 | + 'PHP', |
|
41 | + 'JS', |
|
42 | + ); |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * The number of spaces code should be indented. |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | $expected = strtolower($tokens[$nextCase]['content']); |
107 | 107 | $error = strtoupper($type).' keyword must be lowercase; expected "%s" but found "%s"'; |
108 | 108 | $data = array( |
109 | - $expected, |
|
110 | - $tokens[$nextCase]['content'], |
|
109 | + $expected, |
|
110 | + $tokens[$nextCase]['content'], |
|
111 | 111 | ); |
112 | 112 | |
113 | 113 | $fix = $phpcsFile->addFixableError($error, $nextCase, $type.'NotLower', $data); |
@@ -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) { |