{"enrichment":{"faq":[{"a":"Php Idioms teaches strict typing with declare(strict_types=1), named arguments for clarity, match expressions over switch statements, and constructor injection for dependency management. Use readonly classes and enums for immutable data, leverage union and intersection types, and adopt PSR-12 naming conventions. These patterns make code type-safe, testable, and maintainable across PHP 8.x projects.","q":"What modern PHP 8.x idioms and best practices should I follow?"},{"a":"Php Idioms covers PSR-12 standards for class names (PascalCase), method names (camelCase), constants (UPPER_SNAKE_CASE), and file organization. Apply these conventions consistently across namespaces, use PHP CS Fixer to automate formatting, and configure your IDE to enforce rules. This ensures your codebase remains readable and aligns with community standards.","q":"How do I implement PSR-12 compliant naming and structure?"},{"a":"Php Idioms recommends PHPStan and Psalm for static type checking, and PHP CS Fixer for code formatting. Configure these tools in your CI/CD pipeline to catch type errors, unused variables, and style violations before deployment. Combined with PHPUnit or Pest for testing, they form a robust quality gate for PHP projects.","q":"What static analysis and formatting tools should I set up?"},{"a":"Php Idioms teaches readonly classes and enums to enforce immutability in Data Transfer Objects. Design domain exceptions as a hierarchy with specific exception classes for different error scenarios. Use constructor promotion and strict typing to ensure DTOs are type-safe and exceptions carry meaningful context for error handling.","q":"How can I design immutable DTOs and domain exceptions in PHP?"},{"a":"Php Idioms explains that PHP 8.x match expressions are stricter than switch statements\u2014they require exhaustive cases, return values directly, and use strict (===) comparison by default. Match is ideal for pattern matching and cleaner syntax when mapping inputs to outputs, reducing boilerplate and potential bugs.","q":"What are PHP match expressions and how do they differ from switch?"},{"a":"Php Idioms covers constructor injection as the primary pattern: accept dependencies as constructor parameters typed with interfaces, not concrete classes. This decouples your code, enables easy mocking in tests, and follows SOLID principles. Combine with PHPUnit or Pest frameworks to verify behavior without tight coupling.","q":"How do I write testable PHP with proper dependency injection?"}],"shadow_tags":["type-safety","immutable-design","psr-compliance","static-analysis","modern-php8","domain-driven","dependency-injection","code-quality"],"summary_rewrite":"This skill covers idiomatic PHP 8.x development, emphasizing strict typing, immutable data structures via readonly classes and enums, and domain-driven error handling. Learn named arguments, match expressions, constructor injection, and PSR-12 naming conventions alongside static analysis tools like PHPStan and Psalm."},"files":[{"bytes":3265,"path":".agents/skills/php-idioms/SKILL.md","sha256":"12485dd0b7a4b1b924e8a68cf10112bab685b17d744af2d942ff727750c8a858","url":"https://skillfed.io/files/irahardianto/awesome-agv/php-idioms/49f7dd1f/SKILL.md"}],"id":"irahardianto/awesome-agv/php-idioms","links":{"html":"https://skillfed.io/irahardianto/awesome-agv/php-idioms","md":"https://skillfed.io/irahardianto/awesome-agv/php-idioms.md","repo":"https://github.com/irahardianto/awesome-agv"},"meta":{"agents_supported":[],"first_seen":"2026-07-28","forks":48,"language":"JavaScript","last_updated":"2026-07-17","license":"MIT","name":"Php Idioms","publisher":"irahardianto","stars":150},"relations":{"similar":[{"id":"Pixel-Process-UG/superkit-agents/php-specialist"},{"id":"irahardianto/awesome-agv/laravel-idioms"},{"id":"Jeffallan/claude-skills/php-pro"},{"id":"irahardianto/awesome-agv/java-idioms"},{"id":"notque/vexjoy-agent/php"},{"id":"Goldziher/ai-rulez/php-conventions"},{"id":"softspark/ai-toolkit/php-rules"},{"id":"personamanagmentlayer/pcl/php-expert"},{"id":"miles990/claude-software-skills/php"},{"id":"maxnorm/magento2-agent-skills/magento-code-reviewer"}]},"slug":{"owner":"irahardianto","repo":"awesome-agv","skill":"php-idioms"},"version":"49f7dd1f"}
