php-pro

Implements strict-typed PHP 8.3+ applications with Laravel, Symfony, and PHPStan level 9 verification.

Updated May 23, 2026
One-click install
npx skills add https://github.com/Oatse/CWE-Automation --skill php-pro-oatse
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-pro
Source: https://github.com/Oatse/CWE-Automation/tree/main/.agents/skills/php-pro
Command: npx skills add https://github.com/Oatse/CWE-Automation --skill php-pro-oatse

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing modern PHP that passes strict static analysis and follows PSR standards requires deep knowledge of PHP 8.3+ features, framework conventions, and testing practices. This Skill guides the AI to produce strict-typed, enterprise-style PHP code with typed DTOs, dependency injection, and verified test coverage. ## Core Features & Use Cases - Modern PHP Implementation: Generates code using readonly classes, enums, attributes, fibers, match expressions, and first-class callables with declare(strict_types=1) everywhere. - Framework Patterns: Provides Laravel patterns (services, repositories, form requests, API resources, jobs, events) and Symfony patterns (DI configuration, attribute controllers, voters, Messenger handlers, console commands). - Async PHP: Covers Swoole servers and coroutines, ReactPHP event loops and promises, Amphp, and native fibers for concurrent applications. - Quality Enforcement: Runs PHPStan level 9 and PHPUnit/Pest with 80%+ coverage requirements before delivery. - Use Case: Ask it to build a REST API endpoint for user registration, and it delivers a typed DTO, a service class with constructor DI, a controller, and a PHPUnit test that passes PHPStan level 9. ## Quick Start Use the php-pro skill to create a Laravel user registration endpoint with a typed DTO, service layer, and PHPUnit tests that pass PHPStan level 9.

Frequently Asked Questions about php-pro

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write strict-typed PHP code that passes PHPStan level 9?

Declare strict_types=1 in every file, add type hints to all properties, parameters, and return values, and avoid mixed types. Run vendor/bin/phpstan analyse --level=9 and fix all reported errors before delivery, using generics annotations like @extends EntityRepository<User> where needed.

How to structure a Laravel application with services and repositories?

Place business logic in service classes under app/Services with constructor-injected repository interfaces, keep controllers thin by delegating to services, and validate input with form requests that convert to typed DTOs. Return API responses through JSON resources for consistent formatting.

Swoole vs ReactPHP for async PHP applications?

Swoole is a PHP extension offering built-in coroutines, HTTP servers, and WebSockets with very high performance. ReactPHP is pure PHP using an event loop and promises, requiring no extension, which makes it easier to install but generally slower than Swoole.

Does PHP 8.3 support readonly classes and enums?

Yes. Readonly classes arrived in PHP 8.2 and readonly properties in 8.1, while backed enums with methods were added in PHP 8.1. PHP 8.3 builds on these with typed class constants and other refinements.

Should I use PHPUnit or Pest for PHP testing?

PHPUnit is the established standard with class-based tests, data providers, and MockObject integration. Pest offers a closure-based syntax with expect() assertions built on PHPUnit, suiting teams that prefer concise, readable test definitions.

What are the limitations of PHP fibers for async code?

Fibers provide cooperative concurrency but do not make blocking I/O non-blocking by themselves; calls like sleep or standard MySQL queries still block. They need an event loop or framework like Amphp to achieve true asynchronous execution.