diff --git a/WordPress/Helpers/ConstantsHelper.php b/WordPress/Helpers/ConstantsHelper.php index 6decbb4010..320c6312f8 100644 --- a/WordPress/Helpers/ConstantsHelper.php +++ b/WordPress/Helpers/ConstantsHelper.php @@ -79,6 +79,7 @@ public static function is_use_of_global_constant( File $phpcsFile, $stackPtr ) { \T_INSTANCEOF => true, \T_INSTEADOF => true, \T_GOTO => true, + \T_AS => true, ); $tokens_to_ignore += Tokens::$ooScopeTokens; $tokens_to_ignore += Collections::objectOperators(); diff --git a/WordPress/Tests/WP/DiscouragedConstantsUnitTest.inc b/WordPress/Tests/WP/DiscouragedConstantsUnitTest.inc index ea8ae72524..919fdd2fcb 100644 --- a/WordPress/Tests/WP/DiscouragedConstantsUnitTest.inc +++ b/WordPress/Tests/WP/DiscouragedConstantsUnitTest.inc @@ -61,7 +61,7 @@ echo BACKGROUND_COLOR; echo BACKGROUND_IMAGE; use const STYLESHEETPATH as SSP; -use const ABC as STYLESHEETPATH; +use const ABC as STYLESHEETPATH; // This is ok, as `STYLESHEETPATH` is not a global constant here. switch( STYLESHEETPATH ) { case STYLESHEETPATH: diff --git a/WordPress/Tests/WP/DiscouragedConstantsUnitTest.php b/WordPress/Tests/WP/DiscouragedConstantsUnitTest.php index e27fd838c2..57ea154594 100644 --- a/WordPress/Tests/WP/DiscouragedConstantsUnitTest.php +++ b/WordPress/Tests/WP/DiscouragedConstantsUnitTest.php @@ -49,7 +49,6 @@ public function getWarningList() { 60 => 1, 61 => 1, 63 => 1, - 64 => 1, 66 => 1, 67 => 1, 71 => 1,