php-best-practices

Analyze PHP code against 51 rules for type safety, PSR standards, and security.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/mkopcic/md-solutions.hr-racuni-app --skill php-best-practices-mkopcic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-best-practices
Source: https://github.com/mkopcic/md-solutions.hr-racuni-app/tree/main/.github/skills/php-best-practices
Command: npx skills add https://github.com/mkopcic/md-solutions.hr-racuni-app --skill php-best-practices-mkopcic

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PHP projects often suffer from inconsistent standards. This guide codifies modern PHP 8.x best practices to improve reliability, readability, and security across codebases.

Core Features & Use Cases

  • 51 rules spanning Type System, Modern Features, PSR Standards, SOLID, Error Handling, Performance, and Security.
  • Helps teams audit, refactor, and maintain PHP 8.x projects to align with community standards.
  • Useful for code reviews, onboarding, and automated linting/static analysis workflows.

Quick Start

Run an audit against the PHP codebase to surface non-compliant patterns and begin applying the 51 rules.

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 best practices during code review?

You enforce PHP 8.x best practices by analyzing code against 51 rules covering type safety, PSR standards, SOLID, error handling, performance, and security to surface non-compliant patterns for automated review and refactoring.

Can I audit PHP code quality based on the project's PHP version?

You can audit PHP code quality based on the PHP version detected from composer.json or runtime PHP version, adapting rule enforcement dynamically across versions 8.0 through 8.5.

What are modern PHP type safety and SOLID design rules?

Modern PHP type safety and SOLID design rules are standardized guidelines that improve code reliability and readability by enforcing strict typing, modern features, PSR standards, and secure error handling.

How do I refactor PHP code to meet PSR standards?

You refactor PHP code to meet PSR standards by running an audit that identifies non-compliant patterns and outputs actionable feedback with concrete examples and safe defaults for immediate correction.

Does this PHP static analysis approach work without external dependencies?

Yes, this PHP static analysis approach works without external dependencies, operating as a standalone guide to codify modern PHP 8.x community standards for codebase consistency.