diff --git a/tests/PHPStan/Rules/Methods/ReturnTypeRuleTest.php b/tests/PHPStan/Rules/Methods/ReturnTypeRuleTest.php index ca4cc32e49..ac15221d6b 100644 --- a/tests/PHPStan/Rules/Methods/ReturnTypeRuleTest.php +++ b/tests/PHPStan/Rules/Methods/ReturnTypeRuleTest.php @@ -1239,6 +1239,11 @@ public function testBug4443(): void ]); } + public function testBug13043(): void + { + $this->analyse([__DIR__ . '/data/bug-13043.php'], []); + } + public function testBug12928(): void { $this->analyse([__DIR__ . '/data/bug-12928.php'], [ diff --git a/tests/PHPStan/Rules/Methods/data/bug-13043.php b/tests/PHPStan/Rules/Methods/data/bug-13043.php new file mode 100644 index 0000000000..405cb75383 --- /dev/null +++ b/tests/PHPStan/Rules/Methods/data/bug-13043.php @@ -0,0 +1,24 @@ +prefix; + + $search = str_split('()<>@'); + $replace = array_map(rawurlencode(...), $search); + + $name .= str_replace($search, $replace, $this->name); + + return $name; + } +}