final |
|---|
Collection of @phpstan-assert annotations on a function or method. PHPStan supports type assertions via PHPDoc annotations:
@phpstan-assert Type $param — narrows the parameter type unconditionally@phpstan-assert-if-true Type $param — narrows when the method returns true@phpstan-assert-if-false Type $param — narrows when the method returns false This class collects all such assertions and provides methods to retrieve them
by condition type. It also handles negation: an @phpstan-assert-if-true assertion
is automatically negated and included in the getAssertsIfFalse() result. Returned by ExtendedMethodReflection::getAsserts() and FunctionReflection::getAsserts().| Methods | ||
|---|---|---|
public
|
getAll(): AssertTag[]
|
# |
public
|
getAsserts(): AssertTag[]
|
# |
public
|
getAssertsIfTrue(): AssertTag[]
|
# |
public
|
getAssertsIfFalse(): AssertTag[]
|
# |
public
|
mapTypes(callable(Type): Type $callable): self
|
# |
public
|
intersectWith(Assertions $other): self
|
# |
public
static
|
createEmpty(): self
|
# |
public
static
|
createFromResolvedPhpDocBlock(ResolvedPhpDocBlock $phpDocBlock): self
|
# |