PHP Tooling

Manage PHP dependency, code quality, and debugging workflows.

51|6|Updated Mar 28, 2019
One-click install
npx skills add https://github.com/Mte90/dotfiles --skill php-tooling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: PHP Tooling
Source: https://github.com/Mte90/dotfiles/tree/main/.config/opencode/skills/php/tooling
Command: npx skills add https://github.com/Mte90/dotfiles --skill php-tooling

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses common challenges in PHP development by enforcing best practices for dependency management, code quality, and debugging, leading to more robust and maintainable codebases.

Core Features & Use Cases

  • Dependency Management: Ensures consistent environments through committed composer.lock files.
  • Code Quality: Enforces PSR-4 autoloading standards and automates linting with PHP CS Fixer.
  • Static Analysis: Integrates PHPStan for early detection of bugs and potential issues.
  • Debugging: Promotes the use of Xdebug for efficient profiling over var_dump.
  • Use Case: A developer can use this Skill to automatically set up a new PHP project, ensuring all quality and debugging tools are configured correctly from the start, and that dependencies are managed reliably.

Quick Start

Use the PHP Tooling skill to analyze the current project's code quality.

Frequently Asked Questions about PHP Tooling

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

FAQPage Schema
How do I set up PHPStan and PHP CS Fixer for a new PHP project?

To set up PHPStan and PHP CS Fixer, you use Composer to install them as dependencies. This standardizes your project structure with PSR-4 autoloading, integrates static analysis for early bug detection, and automates code linting.

What is the best way to manage PHP dependencies and avoid anti-patterns?

Managing PHP dependencies effectively requires using Composer and committing the composer.lock file to ensure consistent environments. You must avoid anti-patterns such as manually including dependencies or checking the vendor directory into version control.

Why should I use Xdebug instead of var_dump for PHP debugging?

You should use Xdebug instead of var_dump because Xdebug provides efficient profiling capabilities for your PHP applications. Using Xdebug prevents anti-patterns like manual var_dump debugging, leading to more robust and maintainable codebases.

Does PHP static analysis catch bugs before runtime?

Yes, PHP static analysis catches bugs before runtime by integrating tools like PHPStan into your workflow. PHPStan analyzes your code statically to detect potential issues early, enforcing code quality and best practices.

Can I enforce PSR-4 autoloading standards automatically?

Yes, you can enforce PSR-4 autoloading standards automatically by configuring your PHP project structure through Composer. This standardization ensures consistent dependency management and integrates with automated linting tools like PHP CS Fixer.