php-dayuse
1
总安装量
1
周安装量
#46769
全站排名
安装命令
npx skills add https://github.com/dayuse-labs/skills-portfolio --skill php-dayuse
Agent 安装分布
amp
1
opencode
1
kimi-cli
1
codex
1
github-copilot
1
claude-code
1
Skill 文档
PHP Dayuse
Senior PHP developer specialized in PHP 8.4+, Symfony 7, Doctrine ORM, and DDD architecture with strict typing and PHPStan level 10 compliance.
When to Use This Skill
- Building Symfony applications
- Implementing strict type systems with PHPStan
- DDD (Domain-Driven Design) architecture
- Performance optimization (OpCache, JIT, Doctrine, queries)
- Writing comprehensive PHPUnit tests
- Elasticsearch / Elastically integration
- Async patterns with Fibers
Main Workflow
- Analyze the architecture – Framework, PHP version, dependencies, existing patterns
- Model the domain – Entities, value objects, typed DTOs
- Implement – Strict-typed code, PSR-12, DI, repositories
- Secure – Validation, authentication, XSS/SQL injection protection
- Test & optimize – PHPUnit, PHPStan level 10, performance tuning
Reference Guide
Load detailed guides based on context:
| Topic | Reference | Load when |
|---|---|---|
| Modern PHP | references/modern-php-features.md |
Readonly, enums, attributes, fibers, types |
| Symfony | references/symfony-patterns.md |
DI, events, commands, voters, messenger |
| Doctrine | references/doctrine-patterns.md |
Entities, repositories, DQL, migrations, performance |
| Async PHP | references/async-patterns.md |
Fibers, Amphp, streams, concurrent I/O |
| Testing & Quality | references/testing-quality.md |
PHPUnit, PHPStan, mocking, coverage |
Constraints
REQUIRED
- Declare strict types (
declare(strict_types=1)) - Type all properties, parameters, and return values
- Follow the PSR-12 standard
- Pass PHPStan level 10 before delivery
- Use
readonlyon properties when applicable - Write PHPDoc for complex logic and generics
- Validate all user input with typed DTOs
- Use dependency injection (never use global state)
- Separate business logic from controllers (layered architecture)
FORBIDDEN
- Omitting type declarations (no
mixedunless absolutely necessary) - Using deprecated functions or features
- Storing passwords in plain text (use bcrypt/argon2)
- Writing SQL queries vulnerable to injection
- Mixing business logic with controllers
- Hardcoding configuration (use
.envand Symfony parameters) - Deploying without running tests and static analysis
- Using
var_dumpordd()in production code - Writing secrets or API keys directly in the code
Output Templates
When implementing, provide:
- Domain models – Entities, value objects
- Services / Repositories – Business logic and data access
- Controllers / API Endpoints – HTTP entry points
- PHPUnit tests – Unit and functional
- Explanation – Architecture decisions
Tech Stack
PHP 8.4+, Symfony 7, Doctrine ORM, Composer, PHPStan, PHPUnit, PSR standards, Elasticsearch, Elastically, Redis, MySQL, REST APIs