PHPackages                             prooph/message-flow-analyzer - 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. prooph/message-flow-analyzer

ActiveLibrary

prooph/message-flow-analyzer
============================

Static code analyzer for prooph projects

v0.1.0(8y ago)302.9k4[6 issues](https://github.com/prooph/message-flow-analyzer/issues)[1 PRs](https://github.com/prooph/message-flow-analyzer/pulls)BSD-3-ClausePHP

Since Mar 5Pushed 6y ago6 watchersCompare

[ Source](https://github.com/prooph/message-flow-analyzer)[ Packagist](https://packagist.org/packages/prooph/message-flow-analyzer)[ Docs](http://getprooph.org/)[ RSS](/packages/prooph-message-flow-analyzer/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (10)Versions (3)Used By (0)

prooph message flow analyzer
============================

[](#prooph-message-flow-analyzer)

A static code analyzer to extract message flow of a prooph project

Installation
------------

[](#installation)

```
composer require --dev prooph/message-flow-analyzer
```

Configuration
-------------

[](#configuration)

The analyzer can be configured using a json file. By default the analyzer uses a `prooph_analyzer.json` located in the current working directory. An example of a default config can be found in the [test example project](https://github.com/prooph/message-flow-analyzer/blob/master/tests/Sample/DefaultProject/prooph_analyzer.json)

Run
---

[](#run)

```
php vendor/bin/prooph-analyzer project:analyze
```

Why?
----

[](#why)

The prooph message flow analyzer scans your project for prooph messages and collects information how these messages flow through your project source code :)

The analysis contains information about:

- commands, events, queries
- message handlers per message (command handler, event listner, process manager, ...)
- message producers per message (controller, cli commands, process manager, ...)
- event recorders per event (classes implementing prooph's AggregateRoot or using the EventProducerTrait)

The message flow is written to an output file (`prooph_message_flow.json` by default).

For now that's it. But imagine what you can do with this information! We'll add different output formatters to generate config for d3js or draw.io. The message flow analyzer will also be part of the upcoming `event-store-mgmt-ui` and will allow you to connect the message flow with your event streams for debugging and monitoring.

How?
----

[](#how)

The package uses the excellent libraries [roave/better-reflection](https://github.com/Roave/BetterReflection)and [nikic/php-parser](https://github.com/nikic/PHP-Parser) (which is used by Roave/BetterReflection internally, too)

WIP
---

[](#wip)

`prooph/message-flow-analyzer` and the `event-store-mgmt-ui` are work in progress. There is no roadmap defined yet. If you think your project could benefit from a stable version and you or your company would like to support development then [get in touch](http://getprooph.org/#get-in-touch).

Filters
-------

[](#filters)

You can add include and exclude filters for files and directories. `prooph/message-flow-analyzer` ships with some default filters. Check the linked example config above. The filter implementations can be found in the [Filter dir](https://github.com/prooph/message-flow-analyzer/tree/master/src/Filter)

ClassVisitors
-------------

[](#classvisitors)

Class visitors are called for every php class found in the project and not excluded by a filter. They take a `Roave\BetterReflection\Reflection\ReflectionClass` and the `Prooph\MessageFlowAnalyzer\MessageFlow` as input and if a visitor finds something interesting in the class it can add this information to the `MessageFlow`.

Again `prooph/message-flow-analyzer` ships with default class visitors (see example config) which can be found in the [Visitor dir](https://github.com/prooph/message-flow-analyzer/tree/master/src/Visitor).

Run it against proophessor-do
-----------------------------

[](#run-it-against-proophessor-do)

You can see `prooph/message-flow-analyzer` in action by running it against [proophessor-do](https://github.com/prooph/proophessor-do).

1. Clone proophessor-do
2. Add `prooph/message-flow-analyzer: dev-master` to the `require-dev` config of proophessor-do's `composer.json`
3. Run composer install
4. Copy [prooph\_analyzer.json](https://github.com/prooph/message-flow-analyzer/blob/master/tests/Sample/DefaultProject/prooph_analyzer.json) into root dir of proophessor-do
5. Copy [ExcludeBlacklistedFiles.php](https://gist.github.com/codeliner/6bae2c3a5de0a9f93e1d2143f7196f75#file-excludeblacklistedfiles-php) into `src/Infrastructure/ProophAnalyzer`. This is needed because proophessor-do contains a prepared factory for mongodb connection but mongo is not installed by default so the mongo classes cannot be loaded.
6. Add `"Prooph\\ProophessorDo\\Infrastructure\\ProophAnalyzer\\ExcludeBlacklistedFiles"` as last entry in the `prooph_analyzer.json` `fileInfoFilters` array.
7. Run `php vendor/bin/prooph-analyzer project:analyze` and watch the generated output file `prooph_message_flow.json`

If this is too much work right now and you only want to see the result: [prooph\_message\_flow.json](https://gist.github.com/codeliner/6bae2c3a5de0a9f93e1d2143f7196f75#file-prooph_message_flow-json)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

2993d ago

### Community

Maintainers

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

---

Top Contributors

[![basz](https://avatars.githubusercontent.com/u/143068?v=4)](https://github.com/basz "basz (5 commits)")[![kochen](https://avatars.githubusercontent.com/u/106042?v=4)](https://github.com/kochen "kochen (3 commits)")[![prolic](https://avatars.githubusercontent.com/u/394428?v=4)](https://github.com/prolic "prolic (2 commits)")[![enumag](https://avatars.githubusercontent.com/u/539462?v=4)](https://github.com/enumag "enumag (1 commits)")

---

Tags

messagingphp7proophstatic-code-analysisproophanalyzer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/prooph-message-flow-analyzer/health.svg)

```
[![Health](https://phpackages.com/badges/prooph-message-flow-analyzer/health.svg)](https://phpackages.com/packages/prooph-message-flow-analyzer)
```

###  Alternatives

[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[phan/phan

A static analyzer for PHP

5.6k11.2M1.1k](/packages/phan-phan)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M2.0k](/packages/behat-behat)[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

5953.3M56](/packages/roave-backward-compatibility-check)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[coenjacobs/mozart

Composes all dependencies as a package inside a WordPress plugin

4723.6M20](/packages/coenjacobs-mozart)

PHPackages © 2026

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