Skip to content

Commit b08f99b

Browse files
phpstan-botclaude
andcommitted
Separate nullsafe modify assertion into its own function
The previous non-nullsafe call narrows the type of $d, which could affect the nullsafe assertion on the next line. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 055fb6b commit b08f99b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ function (\DateTimeImmutable $dt, string $s): void {
4646

4747
function (?\DateTimeImmutable $d): void {
4848
assertType('DateTimeImmutable', $d->modify('+1 day'));
49+
};
50+
51+
function (?\DateTimeImmutable $d): void {
4952
assertType('DateTimeImmutable|null', $d?->modify('+1 day'));
5053
};
5154

0 commit comments

Comments
 (0)