mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-12 04:36:32 +02:00
Merge pull request #2725 from Nicofuma/ticket/12842
[ticket/12842] Out of memory issue in code sniffer call for extensions * Nicofuma/ticket/12842: [ticket/12842] Skip parameters without exlicit type
This commit is contained in:
@ -153,6 +153,10 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
|
||||
|
||||
$start_argument = $phpcsFile->findPrevious(array(T_OPEN_PARENTHESIS, T_COMMA), $argument);
|
||||
$argument_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), ($start_argument + 1), $argument);
|
||||
|
||||
// Skip the parameter if no type is defined.
|
||||
if ($argument_class_name_start !== false)
|
||||
{
|
||||
$argument_class_name_end = $phpcsFile->findNext($find, ($argument_class_name_start + 1), null, true);
|
||||
|
||||
$argument_class_name = $phpcsFile->getTokensAsString($argument_class_name_start, ($argument_class_name_end - $argument_class_name_start - 1));
|
||||
@ -169,6 +173,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$ok)
|
||||
{
|
||||
|
Reference in New Issue
Block a user