File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
tests/PHPStan/Rules/Methods Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -1326,6 +1326,12 @@ public function testBug10924(): void
13261326 $ this ->analyse ([__DIR__ . '/data/bug-10924.php ' ], []);
13271327 }
13281328
1329+ public function testBug8985 (): void
1330+ {
1331+ $ this ->checkExplicitMixed = true ;
1332+ $ this ->analyse ([__DIR__ . '/data/bug-8985.php ' ], []);
1333+ }
1334+
13291335 public function testBug11430 (): void
13301336 {
13311337 $ this ->analyse ([__DIR__ . '/../../Analyser/nsrt/bug-11430.php ' ], []);
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Bug8985 ;
6+
7+ class HelloWorld
8+ {
9+ /**
10+ * @return array<string, callable>
11+ */
12+ protected function getDefaultFunctions (): array
13+ {
14+ /** @var array<string, callable> $x */
15+ $ x = (new Defaults ())->getFunctions ();
16+ return $ x ;
17+ }
18+ }
19+
20+ class HelloWorld2
21+ {
22+ /**
23+ * @return array<string, callable>
24+ */
25+ protected function getDefaultFunctions (): array
26+ {
27+ /** @var array<string, callable> */
28+ return (new Defaults ())->getFunctions ();
29+ }
30+ }
31+
32+ class Defaults
33+ {
34+ public function getFunctions (): mixed
35+ {
36+ return [];
37+ }
38+ }
You can’t perform that action at this time.
0 commit comments