mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/14377] Handle new $classname() in the sniffer
PHPBB3-14377
This commit is contained in:
parent
d44e34aa14
commit
d256d81a51
1 changed files with 5 additions and 0 deletions
|
@ -87,6 +87,11 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
|
||||||
$old_simple_statement = $simple_statement;
|
$old_simple_statement = $simple_statement;
|
||||||
|
|
||||||
$simple_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), ($simple_statement + 1));
|
$simple_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), ($simple_statement + 1));
|
||||||
|
|
||||||
|
if ($simple_class_name_start === false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$simple_class_name_end = $phpcsFile->findNext($find, ($simple_statement + 1), null, true);
|
$simple_class_name_end = $phpcsFile->findNext($find, ($simple_statement + 1), null, true);
|
||||||
|
|
||||||
$simple_class_name = trim($phpcsFile->getTokensAsString($simple_class_name_start, ($simple_class_name_end - $simple_class_name_start)));
|
$simple_class_name = trim($phpcsFile->getTokensAsString($simple_class_name_start, ($simple_class_name_end - $simple_class_name_start)));
|
||||||
|
|
Loading…
Add table
Reference in a new issue