diff --git a/modules/system/Phpcs/Sniffs/NoGlobalAliasesSniff.php b/modules/system/Phpcs/Sniffs/NoGlobalAliasesSniff.php index 213459cd3..72994e75c 100644 --- a/modules/system/Phpcs/Sniffs/NoGlobalAliasesSniff.php +++ b/modules/system/Phpcs/Sniffs/NoGlobalAliasesSniff.php @@ -64,12 +64,6 @@ public function process(File $phpcsFile, $stackPtr) // Normalize the use statement and remove "as" aliases $useStatement = trim(preg_replace('/\s+as\s+\w+$/i', '', $useStatement)); - // $phpcsFile->addError( - // $useStatement . var_export(isset($this->aliases[$useStatement]), true), - // $stackPtr, - // 'NoGlobalAliases' - // ); - // Check if the use statement matches a key in the aliases foreach ($this->aliases as $alias => $fullyQualifiedName) { if ($useStatement === $alias) { diff --git a/modules/system/Phpcs/Tests/Sniffs/NoGlobalAliasesSniffTest.php b/modules/system/Phpcs/Tests/Sniffs/NoGlobalAliasesSniffTest.php index 04f8a6d5a..7bd8384f3 100644 --- a/modules/system/Phpcs/Tests/Sniffs/NoGlobalAliasesSniffTest.php +++ b/modules/system/Phpcs/Tests/Sniffs/NoGlobalAliasesSniffTest.php @@ -7,11 +7,11 @@ class NoGlobalAliasesSniffTest extends AbstractSniffUnitTest { /** - * Returns the lines where errors should occur. + * Returns the lines where warnings should occur. * - * @return array Line numbers as keys, number of errors as values. + * @return array Line numbers as keys, number of warnings as values. */ - public function getErrorList(): array + public function getWarningList(): array { return [ 3 => 1, // Global alias Config @@ -25,11 +25,11 @@ public function getErrorList(): array } /** - * Returns the lines where warnings should occur. + * Returns the lines where errors should occur. * - * @return array Line numbers as keys, number of warnings as values. + * @return array Line numbers as keys, number of errors as values. */ - public function getWarningList(): array + public function getErrorList(): array { return []; }