php-best-practices

Enforces PHP 8.x best practices including type safety and PSR compliance.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/JefersonCCJM/hotel_san_pedro --skill php-best-practices-jefersonccjm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-best-practices
Source: https://github.com/JefersonCCJM/hotel_san_pedro/tree/main/.agents/skills/php-best-practices
Command: npx skills add https://github.com/JefersonCCJM/hotel_san_pedro --skill php-best-practices-jefersonccjm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Promotes consistent, high-quality PHP code by enforcing modern patterns, PSR standards, and SOLID design across projects.

Core Features & Use Cases

  • Comprehensive guidance on Type System, Modern Features, PSR Standards, SOLID Principles, Error Handling, Performance, and Security.
  • Practical examples and patterns to apply during development, code reviews, and onboarding.
  • Real-world scenarios showing how to refactor legacy PHP code to modern, maintainable styles.

Quick Start

Review a PHP codebase and identify violations, then apply the recommended practices to improve quality and safety.

Frequently Asked Questions about php-best-practices

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

FAQPage Schema
How do I enforce PHP 8.x type safety and strict types during a code review?

To enforce PHP 8.x type safety during a code review, verify strict types declarations, parameter types, return types, and union types. This identifies violations and ensures consistent type safety across the codebase.

What are the best practices for refactoring legacy PHP code to modern standards?

Best practices for refactoring legacy PHP involve applying PSR standards, SOLID design, and modern features like match expressions and named arguments. This updates old code to a maintainable, modern style.

How do I apply SOLID design principles and PSR compliance in PHP projects?

Apply SOLID design and PSR compliance in PHP by following Dependency Inversion and Open-Closed guidance during development and onboarding. This promotes consistent, high-quality PHP code across projects.

When do I need union types and named arguments in PHP 8.x development?

You need union types and named arguments in PHP 8.x development when handling multiple value formats and improving function readability. These modern features enhance type safety and code clarity.

Can I use modern PHP patterns for onboarding developers to an existing codebase?

Yes, you can use modern PHP patterns for onboarding developers to an existing codebase. Applying PSR standards, type declarations, and SOLID principles ensures developers understand consistent, high-quality code expectations.