Php Modernization
This skill automatically modernizes PHP codebases by upgrading to newer versions and best practices, boosting performance & security.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add php-modernization npx -- -y @trustedskills/php-modernization
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"php-modernization": {
"command": "npx",
"args": [
"-y",
"@trustedskills/php-modernization"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill modernizes PHP applications by automatically upgrading them to PHP 8.x versions and implementing best practices. It focuses on incorporating type safety, adhering to PSR/PER compliance standards, and utilizing static analysis tools like PHPStan, PHPat, Rector, and PHP-CS-Fixer. The goal is to improve performance and security through code modernization.
When to use it
- You need to upgrade a legacy PHP codebase to a newer version (PHP 8.x).
- Your project requires adherence to PSR/PER coding standards.
- You want to improve the type safety of your application by using DTOs instead of arrays.
- You're looking for automated code modernization and static analysis capabilities.
Key capabilities
- Upgrades PHP applications to version 8.x.
- Implements PSR/PER compliance (PSR-3/4/6/7/11/14/15/16/17/18/20, PER-CS).
- Utilizes static analysis tools: PHPStan (level 9+), PHPat, Rector, and PHP-CS-Fixer.
- Promotes the use of DTOs over arrays for structured data.
- Implements backed enums instead of constants where appropriate.
Example prompts
- "Modernize this PHP project to version 8.x."
- "Check this code for PSR compliance and fix any issues."
- "Run static analysis on my codebase using PHPStan level 9."
- "Convert arrays to DTOs in this file."
Tips & gotchas
- PHPStan requires a minimum level of 9, with level 10 being recommended.
- PHPat is required for projects with defined architectures.
- Always run
vendor/bin/php-cs-fixer fix --dry-run 2>&1 | grep -A 20 "Detected deprecations"to check for deprecated rules before applying changes.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.