$stages = pipe(
static fn (string $x): int => 2,
);
Psl\invariant(is_int($stages('hello')), 'Expected output of int');
ERROR: RedundantCondition - ../tests/static-analysis/Fun/pipe.php:102:19 - int always contains int (see https://psalm.dev/122)
Psl\invariant(is_int($stages('hello')), 'Expected output of int');
It currently can only deal with FunctionLike arguments. When the arguments are expressions, this hook will fall back to Closure(mixed): mixed.
Supports: psl v2 Not supported: psl v1
This hook calculates the different stages of the
Fun\pipe()
combinator. It allows for a deep inspection of the different stages.Examples:
It currently can only deal with
FunctionLike
arguments. When the arguments are expressions, this hook will fall back toClosure(mixed): mixed
.