matesofmate/phpstan-extension

PHPStan extension for Symfony AI Mate providing AI assistants with efficient static analysis tools

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:symfony-ai-mate

pkg:composer/matesofmate/phpstan-extension

dev-main / 0.1.x-dev 2026-01-11 20:57 UTC

This package is auto-updated.

Last update: 2026-01-11 21:06:00 UTC


README

Token-optimized PHPStan static analysis tools for AI assistants. This extension provides MCP (Model Context Protocol) tools that execute PHPStan analysis and return results in TOON (Token-Oriented Object Notation) format, achieving ~67% token reduction compared to raw PHPStan JSON output.

Features

  • Static analysis efficiently - Analyze entire project, specific files, or paths
  • TOON format output - ~67% token reduction vs. raw PHPStan JSON output using helgesverre/toon
  • Multiple output modes - Choose between toon, summary, detailed, by-file, or by-type formats
  • Auto-configuration - Automatically detects phpstan.neon, phpstan.neon.dist, phpstan.dist.neon
  • Fast execution - Direct Symfony Process integration with current PHP binary
  • Message truncation - Smart message shortening using common package utilities

Note: Git diff analysis tool (phpstan-analyse-diff) will be implemented in a future release.

Installation

composer require --dev matesofmate/phpstan-extension
vendor/bin/mate discover

The extension is automatically enabled by Symfony AI Mate.

Development

Quality Commands

# Run tests
composer test

# Check code quality (PHPStan level 8, PHP CS Fixer, Rector)
composer lint

# Auto-fix code style and apply refactorings
composer fix

Requirements

  • PHP 8.2 or higher
  • PHPStan 2.0 or higher (installed in your project)
  • Symfony AI Mate 0.1 or higher

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

License

MIT License - see LICENSE file for details.

Resources

"Because every Mate needs Mates"