Skip to content

Tag reference

Tag reference

A tag is described once, under its canonical name. Platforms register it under their own names too (@psalm-param and @phpstan-param are read as @param), they are listed next to the tag and lead to its page.

127 tags, 215 names

TagNames by platform
@abstract

The @abstract tag declares an element as abstract.

phan
@phan-abstract
standard
@abstract
@access

The @access tag documents the visibility of an element.

phpdocumentor
@access
@allow-private-mutation

The @allow-private-mutation tag allows a private-scope mutation of an otherwise immutable property.

phpstan
@phpstan-allow-private-mutation
psalm
@psalm-allow-private-mutation
@api

The @api tag marks an element as part of the public, supported API of its package.

psalm
@psalm-api
standard
@api
@assert

The @assert tag asserts that the given subject is narrowed to the type it carries once the call returns.

phan
@phan-assert
phpstan
@phpstan-assert
psalm
@psalm-assert
@assert-if-false

The @assert-if-false tag asserts the given type for a subject, but only when the function returns false.

phan
@phan-assert-if-false
phpstan
@phpstan-assert-if-false
psalm
@psalm-assert-if-false
@assert-if-true

The @assert-if-true tag asserts the given type for a subject, but only when the function returns true.

phan
@phan-assert-if-true
phpstan
@phpstan-assert-if-true
psalm
@psalm-assert-if-true
@author

The @author tag documents the author of an element.

phpdocumentor
@author
@category

The @category tag organizes groups of packages together.

phpdocumentor
@category
@codingStandards

The @codingStandards tag names a coding standard for reference.

phpcs
@codingStandards
@codingStandardsIgnoreEnd

The @codingStandardsIgnoreEnd tag ends a block of code started by @codingStandardsIgnoreStart, resuming coding-standard checks from this point on.

phpcs
@codingStandardsIgnoreEnd
@codingStandardsIgnoreFile

The @codingStandardsIgnoreFile tag ignores the whole file for coding-standard checks.

phpcs
@codingStandardsIgnoreFile
@codingStandardsIgnoreLine

The @codingStandardsIgnoreLine tag ignores a single line of code for coding-standard checks.

phpcs
@codingStandardsIgnoreLine
@codingStandardsIgnoreStart

The @codingStandardsIgnoreStart tag starts a block of code excluded from coding-standard checks, closed by a matching @codingStandardsIgnoreEnd.

phpcs
@codingStandardsIgnoreStart
@consistent-constructor

The @consistent-constructor tag requires that all subclasses declare a constructor compatible with the parent's.

phpstan
@phpstan-consistent-constructor
psalm
@psalm-consistent-constructor
@copyright

The @copyright tag documents the copyright information of an element.

phpdocumentor
@copyright
@deprecated

The @deprecated tag marks an element as deprecated, optionally since a given version.

standard
@deprecated
@example

The @example tag points at an external source that illustrates the use of the documented element, optionally narrowing it to a range of lines starting at a line and spanning a number of lines.

phpdocumentor
@example
@expectedException

The @expectedException tag declares the Throwable a test method is expected to throw.

phpstorm
@expectedException
@extends

The @extends tag allows to extend templated classes and interfaces, providing the concrete type arguments of the parent.

phan
@phan-extends@phan-inherits
phpstan
@phpstan-extends
psalm
@psalm-extends
standard
@extends@inherits@template-extends
@filesource

The @filesource tag tells documentation tooling to include the source of the current file in its output.

phpdocumentor
@filesource
@final

The @final tag declares that an element must not be overridden or extended.

standard
@final
@formatter:off

The @formatter:off tag disables automatic code formatting from this point on, until a matching @formatter:on is found further down the file.

phpstorm
@formatter:off
@formatter:on

The @formatter:on tag re-enables automatic code formatting from this point on, pairing with an earlier @formatter:off.

phpstorm
@formatter:on
@global

The @global tag documents a global variable that a function relies on.

phpdocumentor
@global
@ignore

The @ignore tag tells documentation tooling to skip the element it is attached to.

