Tag reference
@assert-if-false
The @assert-if-false tag asserts the given type for a subject, but only when the function returns false.
Grammar
"@phan-assert-if-false" [ ( "!=" | "!" | "=" ) ] <Type> <AssertSubject> [ <Description> ]"@phpstan-assert-if-false" [ ( "!=" | "!" | "=" ) ] <Type> <AssertSubject> [ <Description> ]"@psalm-assert-if-false" [ ( "!=" | "!" | "=" ) ] <Type> <AssertSubject> [ <Description> ]Examples
/** * @phan-assert-if-false string $value */function isNotString(mixed $value): bool/** * @phpstan-assert-if-false null $value */function isPresent(?object $value): bool/** * @psalm-assert-if-false non-empty-list $items */function isEmpty(array $items): boolNames by platform
- phan
@phan-assert-if-false- phpstan
@phpstan-assert-if-false- psalm
@psalm-assert-if-false