We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83a0511 commit b0807a5Copy full SHA for b0807a5
tests/PHPStan/Rules/Functions/data/bug-3616.php
@@ -29,3 +29,25 @@ public function withVariable(string $id): void
29
(self::FACTORIES[$id])();
30
}
31
32
+
33
+class HelloWorld2
34
+{
35
+ const FACTORIES = [
36
+ 'a' => [Factory::class, 'a'],
37
+ 'b' => [Factory::class, 'b']
38
+ ];
39
40
+ public function withLiteral(): void
41
+ {
42
+ (self::FACTORIES['a'])();
43
+ }
44
45
+ public function withVariable(string $id): void
46
47
+ if (!isset(self::FACTORIES[$id])) {
48
+ return;
49
50
51
+ (self::FACTORIES[$id])();
52
53
+}
0 commit comments