@@ -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) { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | return array( |
57 | 57 | T_FUNCTION, |
58 | 58 | T_CLOSURE, |
59 | - ); |
|
59 | + ); |
|
60 | 60 | |
61 | 61 | }//end register() |
62 | 62 | |
@@ -168,9 +168,9 @@ discard block |
||
168 | 168 | |
169 | 169 | $error = 'Opening brace indented incorrectly; expected %s spaces, found %s'; |
170 | 170 | $data = array( |
171 | - $expected, |
|
172 | - $found, |
|
173 | - ); |
|
171 | + $expected, |
|
172 | + $found, |
|
173 | + ); |
|
174 | 174 | |
175 | 175 | $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceIndent', $data); |
176 | 176 | if ($fix === true) { |
@@ -57,7 +57,7 @@ |
||
57 | 57 | 48 => 1, |
58 | 58 | 70 => 1, |
59 | 59 | 71 => 1, |
60 | - ); |
|
60 | + ); |
|
61 | 61 | |
62 | 62 | }//end getErrorList() |
63 | 63 |
@@ -62,7 +62,7 @@ |
||
62 | 62 | /** |
63 | 63 | * Processes this sniff, when one of its tokens is encountered. |
64 | 64 | * |
65 | - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
|
65 | + * @param File $phpcsFile The file being scanned. |
|
66 | 66 | * @param int $stackPtr The position of the current token in the |
67 | 67 | * stack passed in $tokens. |
68 | 68 | * |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | * @var array |
36 | 36 | */ |
37 | 37 | public $supportedTokenizers = array( |
38 | - 'PHP', |
|
39 | - 'JS', |
|
40 | - ); |
|
38 | + 'PHP', |
|
39 | + 'JS', |
|
40 | + ); |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * If true, an error will be thrown; otherwise a warning. |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | return array( |
68 | 68 | T_STRING_CONCAT, |
69 | 69 | T_PLUS, |
70 | - ); |
|
70 | + ); |
|
71 | 71 | |
72 | 72 | }//end register() |
73 | 73 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * Returns an array of tokens this test wants to listen for. |
28 | 28 | * |
29 | - * @return array |
|
29 | + * @return integer[] |
|
30 | 30 | */ |
31 | 31 | public function register() |
32 | 32 | { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | /** |
39 | 39 | * Processes this sniff when one of its tokens is encountered. |
40 | 40 | * |
41 | - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. |
|
41 | + * @param File $phpcsFile The file being scanned. |
|
42 | 42 | * @param int $stackPtr The position of the current token |
43 | 43 | * in the stack passed in $tokens. |
44 | 44 | * |
@@ -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,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 | /** |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | T_TRUE, |
53 | 53 | T_FALSE, |
54 | 54 | T_NULL, |
55 | - ); |
|
55 | + ); |
|
56 | 56 | |
57 | 57 | }//end register() |
58 | 58 | |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | |
81 | 81 | $error = 'TRUE, FALSE and NULL must be lowercase; expected "%s" but found "%s"'; |
82 | 82 | $data = array( |
83 | - $expected, |
|
84 | - $keyword, |
|
85 | - ); |
|
83 | + $expected, |
|
84 | + $keyword, |
|
85 | + ); |
|
86 | 86 | |
87 | 87 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found', $data); |
88 | 88 | if ($fix === true) { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | T_TRUE, |
43 | 43 | T_FALSE, |
44 | 44 | T_NULL, |
45 | - ); |
|
45 | + ); |
|
46 | 46 | |
47 | 47 | }//end register() |
48 | 48 | |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | |
71 | 71 | $error = 'TRUE, FALSE and NULL must be uppercase; expected "%s" but found "%s"'; |
72 | 72 | $data = array( |
73 | - $expected, |
|
74 | - $keyword, |
|
75 | - ); |
|
73 | + $expected, |
|
74 | + $keyword, |
|
75 | + ); |
|
76 | 76 | |
77 | 77 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found', $data); |
78 | 78 | if ($fix === true) { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | T_USE, |
104 | 104 | T_VAR, |
105 | 105 | T_WHILE, |
106 | - ); |
|
106 | + ); |
|
107 | 107 | |
108 | 108 | }//end register() |
109 | 109 | |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | |
131 | 131 | $error = 'PHP keywords must be lowercase; expected "%s" but found "%s"'; |
132 | 132 | $data = array( |
133 | - strtolower($keyword), |
|
134 | - $keyword, |
|
135 | - ); |
|
133 | + strtolower($keyword), |
|
134 | + $keyword, |
|
135 | + ); |
|
136 | 136 | |
137 | 137 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found', $data); |
138 | 138 | if ($fix === true) { |