From 53deda2884c706c584481daa2572340f29b48c9e Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 17 Jul 2025 14:55:27 +0200 Subject: [PATCH 1/2] Added regression test --- ...InternalStaticMethodUsageExtensionTest.php | 6 ++++++ .../Rules/InternalTag/data/bug-13210.php | 20 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tests/PHPStan/Rules/InternalTag/data/bug-13210.php diff --git a/tests/PHPStan/Rules/InternalTag/RestrictedInternalStaticMethodUsageExtensionTest.php b/tests/PHPStan/Rules/InternalTag/RestrictedInternalStaticMethodUsageExtensionTest.php index 72f38a688c..64dd04f295 100644 --- a/tests/PHPStan/Rules/InternalTag/RestrictedInternalStaticMethodUsageExtensionTest.php +++ b/tests/PHPStan/Rules/InternalTag/RestrictedInternalStaticMethodUsageExtensionTest.php @@ -76,4 +76,10 @@ public function testNoNamespace(): void ]); } + public function testBug13210(): void + { + $this->analyse([__DIR__ . '/data/bug-13210.php'], [ + ]); + } + } diff --git a/tests/PHPStan/Rules/InternalTag/data/bug-13210.php b/tests/PHPStan/Rules/InternalTag/data/bug-13210.php new file mode 100644 index 0000000000..090fbf2beb --- /dev/null +++ b/tests/PHPStan/Rules/InternalTag/data/bug-13210.php @@ -0,0 +1,20 @@ + 'NULL', + is_string($phpValue) => "''", + is_int($phpValue) => (string)$phpValue, + $phpValue instanceof BackedEnum => self::phpValueToSql($phpValue->value), + }; + } + +} From 584ba3c03b0a76fb47ebd0e2715782f9ce86db11 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 17 Jul 2025 14:58:36 +0200 Subject: [PATCH 2/2] cs --- .../RestrictedInternalStaticMethodUsageExtensionTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/PHPStan/Rules/InternalTag/RestrictedInternalStaticMethodUsageExtensionTest.php b/tests/PHPStan/Rules/InternalTag/RestrictedInternalStaticMethodUsageExtensionTest.php index 64dd04f295..5fd7b6639a 100644 --- a/tests/PHPStan/Rules/InternalTag/RestrictedInternalStaticMethodUsageExtensionTest.php +++ b/tests/PHPStan/Rules/InternalTag/RestrictedInternalStaticMethodUsageExtensionTest.php @@ -78,8 +78,7 @@ public function testNoNamespace(): void public function testBug13210(): void { - $this->analyse([__DIR__ . '/data/bug-13210.php'], [ - ]); + $this->analyse([__DIR__ . '/data/bug-13210.php'], []); } }