From php
ACTIVATE when writing PHP classes, DTOs, or value objects in a PHP 8.2+ project. Covers: mandatory readonly class usage (class-level, not per-property). DO NOT use for: general PHP syntax, PHP 8.3 features (see php-8.3).
How this skill is triggered — by the user, by Claude, or both
Slash command
/php:php-8.2The summary Claude sees in its skill listing — used to decide when to auto-load this skill
The key project convention: always use `readonly class` instead of per-property `readonly`.
The key project convention: always use readonly class instead of per-property readonly.
// AVOID: readonly on each property
final class OrderSummary
{
public function __construct(
private readonly string $orderUuid,
private readonly string $buyerUuid,
) {}
}
// CORRECT: readonly on the class
final readonly class OrderSummary
{
public function __construct(
private string $orderUuid,
private string $buyerUuid,
) {}
}
Use readonly class when all properties should be readonly (most DTOs, value objects, services). Keep per-property readonly only when some properties need to be mutable.
npx claudepluginhub fabiensalles/claude-marketplace --plugin phpWrite modern PHP 8.x code with typed properties, enums, readonly classes, match expressions, named arguments, union types, fibers, attributes, and constructor promotion. For WooCommerce or PHP 8.x projects.
Writes modern PHP 8.x code with constructor promotion, enums, readonly classes/properties, match expressions, named arguments, union/intersection types, fibers, attributes. For Magento or PHP 8.x projects.