Platforms
Phan tags
The Phan Tags are the annotations that belong to
Phan’s own vocabulary, written under its
@phan-* vendor prefix. Phan uses the prefix much as Psalm and PHPStan do:
to add analyzer-specific capabilities — line-scoped suppression, real vs.
documented return types, magic-member policing — and to offer a Phan-scoped
override of a tag that also exists in the shared convention.
A prefixed tag that mirrors one documented elsewhere — @phan-param beside
@param, @phan-return beside @return —
means the same thing as the plain spelling; the prefix only marks it as the
one Phan should trust.
What this group covers
Section titled “What this group covers”- Assertions — @phan-assert,
@phan-assert-true-condition,@phan-assert-false-condition, @phan-assert-if-true, @phan-assert-if-false. - Line-scoped suppression — @phan-suppress-current-line, @phan-suppress-next-line, @phan-suppress-next-next-line, @phan-suppress-previous-line, and the file-wide @phan-file-suppress.
- Return types — @phan-real-return, @phan-hardcode-return-type, distinguishing the type Phan should infer from the one it should report.
- Magic-member policy — @phan-forbid-undeclared-magic-methods, @phan-forbid-undeclared-magic-properties, @phan-read-only, @phan-write-only.
- Purity and immutability — @phan-pure, @phan-side-effect-free, @phan-immutable, @phan-constructor-used-for-side-effects.
- Types and scope — @phan-type,
@phan-closure-scope (also spelled
@phanClosureScope), @phan-transient, @phan-output-reference. - Prefixed overrides — @phan-var, @phan-param, @phan-return, @phan-property, @phan-method, @phan-template, @phan-mixin, @phan-extends, and the rest, each shadowing its unprefixed counterpart for Phan specifically.
For the authoritative definitions, see Phan’s annotating-your-source-code guide.