Tag reference
@assert
The @assert tag asserts that the given subject is narrowed to the type it carries once the call returns.
Grammar
"@phan-assert" [ ( "!=" | "!" | "=" ) ] <Type> <AssertSubject> [ <Description> ]"@phpstan-assert" [ ( "!=" | "!" | "=" ) ] <Type> <AssertSubject> [ <Description> ]"@psalm-assert" [ ( "!=" | "!" | "=" ) ] <Type> <AssertSubject> [ <Description> ]Examples
/** * @phan-assert string $value */function assertString(mixed $value): void/** * @phpstan-assert non-empty-string $value */function assertNonEmpty(string $value): void/** * @psalm-assert !null $value */function assertNotNull(mixed $value): voidNames by platform
- phan
@phan-assert- phpstan
@phpstan-assert- psalm
@psalm-assert