Skip to content

Commit 3d0c08b

Browse files
Add non regression test
1 parent cafdfba commit 3d0c08b

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/PHPStan/Rules/Properties/AccessStaticPropertiesRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,4 +312,9 @@ public function testBug8333(): void
312312
]);
313313
}
314314

315+
public function testBug12775(): void
316+
{
317+
$this->analyse([__DIR__ . '/data/bug-12775.php'], []);
318+
}
319+
315320
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace Bug12775;
4+
5+
/**
6+
* @property string $comment
7+
*/
8+
class Foo {
9+
public static string $comment = 'foo';
10+
11+
public function __get(string $name): mixed {
12+
return 'bar';
13+
}
14+
}
15+
16+
$foo = new Foo;
17+
var_dump(Foo::$comment);

0 commit comments

Comments
 (0)