phpstan

Enforce PHPStan Level 9 static analysis with strict typing on PHP projects.

3|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/codebar-ag/coding-guidelines --skill phpstan-codebar-ag
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phpstan
Source: https://github.com/codebar-ag/coding-guidelines/tree/main/resources/boost/skills/phpstan
Command: npx skills add https://github.com/codebar-ag/coding-guidelines --skill phpstan-codebar-ag

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PHP projects often suffer from undetected type errors and weak typing discipline; PHPStan enforces strict typing to catch issues at development time.

Core Features & Use Cases

  • Enforces Level 9 PHPStan rules with strict typing across codebase.
  • Requires explicit parameter/return/property types and discourages untyped signatures.
  • Useful for CI pipelines, Laravel projects, and backend services to prevent runtime errors and improve code quality.

Quick Start

Run PHPStan at Level 9 on your codebase to start catching type issues immediately.

Frequently Asked Questions about phpstan

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

FAQPage Schema
How do I enforce strict typing in a PHP project to catch type errors before runtime?

Static analysis with PHPStan enforces strict typing in PHP projects by validating types, signatures, and PHPDoc accuracy at development time to prevent runtime errors. Running PHPStan at Level 9 catches type issues immediately across modules, tests, and services.

Can I use PHPStan static analysis for a Laravel backend codebase?

Yes, PHPStan static analysis applies to Laravel backends and general PHP projects to validate types and signatures. It enforces Level 9 rules across modules and services, ensuring code quality and preventing runtime errors in Laravel applications.

What PHPStan level is required to enforce strict parameter and return types?

PHPStan Level 9 is required to enforce strict typing for parameters, return types, and properties. This level discourages untyped signatures and requires explicit type handling across the entire PHP codebase to achieve maximum code quality.

How do I handle untyped signatures when running PHPStan static analysis?

To handle untyped signatures during PHPStan static analysis, you must declare explicit parameter, return, and property types. If specific suppressions are necessary, PHPStan requires explicit handling of those suppressions rather than leaving signatures untyped.

Does PHPStan check PHPDoc accuracy across PHP modules and services?

Yes, PHPStan validates PHPDoc accuracy across PHP modules, tests, and services. By enforcing strict typing and checking PHPDoc alongside signatures, it ensures documentation matches actual code types to prevent undetected type errors.

Why should I use static analysis instead of waiting for PHP runtime errors?

Static analysis eliminates undetected type errors and weak typing discipline by catching issues at development time. Validating types and signatures with PHPStan before runtime prevents runtime errors and improves overall code quality in CI pipelines.