mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/16671] Do not allow leading backslashes in use statements
PHPBB3-16671
This commit is contained in:
parent
8830354555
commit
3d8f7ee33b
1 changed files with 5 additions and 0 deletions
|
@ -86,6 +86,11 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements Sniff
|
|||
$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;
|
||||
|
||||
// Checks in simple statements (new, instanceof and extends)
|
||||
|
|
Loading…
Add table
Reference in a new issue