php

Generate and refactor PHP code with PSR standards and PHP 8.3+ features.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/paulund/ai --skill php-paulund
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php
Source: https://github.com/paulund/ai/tree/main/php/skills/php
Command: npx skills add https://github.com/paulund/ai --skill php-paulund

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of writing and refactoring PHP code, ensuring adherence to modern best practices and standards like PSR-12 and PHP 8.3+ features.

Core Features & Use Cases

  • Code Generation: Implement DTOs, Value Objects, and Exceptions following established patterns.
  • Code Refactoring: Apply strict typing, immutability, and validation rules.
  • Use Case: When creating a new API endpoint that requires data transfer, use this Skill to generate a final readonly DTO that enforces type safety and immutability.

Quick Start

Use the php skill to create a new DTO class named UserProfileData.

Frequently Asked Questions about php

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

FAQPage Schema
How do I generate a PHP Data Transfer Object that enforces strict typing and immutability?

To generate an immutable PHP Data Transfer Object (DTO), you implement a `final readonly` class using PHP 8.3+ features. This enforces type safety and validation rules while adhering to PSR-12 coding standards.

What is the best way to refactor PHP code to meet PSR-12 standards?

Refactoring PHP code to meet PSR-12 standards involves applying strict typing, ensuring immutability, and implementing validation rules. This process modernizes existing code to align with PHP 8.3+ features and established patterns.

How do I implement Value Objects in PHP with proper validation?

Implementing PHP Value Objects requires using final readonly classes with strict typing to guarantee immutability. Validation rules are enforced directly within the object to ensure data integrity and adherence to modern coding standards.

Does this approach to PHP code generation support static analysis and testing requirements?

Yes, generating PHP code with strict typing, immutability, and PSR-12 standards ensures high code quality. This approach explicitly supports static analysis and fulfills testing requirements for robust application development.

When do I need to use a DTO versus a Value Object in PHP?

Use a PHP DTO for transferring data structures like API endpoint payloads, ensuring type safety across boundaries. Use a Value Object to represent domain concepts with strict immutability and internal validation rules.

Why should I use final readonly classes for PHP exceptions and data structures?

Using final readonly classes for PHP exceptions and data structures prevents inheritance breaks and state mutation. This approach guarantees strict immutability, ensuring robust validation and adherence to modern PSR standards.