Tag reference
@final
The @final tag declares that a class must not be extended, or that a
method must not be overridden any further. It is the documentation-level
counterpart to PHP’s native final keyword, used in places the keyword
itself cannot reach — for example, to tell consumers that a method behaves
as final by convention in a class that isn’t itself declared final, or in
generated stubs and interfaces where the native modifier does not apply.
Grammar
"@final" [ <Description> ]Examples
/** * @final Overriding this would break the transaction guarantees * below. */public function commit(): void/** * @final */class Money {}Names by platform
- standard
@final
Parsing a @final tag produces a FinalTag instance. Being a pure marker,
it adds nothing beyond the $name and optional $description every
Tag already carries.
final class FinalTag extends FlagTag {}phpDocumentor documents @final on its own tag reference page;
unlike @api, @author, @copyright, @deprecated, and @internal,
it is not part of the PSR-19 draft’s list of tags.