We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ea59a8 commit 1409717Copy full SHA for 1409717
tests/PHPStan/Rules/Functions/CallCallablesRuleTest.php
@@ -262,4 +262,9 @@ public function testStaticCallInFunctions(): void
262
$this->analyse([__DIR__ . '/data/static-call-in-functions.php'], []);
263
}
264
265
+ public function testBug5867(): void
266
+ {
267
+ $this->analyse([__DIR__ . '/data/bug-5867.php'], []);
268
+ }
269
+
270
tests/PHPStan/Rules/Functions/data/bug-5867.php
@@ -0,0 +1,16 @@
1
+<?php
2
3
+namespace Bug5867;
4
5
+class HelloWorld
6
+{
7
+ /**
8
+ * @param class-string $factory
9
+ */
10
+ public function sayHello(string $factory): void
11
12
+ if (class_exists($factory) && method_exists($factory, '__invoke')) {
13
+ (new $factory())();
14
15
16
+}
0 commit comments