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 52e33e2 commit 51c19e7Copy full SHA for 51c19e7
tests/PHPStan/Rules/Methods/ReturnTypeRuleTest.php
@@ -1259,4 +1259,9 @@ public function testBug12928(): void
1259
]);
1260
}
1261
1262
+ public function testBug7225(): void
1263
+ {
1264
+ $this->analyse([__DIR__ . '/data/bug-7225.php'], []);
1265
+ }
1266
+
1267
tests/PHPStan/Rules/Methods/data/bug-7225.php
@@ -0,0 +1,18 @@
1
+<?php
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
+}
0 commit comments