File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
tests/PHPStan/Rules/Methods Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1239,6 +1239,11 @@ public function testBug4443(): void
12391239 ]);
12401240 }
12411241
1242+ public function testBug13043 (): void
1243+ {
1244+ $ this ->analyse ([__DIR__ . '/data/bug-13043.php ' ], []);
1245+ }
1246+
12421247 public function testBug12928 (): void
12431248 {
12441249 $ this ->analyse ([__DIR__ . '/data/bug-12928.php ' ], [
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types = 1 );
2+
3+ namespace Bug13043 ;
4+
5+ class HelloWorld
6+ {
7+ private string $ prefix = '' ;
8+
9+ /** @var non-empty-string $name */
10+ private string $ name = 'identifier ' ;
11+
12+ /** @return non-empty-string */
13+ public function getPrefixedName (): string
14+ {
15+ $ name = $ this ->prefix ;
16+
17+ $ search = str_split ('()<>@ ' );
18+ $ replace = array_map (rawurlencode (...), $ search );
19+
20+ $ name .= str_replace ($ search , $ replace , $ this ->name );
21+
22+ return $ name ;
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments