PHP Code Quality
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Run every static-analysis and coding-style tool a PHP project actually has wired and report every issue they find, grouped by tool and classified by rule id. It is report-only: it never fixes issues, applies Rector/Pint/PHP-CS-Fixer changes, updates a baseline, or edits tool configuration.
Purpose
iru-php-code-quality gives a single, trustworthy quality pass for PHP projects of any flavor. It detects the flavor (Laravel application, WordPress plugin or theme, PrestaShop module, plain Composer library) from composer.json and file markers, which decides the expected tools and the rule-id prefixes that matter: Pint and Larastan for Laravel, PHPCS with WordPressCS and PHPCompatibilityWP for WordPress, PHP-CS-Fixer and PrestaShop’s PHPStan config for PrestaShop, PHP-CS-Fixer/PHPCS with PHPStan or Psalm for libraries, and Rector when rector.php exists. It verifies that each tool’s binary and configuration really exist before trusting a zero result, so a missing tool is reported as skipped and never as "0 issues". When the caller supplies a baseline (for example iru-php-code-one-task-group capturing one before a task group), only new-versus-baseline issues per rule id are reported.
Plugin
Shipped by the iru-php plugin of the ai-catalog marketplace (install with /plugin install iru-php@ai-catalog; see Plugins).
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
Files, directories or globs to scope both the tools' run and the report (globs are expanded with |
None — each tool analyses what its own config lists. |
Baseline (from the prompt) |
No |
A prior per-tool, per-rule-id issue count or itemized list from an earlier run, supplied by a calling skill. Reported as a diff, treating tools absent from the baseline as all-new. |
None — full report. The project’s own PHPStan/Psalm baseline files are always applied by the tools. |
Tool invocations, all read-only and writing their machine-readable report under build/iru-php-cq-*: PHPStan --error-format=json (with --memory-limit=1G for Larastan, phpstan-wordpress and the PrestaShop extension, which needs PS_ROOT_DIR), Psalm --output-format=json, Pint --test with a report file, PHP-CS-Fixer check --format=json, PHPCS --report=json, Rector --dry-run --output-format=json. PHP runs on the host when possible, otherwise in the project’s Sail, ddev or wp-env container after docker info succeeds.
Outputs
-
An overall issue total across tools, the detected flavor and environment, then per tool: its total, the config and baseline in force, and a skipped/not-configured note where applicable.
-
Per tool, one line per rule-id bucket with its count (PHPStan
identifier, Psalmtype, fixer names, full PHPCSsource, Rector class), and thefile:line — messagelist for scoped runs or on request. Docblock-related rules are grouped so a caller can hand them toiru-php-phpdoc; WordPress security, database and i18n sniffs and PsalmTainted*issues are listed first. -
Config-level problems (stale baseline entries, invalid configuration, memory exhaustion, missing standards) are reported under a separate bucket, never as code issues. Expected-but-missing tools for the flavor are recommendations, not failures.
-
No raw JSON or diff is pasted, and no file, baseline or configuration is modified.
Execution flow
Dependencies
Invokes
None — iru-php-code-quality is a leaf skill; it only runs the project’s own analysis tools. It mentions iru-php-phpdoc only as the skill a caller can hand docblock findings to.
Invoked by
-
Code — Step 3 and 7, quality baseline and comparison for PHP plans, via the
iru-gate-runneragent. -
PHP Code One Task Group — Step 1 and 3.7, baseline and regression check, via the
iru-gate-runneragent.
Related agents
None — it spawns no agents itself. Calling skills normally run it inside an iru-gate-runner sub-agent.
Source
SKILL.md on GitHub — the file this page was generated from.