-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Description
Hi,
Until phpstan has its own assert
/type narrowing support:
- PHPDoc-based type narrowing phpstan/phpstan#7110
- PHPDoc-based type narrowing phpstan/phpstan-src#1317
it would be good to have support for
\Psl\Invariant
(https://github.com/azjezz/psl/blob/2.1.x/src/Psl/invariant.php#L12) in this extension.
example:
doesn't work:
\PHPStan\dumpType($result); //$result = Divsion|null
Psl\invariant(
null !== $result,
Str\format('Division with ID %s not found', $uuid->toRfc4122()),
);
\PHPStan\dumpType($result); //$result = Divsion|null
Thanks
simPodjeromegamez
Metadata
Metadata
Assignees
Labels
No labels