Skip to content

Tag reference

@phan-forbid-undeclared-magic-methods

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

Grammar

"@phan-forbid-undeclared-magic-methods" [ <Description> ]

Examples

Only the documented magic methods may be called.
/**
* @method void save()
* @phan-forbid-undeclared-magic-methods
*/
final class Model {}

Names by platform

phan
@phan-forbid-undeclared-magic-methods

Parsing a @phan-forbid-undeclared-magic-methods tag produces a PhanForbidUndeclaredMagicMethodsTag instance. Being a pure marker, it adds nothing beyond the $name and optional $description every Tag already carries.

final class PhanForbidUndeclaredMagicMethodsTag extends FlagTag {}

See Phan’s Annotating Your Source Code wiki, where it is mentioned in body text.