Tag reference
@psalm-if-this-is
The @psalm-if-this-is tag narrows the type of $this inside a
method when the given type matches. It is defined by the static
analyzer Psalm, alongside @psalm-assert.
Grammar
"@psalm-if-this-is" <Type> [ <Description> ]Examples
/** * @psalm-if-this-is Collection<int> */public function sum(): intNames by platform
- psalm
@psalm-if-this-is
Parsing a @psalm-if-this-is tag produces a PsalmIfThisIsTag instance, carrying the
parsed $type alongside the $name and optional $description every
Tag already provides.
final class PsalmIfThisIsTag extends TypedTag {}