phpdocumentor
@ignore
@immutable

The @immutable tag declares a class as immutable, meaning none of its state can change after construction.

phan
@phan-immutable
phpstan
@phpstan-immutable
psalm
@psalm-immutable
standard
@immutable
@implements

The @implements tag allows to extend templated interfaces, providing the concrete type arguments of the implemented interface.

phpstan
@phpstan-implements
psalm
@psalm-implements
standard
@implements@template-implements
@import-type

A tag that imports a type alias declared elsewhere, optionally rebinding it to a local name.

phpstan
@phpstan-import-type
psalm
@psalm-import-type
@inheritDoc

The @inheritDoc tag reuses the documentation of the parent element.

phpdocumentor
@inheritDoc
@internal

The @internal tag marks an element as internal to its package, or documents information meant only for the maintainers of that package.

psalm
@psalm-internal
standard
@internal
@language

The @language tag injects a foreign-language grammar, such as SQL, HTML or a regular expression, into a string literal, so an IDE can apply the right highlighting and completion inside it.

phpstorm
@language
@license

The @license tag pointing to the license text by a URL.

phpdocumentor
@license
@link

The @link tag can be used to define a relation, or link, between the element, or part of the long description when used inline, to a URI.

standard
@link
@method

The @method tag declares a "magic" method that can be called on the described class, described as a callable carrying its name, parameters and return type.

phan
@phan-method
phpstan
@phpstan-method
psalm
@psalm-method
standard
@method
@mixin

The @mixin tag declares that the members of the referenced type are made available on the described class.

phan
@phan-mixin
standard
@mixin
@name

The @name tag assigns an alias to a procedural page or global variable so that it can be referred to by that alias in the generated documentation.

phpdocumentor
@name
@no-named-arguments

The @no-named-arguments tag indicates that the argument names may change and must not be relied upon by callers.

standard
@no-named-arguments
@noinspection

The @noinspection tag suppresses the named IDE inspection for the element that follows it.

phpstorm
@noinspection
@not-deprecated

The @not-deprecated tag marks an element as explicitly not deprecated, overriding a @deprecated tag it would otherwise inherit from a parent.

standard
@not-deprecated
@override

The @override tag marks a method as overriding an inherited definition.

phan
@phan-override
standard
@override
@package

The @package tag categorizes elements into a logical subdivision.

phpdocumentor
@package
@param

The @param tag documents a single argument of a function or method.

phan
@phan-param
phpstan
@phpstan-param
psalm
@psalm-param
standard
@param
@param-closure-this

The @param-closure-this tag documents the bound "$this" type of closure passed as an argument.

phpstan
@phpstan-param-closure-this
standard
@param-closure-this
@param-immediately-invoked-callable

The @param-immediately-invoked-callable tag marks a callable argument that is invoked before the function or method returns.

phpstan
@phpstan-param-immediately-invoked-callable
standard
@param-immediately-invoked-callable
@param-later-invoked-callable

The @param-later-invoked-callable tag marks a callable argument that is invoked after the function or method returns.

phpstan
@phpstan-param-later-invoked-callable
standard
@param-later-invoked-callable
@param-out

The @param-out tag documents the type a by-reference argument holds after the function or method returns.

phpstan
@phpstan-param-out
psalm
@psalm-param-out
standard
@param-out
@phan-closure-scope

The @phan-closure-scope tag binds the type of $this inside a Closure, so the closure body is analyzed as though bound to an instance of the given class.

phan
@phan-closure-scope@phanclosurescope
@phan-constructor-used-for-side-effects

The @phan-constructor-used-for-side-effects tag declares that a constructor's return value is intentionally discarded by callers, suppressing the issue raised for an unused new expression.

phan
@phan-constructor-used-for-side-effects
@phan-file-suppress

The @phan-file-suppress tag silences the listed issue types for the whole file it appears in, rather than just a single element or line.

phan
@phan-file-suppress
@phan-forbid-undeclared-magic-methods

The @phan-forbid-undeclared-magic-methods tag forbids calling undeclared magic methods on the class it decorates, so only documented methods may be called.

