typed-properties
Installation
SKILL.md
Typed Properties
When to use
- The user adds explicit types to class properties for stronger contracts on PHP 7.4+.
- The user wants a property that may legitimately hold
null, distinct from an unset property, on PHP 7.4+. - The user declares typed properties through constructor property promotion on PHP 8.0+.
When NOT to use
- Do not force a narrow type when the property genuinely holds heterogeneous or dynamic data; model it as an object or a typed collection instead.
- Do not use typed properties when the target runtime is PHP 7.3 or earlier; document types in docblocks instead.