Tag reference
@override
The @override tag marks a method as intentionally overriding a definition
inherited from a parent class. It mirrors PHP 8.3’s native #[\Override]
attribute, and covers the cases the attribute cannot: codebases that still
support older PHP versions, and interfaces or traits, where the native
attribute has no effect.
Grammar
"@override" [ <Description> ]"@phan-override" [ <Description> ]Examples
/** * @override */public function handle(Request $request): Response/** * @override Adds retry handling on top of the base transport. */public function send(Message $message): boolNames by platform
- phan
@phan-override- standard
@override
Parsing an @override tag produces an OverrideTag
instance:
final class OverrideTag extends FlagTag {}Being a pure marker, it adds nothing beyond the $name
and optional $description every Tag
already carries.
It resembles PHP 8.3’s native #[\Override] attribute —
and covers the cases that attribute can’t, such as codebases
still supporting older PHP versions, or interfaces and
traits, where the native attribute has no effect — but that
attribute is a distinct language feature, not this tag’s
origin. Phan has its own, unrelated @phan-override. This
tag is this library’s own convention.