/php:php-8-1from php
Enforces first-class callable syntax ($this->method(...)) over array/string callables in PHP 8.1+ projects. Covers event listeners, validators, Twig functions, and array callbacks.
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: reference a method callback with the first-class
callable syntax $this->method(...) (or self::method(...)), never an array
[$this, 'method'] / [self::class, 'method'] or string 'method' callable.
// AVOID: array / string callable references
$builder->addEventListener(FormEvents::PRE_SUBMIT, [$this, 'cleanScheduledPayment']);
new Assert\Callback([self::class, 'validateSingleDefaultAccount']);
usort($items, [$this, 'compareByAmount']);
// CORRECT: first-class callable
$builder->addEventListener(FormEvents::PRE_SUBMIT, $this->cleanScheduledPayment(...));
new Assert\Callback($this->validateSingleDefaultAccount(...));
usort($items, $this->compareByAmount(...));
Why: the (...) form is resolved at compile time, so the method must exist —
the IDE navigates to it, static analysis catches typos and signature drift, and
refactors/renames update the reference. Array/string callables are opaque strings
that silently rot.
Applies to every callback handed to a framework API: form event listeners,
Assert\Callback constraints, TwigFunction/TwigFilter, and native callable
consumers such as usort. The referenced method stays private unless an
external consumer needs it.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub fabiensalles/claude-marketplace --plugin php10 skills in this plugin
/php-8-0ACTIVATE when calling a constructor, method or function with four or more arguments in a PHP 8.0+ project — value objects, contract requests, factories, projections, test fixtures. Covers: mandatory named arguments from the fourth argument on. DO NOT use for: calls of three arguments or fewer, PHP 8.1 features (see php-8-1), 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