phan
@phan-forbid-undeclared-magic-methods
@phan-forbid-undeclared-magic-properties

The @phan-forbid-undeclared-magic-properties tag forbids accessing undeclared magic properties on the class it decorates, so only documented properties may be accessed.

phan
@phan-forbid-undeclared-magic-properties
@phan-hardcode-return-type

The @phan-hardcode-return-type tag forces the documented return type to be used instead of the type otherwise inferred from the method body.

phan
@phan-hardcode-return-type
@phan-output-reference

The @phan-output-reference tag marks a by-reference argument as output-only.

phan
@phan-output-reference
@phan-real-return

The @phan-real-return tag documents the actual native return type of a function or method, kept distinct from the documented @return type.

phan
@phan-real-return
@phan-side-effect-free

The @phan-side-effect-free tag declares a function or method as free of side effects.

phan
@phan-side-effect-free
@phan-suppress-current-line

The @phan-suppress-current-line tag silences the listed issue types reported on the current line.

phan
@phan-suppress-current-line
@phan-suppress-next-line

The @phan-suppress-next-line tag silences the listed issue types reported on the next line.

phan
@phan-suppress-next-line
@phan-suppress-next-next-line

The @phan-suppress-next-next-line tag silences the listed issue types reported two lines below the annotation.

phan
@phan-suppress-next-next-line
@phan-suppress-previous-line

The @phan-suppress-previous-line tag silences the listed issue types reported on the previous line.

phan
@phan-suppress-previous-line
@phan-transient

The @phan-transient tag marks a property as excluded from serialization.

phan
@phan-transient
@phan-write-only

The @phan-write-only tag declares that a property may only ever be written, never read.

phan
@phan-write-only
@phpcsSuppress

The @phpcsSuppress tag suppresses the named coding-standard check for the element it decorates.

phpcs
@phpcsSuppress
@phpstan-ignore

The @phpstan-ignore tag silences the listed error identifiers reported on the current line.

phpstan
@phpstan-ignore
@phpstan-ignore-line

The @phpstan-ignore-line tag silences any error reported on the current line.

phpstan
@phpstan-ignore-line
@phpstan-ignore-next-line

The @phpstan-ignore-next-line tag silences any error reported on the next line.

phpstan
@phpstan-ignore-next-line
@phpstan-impure

The @phpstan-impure tag declares a function or method as impure, that is, having side effects.

phpstan
@phpstan-impure
@property

The @property tag declares a magic property that can be both read and written.

phan
@phan-property
phpstan
@phpstan-property
psalm
@psalm-property
standard
@property
@property-read

The @property-read tag declares a magic property that can only be read.

phan
@phan-property-read
phpstan
@phpstan-property-read
psalm
@psalm-property-read
standard
@property-read
@property-write

The @property-write tag declares a magic property that can only be written.

phan
@phan-property-write
phpstan
@phpstan-property-write
psalm
@psalm-property-write
standard
@property-write
@psalm-assert-untainted

The @psalm-assert-untainted tag asserts that the given variable holds no tainted data from this point on.

psalm
@psalm-assert-untainted
@psalm-check-type

The @psalm-check-type tag reports an issue unless the inferred type of the given variable is assignable to the expected type.

psalm
@psalm-check-type
@psalm-check-type-exact

The @psalm-check-type-exact tag reports an issue unless the inferred type of the given variable is exactly the expected type.

psalm
@psalm-check-type-exact
@psalm-consistent-templates

The @psalm-consistent-templates tag requires that all subclasses use the same template parameters as the parent.

psalm
@psalm-consistent-templates
@psalm-external-mutation-free

The @psalm-external-mutation-free tag declares that a method never mutates state observable from outside the object.

psalm
@psalm-external-mutation-free
@psalm-flow

The @psalm-flow tag describes how tainted data flows through a function, optionally naming the parameter the flow applies to.

psalm
@psalm-flow
@psalm-if-this-is

The @psalm-if-this-is tag narrows the type of $this inside a method when the given type matches.

