php

Provide modern PHP 7.4+ patterns for types, attributes, enums, and dependency injection.

20|5|Updated Jan 5, 2026
One-click install
npx skills add https://github.com/miles990/claude-software-skills --skill php-miles990
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php
Source: https://github.com/miles990/claude-software-skills/tree/main/programming-languages/php
Command: npx skills add https://github.com/miles990/claude-software-skills --skill php-miles990

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides modern PHP (7.4+/8.x) patterns and best practices, enabling developers to write cleaner, more robust, and maintainable code.

Core Features & Use Cases

  • Modern Language Features: Demonstrates type systems, attributes, enums, and more.
  • Object-Oriented Design: Illustrates traits, interfaces, and abstract classes for better code organization.
  • Error Handling: Shows custom exceptions and the Result pattern for resilient applications.
  • Dependency Injection: Explains service containers and constructor injection for testable code.
  • Use Case: Refactor a legacy PHP codebase to incorporate modern features like typed properties and attributes for improved readability and maintainability.

Quick Start

Use the php skill to generate a basic composer.json file for a new project.

Frequently Asked Questions about php

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

FAQPage Schema
How do I implement the Result pattern for error handling in PHP?

The Result pattern for error handling in PHP allows methods to return success or failure objects instead of throwing exceptions directly. This Skill demonstrates custom exceptions and the Result pattern to build resilient applications with predictable control flow.

What's the best way to set up dependency injection in a PHP application?

Setting up dependency injection in a PHP application is best achieved using a service container for constructor injection. This Skill explains how to configure a simple container, ensuring your object-oriented code is fully testable and maintainable.

How do I refactor legacy PHP code to use modern OOP features like enums and attributes?

Refactoring legacy PHP code to use modern OOP features involves integrating typed properties, enums, and attributes for better readability. This Skill provides patterns for traits, interfaces, and abstract classes to improve code organization in PHP 7.4+ projects.

Does this PHP skill support modern type systems for versions 7.4 and above?

This PHP skill explicitly supports modern type systems for versions 7.4 and above. It demonstrates how to apply typed properties, return types, and parameter declarations to ensure robust and maintainable application development.

How do I generate a composer.json file for a new PHP project?

Generating a composer.json file for a new PHP project defines your dependencies and autoloading rules. This Skill facilitates quick starts by generating this configuration file to initialize your modern PHP application structure.

Can I use these PHP patterns with frameworks like Laravel or Symfony?

You can apply these PHP patterns with frameworks like Laravel or Symfony to standardize your application architecture. The Skill covers dependency injection, interfaces, and object-oriented design patterns that align directly with these frameworks' conventions.