Analyse With Phpstan
Analyse code for potential PHP errors and bugs using Phpstan, improving code quality and preventing runtime issues.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add analyse-with-phpstan npx -- -y @trustedskills/analyse-with-phpstan
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"analyse-with-phpstan": {
"command": "npx",
"args": [
"-y",
"@trustedskills/analyse-with-phpstan"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill uses PHPStan, a static analysis tool for PHP. It analyzes your codebase to detect bugs and errors without actually running the code. This helps improve code quality by identifying potential issues like unused variables, unreachable statements, and type inconsistencies. The skill provides detailed reports highlighting these problems.
When to use it
- Code Review: Integrate into a CI/CD pipeline to automatically check for coding standards violations before merging changes.
- Bug Prevention: Proactively identify potential errors early in the development cycle.
- Refactoring: Gain confidence when refactoring code by ensuring no new issues are introduced.
- Learning PHP: Understand common pitfalls and best practices through analysis feedback.
Key capabilities
- Static Analysis of PHP Code
- Bug Detection
- Error Reporting
- Coding Standards Enforcement
Example prompts
- "Analyze this PHP file for potential errors:
path/to/my_file.php" - "Run a static analysis on my project and report any type inconsistencies."
- "Check this code snippet for unused variables:
[code snippet]"
Tips & gotchas
- Requires a working PHP environment with PHPStan installed.
- The accuracy of the analysis depends on the complexity of the codebase and the configuration of PHPStan.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.