Skip to content

Tag reference

@phan-forbid-undeclared-magic-properties

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

Grammar

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

Examples

Only the documented magic properties may be used.
/**
* @property string $name
* @phan-forbid-undeclared-magic-properties
*/
final class Record {}

Names by platform

phan
@phan-forbid-undeclared-magic-properties

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

final class PhanForbidUndeclaredMagicPropertiesTag extends FlagTag {}

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