PHP TypeLang Help

@property-write

The @property-write tag declares a magic property that can only be written, never read back: __set is expected to handle it, but __get should reject it (or simply doesn't exist). It is the mirror image of @property-read — useful for write-only concerns such as a setter that stores a hashed or otherwise transformed value that the object never exposes in its original form.

"@property-write" <Type> <Variable> [ <Description> ]

Parsing a @property-write tag produces a TypedVariableTag instance exposing:

  • $type — the documented TypeNode.

  • $variable — the property's name, without the leading $.

final class PropertyWriteTag extends MagicPropertyTag { // Same shape as PropertyReadTag: inherits `$type` // and `string $variable` from MagicPropertyTag; // adds nothing of its own. }

Use @property instead when both directions are supported, or @property-read for the mirror case of a read-only property.

Defined by the same PSR-19 §5.11 section as @property, and phpDocumentor's own @property-write reference.

05 July 2026