From 705515e104844611b97f04bc0b39d64bec40fadb Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 16 Jul 2026 18:33:48 +0700 Subject: [PATCH] [CodeQuality] Skip super global variables on AssertIssetToSpecificMethodRector --- .../Fixture/skip_superglobals.php.inc | 21 +++++++++++++++++++ .../AssertIssetToSpecificMethodRector.php | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 rules-tests/CodeQuality/Rector/MethodCall/AssertIssetToSpecificMethodRector/Fixture/skip_superglobals.php.inc diff --git a/rules-tests/CodeQuality/Rector/MethodCall/AssertIssetToSpecificMethodRector/Fixture/skip_superglobals.php.inc b/rules-tests/CodeQuality/Rector/MethodCall/AssertIssetToSpecificMethodRector/Fixture/skip_superglobals.php.inc new file mode 100644 index 00000000..085cc2c2 --- /dev/null +++ b/rules-tests/CodeQuality/Rector/MethodCall/AssertIssetToSpecificMethodRector/Fixture/skip_superglobals.php.inc @@ -0,0 +1,21 @@ +isNames($issetExpr->var, self::SUPER_GLOBAL_VARIABLE_NAMES)) { + return null; + } + // isset() on an ArrayAccess object is not equivalent to assertArrayHasKey(): // the key may be any type (assertArrayHasKey() requires int|string) and offsetExists() // semantics can differ from array_key_exists()