File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
tests/PHPStan/Rules/Methods Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1259,4 +1259,10 @@ public function testBug12928(): void
12591259 ]);
12601260 }
12611261
1262+ #[RequiresPhp('>= 8.0 ' )]
1263+ public function testBug7225 (): void
1264+ {
1265+ $ this ->analyse ([__DIR__ . '/data/bug-7225.php ' ], []);
1266+ }
1267+
12621268}
Original file line number Diff line number Diff line change 1+ <?php // lint >= 8.0
2+
3+ namespace Bug7225 ;
4+
5+ use DateTimeImmutable ;
6+
7+ class CustomDateTimeImmutable extends DateTimeImmutable
8+ {
9+ public function test (): self
10+ {
11+ return CustomDateTimeImmutable::createFromInterface (new DateTime ());
12+ }
13+
14+ public function fromFormat (): CustomDateTimeImmutable |false
15+ {
16+ return CustomDateTimeImmutable::createFromFormat ('H:i:s ' , '00:00:00 ' );
17+ }
18+ }
You can’t perform that action at this time.
0 commit comments