@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | * @var array |
37 | 37 | */ |
38 | 38 | public $supportedTokenizers = array( |
39 | - 'PHP', |
|
40 | - 'JS', |
|
41 | - 'CSS', |
|
42 | - ); |
|
39 | + 'PHP', |
|
40 | + 'JS', |
|
41 | + 'CSS', |
|
42 | + ); |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * The valid EOL character. |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | $expected = str_replace("\n", '\n', $expected); |
101 | 101 | $expected = str_replace("\r", '\r', $expected); |
102 | 102 | $data = array( |
103 | - $expected, |
|
104 | - $found, |
|
103 | + $expected, |
|
104 | + $found, |
|
105 | 105 | ); |
106 | 106 | |
107 | 107 | // Errors are always reported on line 1, no matter where the first PHP tag is. |
@@ -110,18 +110,18 @@ |
||
110 | 110 | if ($fix === true) { |
111 | 111 | $tokens = $phpcsFile->getTokens(); |
112 | 112 | switch ($this->eolChar) { |
113 | - case '\n': |
|
114 | - $eolChar = "\n"; |
|
115 | - break; |
|
116 | - case '\r': |
|
117 | - $eolChar = "\r"; |
|
118 | - break; |
|
119 | - case '\r\n': |
|
120 | - $eolChar = "\r\n"; |
|
121 | - break; |
|
122 | - default: |
|
123 | - $eolChar = $this->eolChar; |
|
124 | - break; |
|
113 | + case '\n': |
|
114 | + $eolChar = "\n"; |
|
115 | + break; |
|
116 | + case '\r': |
|
117 | + $eolChar = "\r"; |
|
118 | + break; |
|
119 | + case '\r\n': |
|
120 | + $eolChar = "\r\n"; |
|
121 | + break; |
|
122 | + default: |
|
123 | + $eolChar = $this->eolChar; |
|
124 | + break; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | for ($i = 0; $i < $phpcsFile->numTokens; $i++) { |
@@ -38,10 +38,10 @@ |
||
38 | 38 | * @var array |
39 | 39 | */ |
40 | 40 | public $bomDefinitions = array( |
41 | - 'UTF-8' => 'efbbbf', |
|
42 | - 'UTF-16 (BE)' => 'feff', |
|
43 | - 'UTF-16 (LE)' => 'fffe', |
|
44 | - ); |
|
41 | + 'UTF-8' => 'efbbbf', |
|
42 | + 'UTF-16 (BE)' => 'feff', |
|
43 | + 'UTF-16 (LE)' => 'fffe', |
|
44 | + ); |
|
45 | 45 | |
46 | 46 | |
47 | 47 | /** |
@@ -34,10 +34,10 @@ |
||
34 | 34 | * @var array |
35 | 35 | */ |
36 | 36 | public $supportedTokenizers = array( |
37 | - 'PHP', |
|
38 | - 'JS', |
|
39 | - 'CSS', |
|
40 | - ); |
|
37 | + 'PHP', |
|
38 | + 'JS', |
|
39 | + 'CSS', |
|
40 | + ); |
|
41 | 41 | |
42 | 42 | |
43 | 43 | /** |
@@ -131,16 +131,16 @@ |
||
131 | 131 | && $lineLength > $this->absoluteLineLimit |
132 | 132 | ) { |
133 | 133 | $data = array( |
134 | - $this->absoluteLineLimit, |
|
135 | - $lineLength, |
|
134 | + $this->absoluteLineLimit, |
|
135 | + $lineLength, |
|
136 | 136 | ); |
137 | 137 | |
138 | 138 | $error = 'Line exceeds maximum limit of %s characters; contains %s characters'; |
139 | 139 | $phpcsFile->addError($error, $stackPtr, 'MaxExceeded', $data); |
140 | 140 | } else if ($lineLength > $this->lineLimit) { |
141 | 141 | $data = array( |
142 | - $this->lineLimit, |
|
143 | - $lineLength, |
|
142 | + $this->lineLimit, |
|
143 | + $lineLength, |
|
144 | 144 | ); |
145 | 145 | |
146 | 146 | $warning = 'Line exceeds %s characters; contains %s characters'; |
@@ -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 | * If true, an error will be thrown; otherwise a warning. |
@@ -242,11 +242,11 @@ discard block |
||
242 | 242 | } |
243 | 243 | |
244 | 244 | $assignments[$assign] = array( |
245 | - 'var_end' => $varEnd, |
|
246 | - 'assign_len' => $assignLen, |
|
247 | - 'assign_col' => $assignColumn, |
|
248 | - 'expected' => $padding, |
|
249 | - 'found' => $found, |
|
245 | + 'var_end' => $varEnd, |
|
246 | + 'assign_len' => $assignLen, |
|
247 | + 'assign_col' => $assignColumn, |
|
248 | + 'expected' => $padding, |
|
249 | + 'found' => $found, |
|
250 | 250 | ); |
251 | 251 | |
252 | 252 | $lastLine = $tokens[$assign]['line']; |
@@ -288,9 +288,9 @@ discard block |
||
288 | 288 | } |
289 | 289 | |
290 | 290 | $errorData = array( |
291 | - $expectedText, |
|
292 | - $foundText, |
|
293 | - ); |
|
291 | + $expectedText, |
|
292 | + $foundText, |
|
293 | + ); |
|
294 | 294 | |
295 | 295 | if ($this->error === true) { |
296 | 296 | $fix = $phpcsFile->addFixableError($error, $assignment, $type, $errorData); |
@@ -41,22 +41,22 @@ discard block |
||
41 | 41 | * @var array |
42 | 42 | */ |
43 | 43 | protected $magicMethods = array( |
44 | - 'construct' => true, |
|
45 | - 'destruct' => true, |
|
46 | - 'call' => true, |
|
47 | - 'callstatic' => true, |
|
48 | - 'get' => true, |
|
49 | - 'set' => true, |
|
50 | - 'isset' => true, |
|
51 | - 'unset' => true, |
|
52 | - 'sleep' => true, |
|
53 | - 'wakeup' => true, |
|
54 | - 'tostring' => true, |
|
55 | - 'set_state' => true, |
|
56 | - 'clone' => true, |
|
57 | - 'invoke' => true, |
|
58 | - 'debuginfo' => true, |
|
59 | - ); |
|
44 | + 'construct' => true, |
|
45 | + 'destruct' => true, |
|
46 | + 'call' => true, |
|
47 | + 'callstatic' => true, |
|
48 | + 'get' => true, |
|
49 | + 'set' => true, |
|
50 | + 'isset' => true, |
|
51 | + 'unset' => true, |
|
52 | + 'sleep' => true, |
|
53 | + 'wakeup' => true, |
|
54 | + 'tostring' => true, |
|
55 | + 'set_state' => true, |
|
56 | + 'clone' => true, |
|
57 | + 'invoke' => true, |
|
58 | + 'debuginfo' => true, |
|
59 | + ); |
|
60 | 60 | |
61 | 61 | /** |
62 | 62 | * A list of all PHP non-magic methods starting with a double underscore. |
@@ -66,18 +66,18 @@ discard block |
||
66 | 66 | * @var array |
67 | 67 | */ |
68 | 68 | protected $methodsDoubleUnderscore = array( |
69 | - 'soapcall' => true, |
|
70 | - 'getlastrequest' => true, |
|
71 | - 'getlastresponse' => true, |
|
72 | - 'getlastrequestheaders' => true, |
|
73 | - 'getlastresponseheaders' => true, |
|
74 | - 'getfunctions' => true, |
|
75 | - 'gettypes' => true, |
|
76 | - 'dorequest' => true, |
|
77 | - 'setcookie' => true, |
|
78 | - 'setlocation' => true, |
|
79 | - 'setsoapheaders' => true, |
|
80 | - ); |
|
69 | + 'soapcall' => true, |
|
70 | + 'getlastrequest' => true, |
|
71 | + 'getlastresponse' => true, |
|
72 | + 'getlastrequestheaders' => true, |
|
73 | + 'getlastresponseheaders' => true, |
|
74 | + 'getfunctions' => true, |
|
75 | + 'gettypes' => true, |
|
76 | + 'dorequest' => true, |
|
77 | + 'setcookie' => true, |
|
78 | + 'setlocation' => true, |
|
79 | + 'setsoapheaders' => true, |
|
80 | + ); |
|
81 | 81 | |
82 | 82 | /** |
83 | 83 | * A list of all PHP magic functions. |
@@ -156,9 +156,9 @@ discard block |
||
156 | 156 | if ($methodProps['scope_specified'] === true) { |
157 | 157 | $error = '%s method name "%s" is not in camel caps format'; |
158 | 158 | $data = array( |
159 | - ucfirst($methodProps['scope']), |
|
160 | - $errorData[0], |
|
161 | - ); |
|
159 | + ucfirst($methodProps['scope']), |
|
160 | + $errorData[0], |
|
161 | + ); |
|
162 | 162 | $phpcsFile->addError($error, $stackPtr, 'ScopeNotCamelCaps', $data); |
163 | 163 | } else { |
164 | 164 | $error = 'Method name "%s" is not in camel caps format'; |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | if (preg_match('|^__|', $functionName) !== 0) { |
198 | 198 | $magicPart = strtolower(substr($functionName, 2)); |
199 | 199 | if (isset($this->magicFunctions[$magicPart]) === false) { |
200 | - $error = 'Function name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; |
|
201 | - $phpcsFile->addError($error, $stackPtr, 'FunctionDoubleUnderscore', $errorData); |
|
200 | + $error = 'Function name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; |
|
201 | + $phpcsFile->addError($error, $stackPtr, 'FunctionDoubleUnderscore', $errorData); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | return; |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) { |
90 | 90 | $functionKeyword = $phpcsFile->findPrevious( |
91 | 91 | array( |
92 | - T_WHITESPACE, |
|
93 | - T_COMMA, |
|
94 | - T_COMMENT, |
|
95 | - T_STRING, |
|
96 | - T_NS_SEPARATOR, |
|
92 | + T_WHITESPACE, |
|
93 | + T_COMMA, |
|
94 | + T_COMMENT, |
|
95 | + T_STRING, |
|
96 | + T_NS_SEPARATOR, |
|
97 | 97 | ), |
98 | 98 | ($stackPtr - 1), |
99 | 99 | null, |
@@ -114,9 +114,9 @@ discard block |
||
114 | 114 | |
115 | 115 | $error = 'Class constants must be uppercase; expected %s but found %s'; |
116 | 116 | $data = array( |
117 | - strtoupper($constName), |
|
118 | - $constName, |
|
119 | - ); |
|
117 | + strtoupper($constName), |
|
118 | + $constName, |
|
119 | + ); |
|
120 | 120 | $phpcsFile->addError($error, $stackPtr, 'ClassConstantNotUpperCase', $data); |
121 | 121 | } else { |
122 | 122 | $phpcsFile->recordMetric($stackPtr, 'Constant name case', 'upper'); |
@@ -166,9 +166,9 @@ discard block |
||
166 | 166 | |
167 | 167 | $error = 'Constants must be uppercase; expected %s but found %s'; |
168 | 168 | $data = array( |
169 | - $prefix.strtoupper($constName), |
|
170 | - $prefix.$constName, |
|
171 | - ); |
|
169 | + $prefix.strtoupper($constName), |
|
170 | + $prefix.$constName, |
|
171 | + ); |
|
172 | 172 | $phpcsFile->addError($error, $stackPtr, 'ConstantNotUpperCase', $data); |
173 | 173 | } else { |
174 | 174 | $phpcsFile->recordMetric($stackPtr, 'Constant name case', 'upper'); |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | * @var array |
37 | 37 | */ |
38 | 38 | public $supportedTokenizers = array( |
39 | - 'PHP', |
|
40 | - 'JS', |
|
41 | - 'CSS', |
|
42 | - ); |
|
39 | + 'PHP', |
|
40 | + 'JS', |
|
41 | + 'CSS', |
|
42 | + ); |
|
43 | 43 | |
44 | 44 | |
45 | 45 | /** |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | T_INLINE_HTML => true, |
75 | 75 | T_DOC_COMMENT_WHITESPACE => true, |
76 | 76 | T_DOC_COMMENT_STRING => true, |
77 | - ); |
|
77 | + ); |
|
78 | 78 | |
79 | 79 | for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) { |
80 | 80 | if (isset($checkTokens[$tokens[$i]['code']]) === false) { |
@@ -84,10 +84,10 @@ |
||
84 | 84 | $nextSeparator = $openBracket; |
85 | 85 | |
86 | 86 | $find = array( |
87 | - T_COMMA, |
|
88 | - T_VARIABLE, |
|
89 | - T_CLOSURE, |
|
90 | - T_OPEN_SHORT_ARRAY, |
|
87 | + T_COMMA, |
|
88 | + T_VARIABLE, |
|
89 | + T_CLOSURE, |
|
90 | + T_OPEN_SHORT_ARRAY, |
|
91 | 91 | ); |
92 | 92 | |
93 | 93 | while (($nextSeparator = $phpcsFile->findNext($find, ($nextSeparator + 1), $closeBracket)) !== false) { |