File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
tests/PHPStan/Rules/PhpDoc Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,11 @@ public function testBug10130(): void
7979 ]);
8080 }
8181
82+ public function testBug14429 (): void
83+ {
84+ $ this ->analyse ([__DIR__ . '/data/bug-14429-var-tag.php ' ], []);
85+ }
86+
8287 public function testBug12708 (): void
8388 {
8489 $ this ->analyse ([__DIR__ . '/data/bug-12708.php ' ], [
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types = 1 );
4+
5+ namespace Bug14429VarTag ;
6+
7+ /** @template E of IEntity */
8+ class ICollection {}
9+
10+ class IEntity {
11+ /** @return ICollection<IEntity> */
12+ public function getCollection (): ICollection { return new ICollection (); }
13+ }
14+
15+ /**
16+ * @template E of IEntity
17+ */
18+ class OneHasOne
19+ {
20+ /**
21+ * @return ICollection<E>
22+ */
23+ protected function createCollection (IEntity $ e ): ICollection
24+ {
25+ /** @var ICollection<E> $collection */
26+ $ collection = $ e ->getCollection ();
27+ return $ collection ;
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments