PHPackages                             matesofmate/phpstan-extension - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. matesofmate/phpstan-extension

ActiveSymfony-ai-mate[Testing &amp; Quality](/categories/testing)

matesofmate/phpstan-extension
=============================

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

0.1.0(3mo ago)0809↓36.1%MITPHPPHP &gt;=8.2CI failing

Since Jan 26Pushed 3mo agoCompare

[ Source](https://github.com/MatesOfMate/phpstan-extension)[ Packagist](https://packagist.org/packages/matesofmate/phpstan-extension)[ RSS](/packages/matesofmate-phpstan-extension/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (9)Versions (2)Used By (0)

PHPStan Extension for Symfony AI Mate
=====================================

[](#phpstan-extension-for-symfony-ai-mate)

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
--------

[](#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](https://github.com/HelgeSverre/toon-php)
- **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
------------

[](#installation)

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

The extension is automatically enabled by Symfony AI Mate.

Development
-----------

[](#development)

### Quality Commands

[](#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
------------

[](#requirements)

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

Contributing
------------

[](#contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](https://github.com/MatesOfMate/.github/blob/main/CONTRIBUTING.md) for details.

License
-------

[](#license)

MIT License - see [LICENSE](LICENSE) file for details.

Resources
---------

[](#resources)

- [Symfony AI Mate Documentation](https://symfony.com/doc/current/ai/components/mate.html)
- [PHPStan Documentation](https://phpstan.org/)
- [TOON Format Specification](https://github.com/HelgeSverre/toon-php)
- [MatesOfMate Organization](https://github.com/matesofmate)

---

*"Because every Mate needs Mates"*

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance79

Regular maintenance activity

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

112d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e43a10984e8ee1687abaac86c26311c6a607b9560e8a3cc3193f8245751618bc?d=identicon)[wachterjohannes](/maintainers/wachterjohannes)

---

Top Contributors

[![wachterjohannes](https://avatars.githubusercontent.com/u/1464615?v=4)](https://github.com/wachterjohannes "wachterjohannes (11 commits)")

---

Tags

symfonyPHPStanstatic analysismcpaiai assistantmate

###  Code Quality

TestsPHPUnit

Static AnalysisRector

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/matesofmate-phpstan-extension/health.svg)

```
[![Health](https://phpackages.com/badges/matesofmate-phpstan-extension/health.svg)](https://phpackages.com/packages/matesofmate-phpstan-extension)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[ekino/phpstan-banned-code

Detected banned code using PHPStan

2925.6M92](/packages/ekino-phpstan-banned-code)[shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.

3462.2M52](/packages/shipmonk-dead-code-detector)[staabm/phpstan-dba

2912.3M2](/packages/staabm-phpstan-dba)[staabm/phpstan-todo-by

1991.8M55](/packages/staabm-phpstan-todo-by)[shipmonk/phpstan-rules

Various extra strict PHPStan rules we found useful in ShipMonk.

1491.7M114](/packages/shipmonk-phpstan-rules)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
