PHP TypeLang Help

@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.

"@psalm-if-this-is" <Type>

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 {}

See Psalm's supported annotations.

08 July 2026