php

Enforce strict typing and PHPStan level 8 in PHP 8.2+ applications.

25|3|Updated Jul 14, 2026
One-click install
npx skills add https://github.com/nimadorostkar/Claude-Skills-collection --skill php-nimadorostkar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php
Source: https://github.com/nimadorostkar/Claude-Skills-collection/tree/main/skills/languages/php
Command: npx skills add https://github.com/nimadorostkar/Claude-Skills-collection --skill php-nimadorostkar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the common pitfalls of legacy PHP development by enforcing strict typing, modern language features, and rigorous static analysis to prevent runtime errors and technical debt.

Core Features & Use Cases

  • Strict Typing Enforcement: Mandates strict types and modern PHP 8.2+ features like readonly classes and enums.
  • Static Analysis Integration: Configures PHPStan at high levels to catch bugs before they reach production.
  • Use Case: When refactoring a legacy Laravel or Symfony codebase, use this skill to transition from loose array-based data structures to robust, immutable value objects and typed DTOs.

Quick Start

Apply the php skill to analyze the current directory and generate a strict PHPStan configuration file at level 8.

Frequently Asked Questions about php

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

FAQPage Schema
How do I enforce strict typing in a legacy PHP codebase?

Strict typing in a legacy PHP codebase is enforced by mandating strict types and adopting modern PHP 8.2+ features like readonly classes and enums, transitioning loose arrays into immutable value objects and typed DTOs.

What is the best way to configure PHPStan for Laravel and Symfony applications?

The best way to configure PHPStan for Laravel and Symfony applications is to set it at a high analysis level, such as level 8, to rigorously catch bugs and prevent runtime errors before they reach production.

Does this strict typing approach work with both Laravel and Symfony frameworks?

Yes, this strict typing approach works with both Laravel and Symfony frameworks, applying modern architectural patterns to improve maintainability and reduce runtime defects across these PHP codebases.

Why use immutable value objects and DTOs instead of arrays in PHP 8.2+?

Immutable value objects and DTOs are used instead of arrays in PHP 8.2+ to prevent runtime errors and technical debt, replacing loose array-based data structures with robust, type-safe alternatives for better maintainability.

How do I start applying PSR standards and static analysis to an existing PHP project?

To start applying PSR standards and static analysis to an existing PHP project, analyze the current directory to generate a strict PHPStan configuration file at level 8, ensuring consistent code quality and adherence to PSR standards.