aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-05-14 12:57:23 +0200
committerMarc Alexander <admin@m-a-styles.de>2015-05-14 12:57:23 +0200
commit2d9bb285f91765e5e5ad097aa89c187a62f705d2 (patch)
tree2a28d56c0eb3cfbbd365264d517567a2a51ffb5e /build
parent799d88701564f6ddeaf181c2e72a0626f683c73c (diff)
parent4527789e5054db42d7117caebebe45a591246ec5 (diff)
downloadforums-2d9bb285f91765e5e5ad097aa89c187a62f705d2.tar
forums-2d9bb285f91765e5e5ad097aa89c187a62f705d2.tar.gz
forums-2d9bb285f91765e5e5ad097aa89c187a62f705d2.tar.bz2
forums-2d9bb285f91765e5e5ad097aa89c187a62f705d2.tar.xz
forums-2d9bb285f91765e5e5ad097aa89c187a62f705d2.zip
Merge branch '3.1.x'
Diffstat (limited to 'build')
-rw-r--r--build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
index 18cb8ba82e..9f68ee1341 100644
--- a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
+++ b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
@@ -195,6 +195,20 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
}
}
+ // Checks in catch blocks
+ $old_catch = $stackPtr;
+ while (($catch = $phpcsFile->findNext(T_CATCH, ($old_catch + 1))) !== false)
+ {
+ $old_catch = $catch;
+
+ $caught_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), $catch + 1);
+ $caught_class_name_end = $phpcsFile->findNext($find, $caught_class_name_start, null, true);
+
+ $caught_class_name = trim($phpcsFile->getTokensAsString($caught_class_name_start, ($caught_class_name_end - $caught_class_name_start)));
+
+ $ok = $this->check($phpcsFile, $caught_class_name, $class_name_full, $class_name_short, $catch) ? true : $ok;
+ }
+
if (!$ok)
{
$error = 'There must not be unused USE statements.';