PHP 8.2+ with PHPStan & PSR Standards

Enforce PHP 8.2+ standards, PSR compliance, and PHPStan static analysis.

115|8|Updated Mar 30, 2025
One-click install
npx skills add https://github.com/Goldziher/spikard --skill php-8-2-with-phpstan-psr-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: PHP 8.2+ with PHPStan & PSR Standards
Source: https://github.com/Goldziher/spikard/tree/main/.ai-rulez/skills/php-8-2-phpstan
Command: npx skills add https://github.com/Goldziher/spikard --skill php-8-2-with-phpstan-psr-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill ensures high-quality, maintainable PHP code by enforcing modern standards, strict typing, and comprehensive static analysis, reducing bugs and improving developer productivity.

Core Features & Use Cases

  • Modern PHP: Leverages PHP 8.2+ features and strict typing.
  • Type Safety: Uses ext-php-rs for safe Rust FFI bindings.
  • Code Quality: Enforces PSR standards, PHPStan level max, and strict coding practices.
  • Dependency Management: Uses Composer with locked dependencies.
  • Testing: Integrates PHPUnit with high coverage requirements.
  • Use Case: Develop a new microservice API in PHP, ensuring all code adheres to strict quality and type-safety standards from the outset.

Quick Start

Initialize a new PHP project using Composer and configure PHPStan for static analysis.

Frequently Asked Questions about PHP 8.2+ with PHPStan & PSR Standards

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

FAQPage Schema
How do I enforce strict typing and PSR standards in a PHP 8.2 project?

To enforce strict typing and PSR standards in PHP 8.2, use static analysis with PHPStan at max level alongside Composer dependency management. This ensures robust, type-safe backend development with reduced bugs.

Can I use Rust FFI bindings with PHP for secure backend development?

Yes, you can facilitate secure and type-safe FFI with Rust in PHP using ext-php-rs. This approach allows you to leverage Rust bindings while maintaining robust backend development standards.

What is the best way to configure PHPStan for static analysis in a new microservice API?

The best way to configure PHPStan for a new microservice API is to initialize your PHP project using Composer and set PHPStan to max level. This enforces comprehensive static analysis and strict coding practices from the outset.

Does PHPStan level max require Composer for dependency management?

Yes, comprehensive static analysis using PHPStan level max relies on Composer for dependency management. Composer ensures locked dependencies are used, which is essential for maintaining high-quality, maintainable PHP code.

How do I set up PHPUnit with high coverage requirements in PHP 8.2?

To set up PHPUnit with high coverage requirements in PHP 8.2, integrate it with your Composer-managed project. This ensures all code adheres to strict quality and type-safety standards during robust backend development.