/php:php-8-0from php
Enforces a PHP 8.0+ convention: name every argument from the fourth onward. Helps avoid silent bugs in value objects, factories, test fixtures, and long-parameter calls.
Ships in php. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The key project convention: from the fourth argument on, name every argument. Three positional arguments or fewer stay positional.
// AVOID: six positional arguments, no call site tells you what they mean
new SwisslifeOtherSource('400', 'Succession', '2019-06-14', 'FR', 'Notaire Martin', 'Banque Populaire');
// CORRECT: named from the fourth on — here, all of them
new SwisslifeOtherSource(
amount: '400',
justification: 'Succession',
date: '2019-06-14',
countryCode: 'FR',
fundIssuer: 'Notaire Martin',
depositoryInstitution: 'Banque Populaire',
);
// CORRECT: three arguments, positional is fine
new SwisslifeEmploymentIncomeSource('Eres', 'FR', '600');
All or nothing on a given call. Once the threshold is crossed, name every
argument rather than only the ones past the third: a call that mixes
('400', 'Succession', date: '2019-06-14', …) reads worse than either form, and
PHP forbids a positional argument after a named one anyway.
Why four. Below that, the parameter list is short enough that the signature is
one glance away and the names add noise. Past it, a reader has to count commas
against a constructor they cannot see, and two adjacent arguments of the same type
become a silent swap the type system cannot catch. SwisslifeOtherSource above
takes six strings in a row — nothing but the order distinguishes a fund issuer
from a depository institution.
The rule also survives refactors: inserting a parameter, reordering, or making one optional breaks positional call sites silently and named ones loudly.
SpiricaDeclarationFactory::createDatedDetailedSource($option, $justification, $date, $amount) against new SpiricaDatedDetailedSource( $justification, $amount, $date) — two orders for the same three values.Applies to constructors, static factories, instance methods and plain functions
alike. Native functions with a conventional signature everyone reads at a glance
(str_replace, number_format, array_slice) are the one place where the count
is not worth enforcing.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
php, named-arguments, coding-conventions, php-8-0, value-objects, test-fixtures
npx claudepluginhub fabiensalles/claude-marketplace --plugin php10 skills in this plugin
/php-8-1ACTIVATE when passing a method as a callback in a PHP 8.1+ project — event listeners, validator callbacks, Twig functions, array_map/usort callables. Covers: mandatory first-class callable syntax (`$this` method reference with `(...)`) over array/string callables. DO NOT use for: general PHP syntax, PHP 8.2 features (see php-8-2), PHP 8.3 features (see php-8-3)./php-8-2ACTIVATE 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)./php-8-3ACTIVATE when writing PHP class constants in a PHP 8.3+ project. Covers: mandatory typed class constants and default visibility. DO NOT use for: general PHP syntax, PHP 8.2 features (see php-8-2).Other plugins' skills for the same job