{"enrichment":{"faq":[{"a":"PHP Specialist teaches you to leverage PHP 8.x's type system through union and intersection types, strict type declarations, and constructor promotion. Use `declare(strict_types=1)` at file start, apply named arguments for clarity, and adopt match expressions over switch for exhaustive pattern matching. Combine readonly properties (PHP 8.1+) and enums to build immutable, self-documenting structures that static analyzers can verify.","q":"How do I write modern PHP 8 code with type safety?"},{"a":"PHP Specialist covers enums as type-safe alternatives to class constants, supporting both pure and backed variants (string/int). Readonly properties prevent reassignment after initialization, enforcing immutability at the language level. Together they eliminate entire categories of bugs: enums guarantee valid states, readonly prevents accidental mutation. Use backed enums for database mapping; combine readonly with constructor promotion for concise, safe value objects.","q":"What are PHP 8.1 enums and readonly properties?"},{"a":"PHP Specialist guides PHPStan configuration from baseline through level 9 (strictest). Create `phpstan.neon`, set your desired level, and exclude test/vendor directories. Integrate with your CI pipeline to catch type mismatches, undefined methods, and logic errors before runtime. Pair PHPStan with Psalm for complementary checks. Both tools enforce the type contracts your code declares, making refactoring safer and reducing production bugs.","q":"How do I set up PHPStan static analysis?"},{"a":"PHP Specialist recommends defining PSR-4 namespaces in your `composer.json` autoload section, mapping namespace prefixes to directory paths. Run `composer dump-autoload` to generate optimized class maps. This standard ensures your code integrates seamlessly with any PHP ecosystem tool. Combine PSR-4 with strict_types and static analysis to create a foundation where classes load predictably and type violations surface immediately.","q":"How should I configure PSR-4 autoloading with Composer?"},{"a":"PHP Specialist teaches dependency injection through constructor parameters typed to interfaces, not concrete classes. Define narrow, focused interfaces; implement them in multiple concrete classes. Use type hints everywhere to enforce contracts. This approach decouples components, simplifies testing (mock interfaces easily), and makes refactoring safe. Combined with static analysis, interface-driven design catches violations at analysis time, not runtime.","q":"How do I apply SOLID principles and interface-driven design in PHP?"},{"a":"PHP Specialist advocates readonly properties (PHP 8.2 readonly classes for full immutability) paired with constructor promotion for compact syntax. Validate state in the constructor; throw custom exceptions for invalid input. Use backed enums for constrained fields. Build custom exception hierarchies inheriting from base exceptions for fine-grained error handling. These patterns create self-validating, type-safe data structures that static analyzers trust implicitly.","q":"What's the best way to build immutable value objects and DTOs?"}],"shadow_tags":["type-safety","modern-php","static-analysis","code-standards","dependency-injection","immutable-objects","domain-driven","architecture-patterns","code-quality","functional-composition"],"summary_rewrite":"PHP Specialist guides you through modern PHP 8.x development with language features like enums, readonly properties, and match expressions. It covers the complete toolchain: PSR interoperability, Composer dependency management, static analysis configuration, and coding standards enforcement. Apply it whenever you're authoring, reviewing, or refactoring PHP code to ensure type safety and architectural correctness."},"files":[{"bytes":19077,"path":"templates/skills/php-specialist/SKILL.md","sha256":"c294aa5830aa9e67322b1f09ebdc50ff979494274842aa847ad60b9ca72f3608","url":"https://skillfed.io/files/Pixel-Process-UG/superkit-agents/php-specialist/277fadd9/SKILL.md"}],"id":"Pixel-Process-UG/superkit-agents/php-specialist","links":{"html":"https://skillfed.io/Pixel-Process-UG/superkit-agents/php-specialist","md":"https://skillfed.io/Pixel-Process-UG/superkit-agents/php-specialist.md","repo":"https://github.com/Pixel-Process-UG/superkit-agents"},"meta":{"agents_supported":[],"first_seen":"2026-07-28","forks":0,"language":"TypeScript","last_updated":"2026-03-16","license":"MIT","name":"php-specialist","publisher":"Pixel-Process-UG","stars":1},"relations":{"similar":[{"id":"Jeffallan/claude-skills/php-pro"},{"id":"irahardianto/awesome-agv/php-idioms"},{"id":"personamanagmentlayer/pcl/php-expert"},{"id":"netresearch/php-modernization-skill/php-modernization"},{"id":"AsyrafHussin/agent-skills/php-best-practices"},{"id":"softspark/ai-toolkit/php-rules"},{"id":"Goldziher/ai-rulez/php-conventions"},{"id":"xobotyi/cc-foundry/php"},{"id":"dirnbauer/webconsulting-skills/php-modernization"},{"id":"Mindrally/skills/php-development"}]},"slug":{"owner":"Pixel-Process-UG","repo":"superkit-agents","skill":"php-specialist"},"version":"277fadd9"}
