Claude
Cursor
Skill
php-conventions
PHP code conventions covering PHP 8.2+ strict types, PSR-12 formatting, PHPStan/Psalm static analysis, PHPUnit, Composer dependency management, PSR-4 autoloading, and security. Load when writing or reviewing PHP code.
Virus-scanned
Reviewed automatically before listing.
Download
goldziher-ai-rulez-internal_builtins_languages_php_skills_php-conventions-ca967ad.zip · 0 KB
Install
skills CLI
npx skills add https://github.com/Goldziher/ai-rulez/tree/main/internal/builtins/languages/php/skills/php-conventions
Claude Code
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install goldziher-ai-rulez@llmmart
Git
git clone https://github.com/Goldziher/ai-rulez.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole goldziher/ai-rulez collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
- PHP 8.2+,
declare(strict_types=1), typed properties, union types, enums, readonly classes. - Formatting: PSR-12 via a fixer (e.g., PHP_CodeSniffer/phpcbf or php-cs-fixer). Static analysis: a strict analyzer (e.g., PHPStan at max level or Psalm).
- Testing: PHPUnit with
@dataProvider, 80%+ coverage. - Error handling: specific exceptions extending
RuntimeException, constructor promotion for value objects. - First-class callable syntax (
$fn = strlen(...)) for callbacks. Arrow functions (fn() =>) for simple closures. - Dependencies: Composer with
composer.lockcommitted,^version constraints.composer auditin CI. - Security: require
roave/security-advisoriesas dev dependency to block vulnerable packages. - PSR-4 autoloading exclusively — no
require/includefor classes. - Intersection types for strict parameter contracts. Named arguments for readability.
- Anti-patterns:
@suppression,eval(), dynamic property access,extract().
Files (ai-rulez)
-
SKILL.md 1.2 KB
--- name: php-conventions description: PHP code conventions covering PHP 8.2+ strict types, PSR-12 formatting, PHPStan/Psalm static analysis, PHPUnit, Composer dependency management, PSR-4 autoloading, and security. Load when writing or reviewing PHP code. --- - PHP 8.2+, `declare(strict_types=1)`, typed properties, union types, enums, readonly classes. - Formatting: PSR-12 via a fixer (e.g., PHP_CodeSniffer/phpcbf or php-cs-fixer). Static analysis: a strict analyzer (e.g., PHPStan at max level or Psalm). - Testing: PHPUnit with `@dataProvider`, 80%+ coverage. - Error handling: specific exceptions extending `RuntimeException`, constructor promotion for value objects. - First-class callable syntax (`$fn = strlen(...)`) for callbacks. Arrow functions (`fn() =>`) for simple closures. - Dependencies: Composer with `composer.lock` committed, `^` version constraints. `composer audit` in CI. - Security: require `roave/security-advisories` as dev dependency to block vulnerable packages. - PSR-4 autoloading exclusively — no `require`/`include` for classes. - Intersection types for strict parameter contracts. Named arguments for readability. - Anti-patterns: `@` suppression, `eval()`, dynamic property access, `extract()`.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.