php-docstring

Generate PSR-5/PSR-19 compliant PHPDoc blocks with @param, @return, and @throws tags for PHP classes, methods, functions, and properties.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/LounisBou/claude-code --skill php-docstring
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-docstring
Source: https://github.com/LounisBou/claude-code/tree/main/skills-available/php/php-docstring
Command: npx skills add https://github.com/LounisBou/claude-code --skill php-docstring

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PHP projects often lack consistent, machine-readable documentation. This skill automates the creation of PHPDoc blocks that follow PSR-5 and PSR-19, improving maintainability and tooling support.

Core Features & Use Cases

  • Generate docblocks for classes, methods, functions, and properties with @param, @return, and @throws tags.
  • Enforce PSR-5 and PSR-19 conventions across PHP codebases.
  • Support type annotations and IDE-friendly documentation to aid static analysis and API docs.

Quick Start

Generate a PHPDoc block for a given PHP class, method, or function following PSR-5 and PSR-19.

Frequently Asked Questions about php-docstring

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

FAQPage Schema
How do I generate PSR-5 compliant PHPDoc blocks for my classes and methods?

Generate PSR-5 compliant PHPDoc blocks by targeting a specific PHP class, method, or function. This process enforces proper DocBlock structure and automatically includes necessary tags like @param, @return, and @throws to ensure machine-readable documentation.

What is the best way to automate PHP code documentation for static analysis?

Automating PHP code documentation relies on generating PSR-5 and PSR-19 compliant DocBlocks. By automatically adding type annotations and IDE-friendly tags, the generated documentation directly supports static analysis tools and improves overall code maintainability.

How do I add @param and @return tags to PHP functions automatically?

Add @param and @return tags to PHP functions automatically by generating standardized PHPDoc blocks. This targets individual functions or methods to enforce PSR-5 conventions, ensuring accurate type annotations for parameters and return values.

Does this PHP documentation approach support PSR-19 type annotations?

Yes, this PHP documentation approach fully supports PSR-19 type annotations. It generates structured PHPDoc blocks that include proper type declarations for parameters, return values, and exceptions, ensuring compatibility with modern PHP tooling and static analysis.

When do I need to generate PHPDoc blocks for properties and exceptions?

Generate PHPDoc blocks for properties and exceptions when you need consistent, machine-readable documentation across your PHP project. This enforces PSR-5 structure, adding specific tags like @throws and type annotations to improve code quality and tooling support.