mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/16671] Do not allow leading backslashes in use statements
PHPBB3-16671
This commit is contained in:
@@ -86,6 +86,11 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements Sniff
|
|||||||
$class_name_short = $tokens[$class_name_end - 1]['content'];
|
$class_name_short = $tokens[$class_name_end - 1]['content'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($class_name_full[0] === '\\')
|
||||||
|
{
|
||||||
|
$phpcsFile->addError("There must not be a leading '\\' in use statements.", $stackPtr, 'Malformed');
|
||||||
|
}
|
||||||
|
|
||||||
$ok = false;
|
$ok = false;
|
||||||
|
|
||||||
// Checks in simple statements (new, instanceof and extends)
|
// Checks in simple statements (new, instanceof and extends)
|
||||||
|
Reference in New Issue
Block a user