psalm
@psalm-if-this-is
@psalm-ignore-falsable-return

The @psalm-ignore-falsable-return tag ignores a possible false value in the return type.

psalm
@psalm-ignore-falsable-return
@psalm-ignore-nullable-return

The @psalm-ignore-nullable-return tag ignores a possible null value in the return type.

psalm
@psalm-ignore-nullable-return
@psalm-ignore-var

The @psalm-ignore-var tag excludes the immediately following @var annotation from type inference, falling back to the inferred type instead of the declared one.

psalm
@psalm-ignore-var
@psalm-ignore-variable-method

The @psalm-ignore-variable-method tag suppresses "undefined method" issues for methods called on the annotated variable.

psalm
@psalm-ignore-variable-method
@psalm-ignore-variable-property

The @psalm-ignore-variable-property tag suppresses "undefined property" issues for properties accessed on the annotated variable.

psalm
@psalm-ignore-variable-property
@psalm-inheritors

The @psalm-inheritors tag restricts which classes are allowed to extend or implement the described type.

psalm
@psalm-inheritors
@psalm-mutation-free

The @psalm-mutation-free tag declares that a method never mutates any state, whether observable from outside the object or purely internal to it.

psalm
@psalm-mutation-free
@psalm-no-seal-methods

The @psalm-no-seal-methods tag allows a class to declare magic methods beyond those already documented.

psalm
@psalm-no-seal-methods
@psalm-no-seal-properties

The @psalm-no-seal-properties tag allows a class to declare magic properties beyond those already documented.

psalm
@psalm-no-seal-properties
@psalm-override-method-visibility

The @psalm-override-method-visibility tag allows a subclass to override an inherited method with a different visibility than the parent declares.

psalm
@psalm-override-method-visibility
@psalm-override-property-visibility

The @psalm-override-property-visibility tag allows a subclass to override an inherited property with a different visibility than the parent declares.

psalm
@psalm-override-property-visibility
@psalm-scope-this

The @psalm-scope-this tag binds the type of $this inside a Closure, so the closure body is type-checked as if it were a method of the given class.

psalm
@psalm-scope-this
@psalm-stub-override

The @psalm-stub-override tag marks a stub declaration as intentionally overriding the real signature.

psalm
@psalm-stub-override
@psalm-taint-escape

The @psalm-taint-escape tag marks a value as no longer tainted after passing through the described element.

psalm
@psalm-taint-escape
@psalm-taint-sink

The @psalm-taint-sink tag marks the given variable as a sink where tainted data of the named taint type must never arrive.

psalm
@psalm-taint-sink
@psalm-taint-source

The @psalm-taint-source tag marks the return value as a taint source of the given type.

psalm
@psalm-taint-source
@psalm-taint-specialize

The @psalm-taint-specialize tag tracks tainted data separately per call site, rather than merging taint information from all callers together.

psalm
@psalm-taint-specialize
@psalm-taint-unescape

The @psalm-taint-unescape tag marks a value as tainted again after passing through the described element, reversing an earlier @psalm-taint-escape.

psalm
@psalm-taint-unescape
@psalm-trace

The @psalm-trace tag outputs the inferred type of the given variable, for debugging purposes.

psalm
@psalm-trace
@psalm-variadic

The @psalm-variadic tag declares that a class's magic __call/__callStatic methods accept a variadic list of arguments.

psalm
@psalm-variadic
@pure

The @pure tag declares a function or method as pure, meaning it is free of side effects: calling it repeatedly with the same arguments always produces the same result, without observably mutating any state.

phan
@phan-pure
phpstan
@phpstan-pure
psalm
@psalm-pure
@pure-unless-callable-is-impure

The @pure-unless-callable-is-impure tag declares a function pure unless a callable it receives is itself impure.

phpstan
@phpstan-pure-unless-callable-is-impure
standard
@pure-unless-callable-is-impure
@readonly

The @readonly tag declares that a property may only be written once, during initialization.

