php-quality

Validate PHP code for strict typing and PSR-12 compliance.

415|44|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/notque/vexjoy-agent --skill php-quality-notque
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-quality
Source: https://github.com/notque/vexjoy-agent/tree/main/skills/engineering/php-quality
Command: npx skills add https://github.com/notque/vexjoy-agent --skill php-quality-notque

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Ensures PHP code meets consistent quality standards and avoids “it looks correct” shortcuts by requiring strict typing, PSR-12 structure, modern language usage, and (when relevant) framework/tooling idioms.

Core Features & Use Cases

  • Strict types enforcement: Requires declare(strict_types=1) at the top of every PHP file to prevent silent type coercion.
  • PSR-12 compliance checks: Verifies formatting and structural rules like indentation, whitespace, visibility, and brace style.
  • Modern PHP feature guidance: Applies recommendations for PHP 8.0–8.2 language features (e.g., enums, readonly, match, null-safe operator, named arguments) when the topic is relevant.
  • Framework idiom review (Laravel/Symfony): Applies idiomatic patterns for collections, Eloquent scopes, service container binding, Symfony DI attributes, and event dispatchers when framework signals are present.
  • Tooling-aware quality review: Uses quality tool references (PHP-CS-Fixer, PHPStan, Psalm, Rector) to guide configuration and CI expectations when tooling signals appear.

Quick Start

Review my PHP code for quality by checking strict types, PSR-12 compliance, and relevant framework and static-analysis idioms.

Frequently Asked Questions about php-quality

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce strict types and PSR-12 compliance in PHP code review?

To enforce strict types and PSR-12 compliance during PHP code review, validate that every file declares `strict_types=1` and check formatting, whitespace, and brace style against PSR-12 standards. This prevents silent type coercion and ensures consistent structural conventions across your codebase.

What modern PHP features should I use for code quality in PHP 8.0 through 8.2?

For modern PHP code quality in versions 8.0 through 8.2, apply enums, readonly properties, match expressions, null-safe operators, and named arguments. Using these features ensures your codebase follows current language standards and avoids deprecated structural patterns.

Does this PHP quality review work with Laravel and Symfony framework idioms?

Yes, this PHP quality review works with Laravel and Symfony framework idioms. It validates framework-specific patterns including Eloquent scopes, collection usage, service container binding, Symfony DI attributes, and event dispatchers when those framework signals are present in your code.

How do I configure PHPStan, Psalm, and PHP-CS-Fixer for static analysis and code style?

To configure PHPStan, Psalm, PHP-CS-Fixer, and Rector for static analysis and code style, use tooling-aware references that guide CI expectations and configuration setup. This ensures your automated quality gates align with strict typing and modern PHP standards.

Why does my PHP code fail strict typing checks during static analysis?

Your PHP code fails strict typing checks during static analysis if files are missing `declare(strict_types=1)` at the top. This declaration prevents silent type coercion, and without it, static analysis tools flag type mismatches that would otherwise pass silently during runtime.

Can I use Rector to automate modern PHP code quality fixes for PSR-12?

Yes, you can use Rector to automate modern PHP code quality fixes for PSR-12. Rector serves as a tooling-aware reference that helps configure automated upgrades and structural fixes, ensuring your code aligns with strict typing and modern language conventions.