mirror of
https://github.com/phpbb/phpbb.git
synced 2025-01-17 22:28:46 +01:00
[ticket/13402] Handle arrays and multiples types
PHPBB3-13402
This commit is contained in:
parent
13d4394844
commit
7f7f60698c
@ -160,7 +160,11 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
|
||||
// Check @param
|
||||
foreach ($comment_parser->getParams() as $param) {
|
||||
$type = $param->getType();
|
||||
$ok = $this->check($type, $class_name_full, $class_name_short, $param->getLine() + $comment_start) ? true : $ok;
|
||||
$types = explode('|', str_replace('[]', '', $type));
|
||||
foreach ($types as $type)
|
||||
{
|
||||
$ok = $this->check($type, $class_name_full, $class_name_short, $param->getLine() + $comment_start) ? true : $ok;
|
||||
}
|
||||
}
|
||||
|
||||
// Check @return
|
||||
@ -168,7 +172,11 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
|
||||
if ($return !== null)
|
||||
{
|
||||
$type = $return->getValue();
|
||||
$ok = $this->check($type, $class_name_full, $class_name_short, $return->getLine() + $comment_start) ? true : $ok;
|
||||
$types = explode('|', str_replace('[]', '', $type));
|
||||
foreach ($types as $type)
|
||||
{
|
||||
$ok = $this->check($type, $class_name_full, $class_name_short, $return->getLine() + $comment_start) ? true : $ok;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (PHP_CodeSniffer_CommentParser_ParserException $e)
|
||||
|
Loading…
x
Reference in New Issue
Block a user