Skip to content

Commit c3a5945

Browse files
Add failing test
1 parent b08f99b commit c3a5945

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/PHPStan/Analyser/nsrt/date-format.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ function (?\DateTimeImmutable $d): void {
5353
};
5454

5555
class Foo extends \DateTimeImmutable {}
56-
class Bar extends \DateTimeImmutable {}
56+
class Bar {
57+
/** @return string */
58+
public function modify($string) {}
59+
}
5760

5861
function (Foo|Bar $d): void {
59-
assertType('DateFormatReturnType\Bar|DateFormatReturnType\Foo', $d->modify('+1 day'));
62+
assertType('DateFormatReturnType\Foo|string', $d->modify('+1 day'));
6063
};

0 commit comments

Comments
 (0)