php-principles

Installation
SKILL.md

PHP Principles

Use this when writing or reviewing PHP code in any project.

The language features below cite the PHP manual in SOURCES.md (PHP-TYPING-01, PHP-CONSTRUCTOR-PROMOTION-01, PHP-ENUMS-01).

Defaults

  • Prefer typed properties, parameters, and return types.
  • Use braces for every control-flow block, even when it contains one statement.
  • Use constructor property promotion for clear injected dependencies; use enums for finite domain states.
  • Document complex array shapes and generic collections with PHPDoc when native types cannot express them.
  • Confirm the project's minimum PHP version before using a language feature; version-specific syntax is never a universal requirement.
  • Favor composition over inheritance.
  • Keep classes small and focused on one responsibility.
  • Avoid global state and static helpers that hide dependencies.
  • Write unit tests for pure logic; use integration tests at boundaries.

DRY

Installs
8
GitHub Stars
1
First Seen
Jul 10, 2026
php-principles — wakqasahmed/php-laravel-filament-skills