php-modernization

Modernize legacy PHP applications to PHP 8.x with type safety and static-analysis readiness.

33|6|Updated Jan 2, 2026
One-click install
npx skills add https://github.com/dirnbauer/webconsulting-skills --skill php-modernization-dirnbauer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-modernization
Source: https://github.com/dirnbauer/webconsulting-skills/tree/main/skills/php-modernization
Command: npx skills add https://github.com/dirnbauer/webconsulting-skills --skill php-modernization-dirnbauer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams modernize legacy PHP applications to PHP 8.x, ensuring stronger type safety, improved maintainability, and compatibility with modern tools.

Core Features & Use Cases

  • Modernization Patterns: Adopt constructor property promotion, readonly classes, unions, and attributes to simplify code and reduce boilerplate.
  • Static Analysis & Standards: Enforce PHPStan level 10, Rector transformations, and PHP-CS-Fixer rules to maintain code quality.
  • Migration Guidance: Provides a structured approach to upgrading projects across PHP 8.2–8.4, DTO/VO patterns, and PSR/PER compliance.
  • Use Case: Example: upgrade a legacy class to use constructor property promotion and typed properties, then validate with PHPStan.

Quick Start

Run the PHP modernization skill on a sample legacy class to convert to PHP 8.x style and run static analysis.

Frequently Asked Questions about php-modernization

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

FAQPage Schema
How do I modernize a legacy PHP application to PHP 8.x?

Modernizing legacy PHP applications to PHP 8.x involves adopting constructor property promotion, readonly classes, unions, and attributes to reduce boilerplate. This skill provides structured migration guidance and automated tooling for safe, scalable upgrades.

What is the best way to enforce type safety and static analysis in PHP?

Enforcing type safety and static analysis in PHP involves configuring PHPStan level 10, Rector transformations, and PHP-CS-Fixer rules. This ensures strong type safety, improved maintainability, and compatibility with modern tools.

Can I use constructor property promotion and readonly classes when upgrading to PHP 8.4?

Yes, upgrading to PHP 8.4 supports using constructor property promotion and readonly classes. This skill targets legacy projects needing upgrade guidance across PHP 8.2–8.4, enabling you to simplify code and reduce boilerplate safely.

How do I migrate legacy PHP classes to DTO and VO patterns?

Migrating legacy PHP classes to DTO and VO patterns involves adopting modern language features like typed properties and readonly classes. This skill provides a structured approach to upgrading projects with DTO/VO patterns and PSR/PER compliance.

Does PHP modernization work with automated tools like Rector and PHP-CS-Fixer?

PHP modernization works effectively with automated tools like Rector and PHP-CS-Fixer. This skill codifies requirements for upgrading via Rector transformations and PHP-CS-Fixer settings to maintain code quality and enforce PHPStan level 10.