php

Enforce strict typing, formatting, and error handling in PHP files.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

General PHP coding standards covering strict typing, formatting, control flow, and error handling. Applies to all PHP files in the application.

Core Features & Use Cases

  • Enforces strict typing across parameters, return types, and properties
  • Promotes modern PHP practices: union types, nullable types, and immutability
  • Aligns with tooling conventions: PHPStan Level 9, Laravel Pint, and one-class-per-file structure

Quick Start

Apply these PHP conventions to all PHP files in your project to start enforcing standards immediately.

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 and PHPStan level 9 compliance in my Laravel project?

To enforce strict typing and PHPStan level 9 compliance, apply standardized PHP coding conventions across all Laravel files. This enforces strict parameter and return types, ensures PHPStan level 9 compliance, and guides modern typing practices.

What is the best way to standardize PHP formatting and reduce nested conditionals in PHP files?

The best way to standardize PHP formatting and reduce nested conditionals is to enforce Laravel Pint formatting alongside guard clauses. This standardizes control flow by flattening nested conditionals and applying consistent formatting rules across PHP files.

How do I set up PHP coding conventions for union types and a single-class-per-file structure?

To set up PHP coding conventions for union types and a single-class-per-file structure, apply strict typing rules across your codebase. This enforces modern PHP practices including union types, nullable types, and immutability while restricting files to one class each.

Does this PHP standardization approach work with existing Laravel components and files?

Yes, this PHP standardization approach works with existing Laravel components and files. It applies to all PHP files across PHP projects, enforcing strict typing, formatting, control flow, and error handling within your Laravel components.

Why should I use guard clauses instead of nested conditionals for PHP error handling?

You should use guard clauses instead of nested conditionals to reduce complexity and improve error handling in PHP. Guard clauses flatten control flow by handling edge cases early, making your code conventions stricter and easier to maintain.