phan
@phan-read-only
phpstan
@phpstan-readonly
psalm
@psalm-readonly
standard
@readonly
@readonly-allow-private-mutation

The @readonly-allow-private-mutation tag allows a readonly property to be mutated from within the declaring class, rather than only during initialization.

phpstan
@phpstan-readonly-allow-private-mutation
psalm
@psalm-readonly-allow-private-mutation
@require-extends

The @require-extends tag constrains a trait so it may only be used by a class that extends the given type.

phpstan
@phpstan-require-extends
psalm
@psalm-require-extends
standard
@require-extends
@require-implements

The @require-implements tag constrains a trait so it may only be used by a class that implements the given interface.

phpstan
@phpstan-require-implements
psalm
@psalm-require-implements
standard
@require-implements
@return

The @return tag documents the return value of a function or method.

phan
@phan-return
phpstan
@phpstan-return
psalm
@psalm-return
standard
@return@returns
@seal-methods

The @seal-methods tag forbids declaring magic methods beyond those already documented.

psalm
@psalm-seal-methods
standard
@seal-methods
@seal-properties

The @seal-properties tag forbids declaring magic properties beyond those already documented.

psalm
@psalm-seal-properties
standard
@seal-properties
@see

The @see tag can be used to define a {@see CodeReference element}.

standard
@see
@self-out

The @self-out tag documents the refined type of $this after a method call, letting callers see a narrower object type than the one they started with.

phpstan
@phpstan-self-out@phpstan-this-out
psalm
@psalm-self-out@psalm-this-out
@since

The @since tag documents the version at which an element became available.

phpdocumentor
@since
@source

The @source tag points at a range of lines of the documented element's source, starting at a line and optionally spanning a number of lines.

phpdocumentor
@source
@static

The @static tag declares a method or property as static.

phpdocumentor
@static
@staticvar

The @staticvar tag documents the type of static variable declared within a function or method, optionally naming the variable it applies to.

phpdocumentor
@staticvar
@subpackage

The @subpackage tag categorizes elements into a logical subdivision below their package.

phpdocumentor
@subpackage
@suppress

The @suppress tag silences the listed diagnostics that would otherwise be reported for an element.

psalm
@psalm-suppress
standard
@suppress
@template

The @template tag declares an invariant generic type parameter.

phan
@phan-template
phpstan
@phpstan-template
psalm
@psalm-template
standard
@template@template-invariant
@template-contravariant

The @template-contravariant tag declares a contravariant generic type parameter.

phpstan
@phpstan-template-contravariant
psalm
@psalm-template-contravariant
standard
@template-contravariant
@template-covariant

The @template-covariant tag declares a covariant generic type parameter.

phpstan
@phpstan-template-covariant
psalm
@psalm-template-covariant
standard
@template-covariant
@throws

The @throws tag indicates the type of "\Throwable" that an element may throw.

phpstan
@phpstan-throws
standard
@throws@throw
@todo

The @todo tag records a task that still needs to be done for an element.

phpdocumentor
@todo
@type

A tag that declares a local type alias: a name bound to a type expression.

phan
@phan-type
phpstan
@phpstan-type
psalm
@psalm-type
@unused-param

The @unused-param tag marks an argument that is intentionally left unused.

phan
@phan-unused-param
standard
@unused-param
@use

The @use tag allows to extend templated traits, providing the concrete type arguments of the used trait.

phpstan
@phpstan-use
psalm
@psalm-use
standard
@use@template-use
@used-by

The @used-by tag indicates that the described element is used by the referenced one.

phpdocumentor
@used-by
@uses

The @uses tag indicates that the described element uses the referenced one.

phpdocumentor
@uses
@var

The @var tag documents the type of a property, constant or inline variable, optionally naming the variable it applies to.

phan
@phan-var
phpstan
@phpstan-var
psalm
@psalm-var
standard
@var
@version

The @version tag documents the current version of an element.

phpdocumentor
@version
@yield

The @yield tag documents the type yielded by a Generator, distinct from the type it returns on completion.

phpstan
@phpstan-yield
psalm
@psalm-yield