Browse / Developer Tools / PHP Modernization

PHP Modernization

Modernizes legacy PHP applications to versions 8.1+ by implementing type safety, strict typing, and high-level PHPStan compliance.

SkillDeveloper ToolsLanguage Other

The source repository doesn't declare a license. Check its terms before reusing the code.

Key features

  • Advanced PHP 8.x feature adoption including constructor promotion and readonly classes
  • Generic collection typing via PHPDoc and ArrayTypeHelper patterns
  • Type safety enforcement and PHPStan level 9+ compliance strategies
  • Comprehensive migration checklists and anti-pattern identification
  • Modern Symfony architectural patterns and service configuration

Use cases

  • Refactoring an existing codebase to achieve high-level PHPStan static analysis
  • Upgrading a legacy PHP 7.x application to PHP 8.2 or 8.3
  • Migrating Symfony configurations from YAML to modern PHP-based definitions

FAQ

How does this skill improve my developer workflow?

By providing Claude with context-specific patterns like the ArrayTypeHelper and generic collection typing, it ensures that AI-generated refactors are not just functional, but also type-safe and compliant with modern static analysis tools, reducing manual review time.

What does the PHP Modernization skill do?

This skill equips Claude with specialized patterns and checklists to upgrade legacy PHP codebases to modern standards (PHP 8.1, 8.2, and 8.3). It focuses on implementing strict typing, adopting modern syntax like constructor property promotion, and ensuring high-level static analysis compliance.

Does it support specific PHP frameworks?

Yes, it includes deep expertise in modern Symfony architectural patterns, service configuration (converting YAML to PHP), and PSR-14 event handling. It also includes specific tags and logic compatible with TYPO3 environments.

When should I use this skill?

Use this skill when performing version upgrades, refactoring legacy components, or preparing a project for PHPStan level 9. It is particularly effective for teams moving away from outdated annotations toward PHP 8 attributes and those modernizing Symfony-based applications.

What capabilities does it provide for static analysis?

The skill includes specific configurations and coding patterns designed to achieve PHPStan level 9+ compliance. This includes strategies for handling generics via PHPDoc, documenting complex array shapes, and eliminating 'mixed' type erosion.