php
Installation
SKILL.md
PHP
Strict types, explicit contracts, no magic. If a class needs a docblock to explain what its properties do, the properties are named wrong.
PHP 8.5+ is the baseline. Use modern syntax unconditionally — union types, enums, readonly
classes, property hooks, named arguments, match, pipe operator. No backward compatibility
with older PHP versions unless the project explicitly requires it.
Every PHP file starts with declare(strict_types=1).
References
| Topic | Reference | Contents |
|---|---|---|
| Type system | ${CLAUDE_SKILL_DIR}/references/typing.md |
Union/intersection/DNF types, nullable patterns, typed properties and constants, coercion rules, variance |
| OOP patterns | ${CLAUDE_SKILL_DIR}/references/oop.md |
Interfaces, traits, readonly, property hooks, enums, constructor promotion, lazy objects, magic methods |
| Concurrency | ${CLAUDE_SKILL_DIR}/references/concurrency.md |
Fiber API, generator coroutines, comparison table, async library guidance |
| Packaging | ${CLAUDE_SKILL_DIR}/references/packaging.md |
composer.json templates, version constraints, project layouts, namespace conventions |