php-best-practices

Installation
SKILL.md

PHP Best Practices

A comprehensive methodology for modernizing, refactoring, and enforcing quality standards in PHP 8.2+ codebases. Covers language feature adoption, refactoring patterns, code smell detection, PSR-12 compliance, and Rector-driven automated upgrades.

Command Reference

Command Description
/php modernize Upgrade code to use PHP 8.2+ features — enums, readonly, match, named args, null-safe operator, intersection types, DNF types
/php refactor Apply refactoring patterns — extract method/class, replace conditional with polymorphism, introduce parameter object, decompose fat controllers
/php review Detect code smells and anti-patterns, suggest concrete refactoring steps with before/after examples
/php standards Enforce PSR-12, strict types, type coverage, return types, PHPDoc discipline

1. /php modernize — Adopt PHP 8.2+ Features

Installs
18
GitHub Stars
20
First Seen
Mar 3, 2026
php-best-practices — nasrulhazim/claude