vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php 1 location
|
@@ 144-151 (lines=8) @@
|
| 141 |
|
// Tokenize strings that can contain variables. |
| 142 |
|
// Make sure the string is re-joined if it occurs over multiple lines. |
| 143 |
|
$content = $token['content']; |
| 144 |
|
for ($i = ($next + 1); $i <= $end; $i++) { |
| 145 |
|
if (isset($validTokens[$tokens[$i]['code']]) === true) { |
| 146 |
|
$content .= $tokens[$i]['content']; |
| 147 |
|
$next++; |
| 148 |
|
} else { |
| 149 |
|
break; |
| 150 |
|
} |
| 151 |
|
} |
| 152 |
|
|
| 153 |
|
$stringTokens = token_get_all(sprintf('<?php %s;?>', $content)); |
| 154 |
|
foreach ($stringTokens as $stringPtr => $stringToken) { |
vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php 1 location
|
@@ 191-200 (lines=10) @@
|
| 188 |
|
// we will need to throw errors from this token to the next |
| 189 |
|
// shared opener (if there is one), not to the scope closer. |
| 190 |
|
$nextOpener = null; |
| 191 |
|
for ($i = ($stackPtr + 1); $i < $closer; $i++) { |
| 192 |
|
if (isset($tokens[$i]['scope_closer']) === true) { |
| 193 |
|
if ($tokens[$i]['scope_closer'] === $closer) { |
| 194 |
|
// We found an opener that shares the same |
| 195 |
|
// closing token as us. |
| 196 |
|
$nextOpener = $i; |
| 197 |
|
break; |
| 198 |
|
} |
| 199 |
|
} |
| 200 |
|
}//end for |
| 201 |
|
|
| 202 |
|
if ($nextOpener === null) { |
| 203 |
|
$end = $closer; |