diff options
-rw-r--r-- | build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php index 0dea58dd49..87e676b8ff 100644 --- a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php +++ b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php @@ -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) |