| @@ 159-171 (lines=13) @@ | ||
| 156 | } |
|
| 157 | ||
| 158 | $content = $tokens[$asToken]['content']; |
|
| 159 | if ($content !== strtolower($content)) { |
|
| 160 | $expected = strtolower($content); |
|
| 161 | $error = 'AS keyword must be lowercase; expected "%s" but found "%s"'; |
|
| 162 | $data = array( |
|
| 163 | $expected, |
|
| 164 | $content, |
|
| 165 | ); |
|
| 166 | ||
| 167 | $fix = $phpcsFile->addFixableError($error, $asToken, 'AsNotLower', $data); |
|
| 168 | if ($fix === true) { |
|
| 169 | $phpcsFile->fixer->replaceToken($asToken, $expected); |
|
| 170 | } |
|
| 171 | } |
|
| 172 | ||
| 173 | $doubleArrow = $phpcsFile->findNext(T_DOUBLE_ARROW, $asToken, $closingBracket); |
|
| 174 | ||
| @@ 124-135 (lines=12) @@ | ||
| 121 | return; |
|
| 122 | } |
|
| 123 | ||
| 124 | if ($content !== strtolower($content)) { |
|
| 125 | $error = 'Calls to inbuilt PHP functions must be lowercase; expected "%s" but found "%s"'; |
|
| 126 | $data = array( |
|
| 127 | strtolower($content), |
|
| 128 | $content, |
|
| 129 | ); |
|
| 130 | ||
| 131 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'CallUppercase', $data); |
|
| 132 | if ($fix === true) { |
|
| 133 | $phpcsFile->fixer->replaceToken($stackPtr, strtolower($content)); |
|
| 134 | } |
|
| 135 | } |
|
| 136 | ||
| 137 | }//end process() |
|
| 138 | ||