PHPackages                             patchlevel/event-sourcing-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. patchlevel/event-sourcing-phpstan-extension

ActivePhpstan-extension[Utility &amp; Helpers](/categories/utility)

patchlevel/event-sourcing-phpstan-extension
===========================================

PHPStan that understands your aggregates and catches event sourcing mistakes before runtime

1.2.0(2mo ago)147.7k↓58.4%[1 issues](https://github.com/patchlevel/event-sourcing-phpstan-extension/issues)[2 PRs](https://github.com/patchlevel/event-sourcing-phpstan-extension/pulls)MITPHPPHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Aug 13Pushed 3d ago2 watchersCompare

[ Source](https://github.com/patchlevel/event-sourcing-phpstan-extension)[ Packagist](https://packagist.org/packages/patchlevel/event-sourcing-phpstan-extension)[ Docs](https://github.com/patchlevel/event-sourcing-phpstan-extension)[ RSS](/packages/patchlevel-event-sourcing-phpstan-extension/feed)WikiDiscussions 1.3.x Synced today

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

[![Latest Stable Version](https://camo.githubusercontent.com/41831f0b9dca8dce09e401bd6ca6feb37453086ceb194984ed28656a44cd1ddc/68747470733a2f2f706f7365722e707567782e6f72672f70617463686c6576656c2f6576656e742d736f757263696e672d7068707374616e2d657874656e73696f6e2f76)](//packagist.org/packages/patchlevel/event-sourcing-phpstan-extension)[![License](https://camo.githubusercontent.com/3094614018c0a260abc1481df34d6887fd219a20bf0421c32bb1596fe94c205d/68747470733a2f2f706f7365722e707567782e6f72672f70617463686c6576656c2f6576656e742d736f757263696e672d7068707374616e2d657874656e73696f6e2f6c6963656e7365)](//packagist.org/packages/patchlevel/event-sourcing-phpstan-extension)

event-sourcing-phpstan-extension
================================

[](#event-sourcing-phpstan-extension)

"PHPStan that understands your aggregates and catches event sourcing mistakes before runtime."

Features
--------

[](#features)

- [Property initialization](https://patchlevel.dev/docs/event-sourcing-phpstan-extension/latest/getting-started#property-initialization) for aggregate roots and child aggregates, so PHPStan does not report false uninitialized property errors.
- [Recording in apply methods](https://patchlevel.dev/docs/event-sourcing-phpstan-extension/latest/getting-started#recording-in-apply-methods) is reported as an error, because recording events while replaying them leads to duplicated events.

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

[](#installation)

```
composer require --dev patchlevel/event-sourcing-phpstan-extension
```

Register the extension in your `phpstan.neon`:

```
includes:
    - vendor/patchlevel/event-sourcing-phpstan-extension/extension.neon
```

Documentation
-------------

[](#documentation)

- Latest [Docs](https://patchlevel.dev/docs/event-sourcing-phpstan-extension/latest)
- Related [Blog](https://patchlevel.dev/blog)

Integration
-----------

[](#integration)

- [patchlevel/event-sourcing](https://github.com/patchlevel/event-sourcing)

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

[](#contributing)

We are open to contributions as long as they are in line with our [BC-Policy](https://patchlevel.dev/our-backward-compatibility-promise).

Also note that the `composer.lock` is always generated with the newest supported PHP version as this is the version our tools run in the CI.

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance73

Regular maintenance activity

Popularity32

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 82.6% 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

Every ~46 days

Recently: every ~53 days

Total

8

Last Release

0d ago

Major Versions

1.1.x-dev → 2.0.x-dev2025-12-04

PHP version history (2 changes)1.0.0PHP ~8.1 || ~8.2 || ~8.3 || 8.4

1.1.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/470138?v=4)[David Badura](/maintainers/DavidBadura)[@DavidBadura](https://github.com/DavidBadura)

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (128 commits)")[![DanielBadura](https://avatars.githubusercontent.com/u/2017762?v=4)](https://github.com/DanielBadura "DanielBadura (15 commits)")[![DavidBadura](https://avatars.githubusercontent.com/u/470138?v=4)](https://github.com/DavidBadura "DavidBadura (12 commits)")

---

Tags

PHPStanevent sourcing

### Embed Badge

![Health badge](/badges/patchlevel-event-sourcing-phpstan-extension/health.svg)

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

###  Alternatives

[larastan/larastan

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

6.5k55.4M8.4k](/packages/larastan-larastan)[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.

4853.5M91](/packages/shipmonk-dead-code-detector)[ergebnis/phpstan-rules

Provides rules for phpstan/phpstan.

4579.8M286](/packages/ergebnis-phpstan-rules)[ticketswap/phpstan-error-formatter

A minimalistic error formatter for PHPStan

87718.9k56](/packages/ticketswap-phpstan-error-formatter)[timeweb/phpstan-enum

Enum class reflection extension for PHPStan

443.4M27](/packages/timeweb-phpstan-enum)[johnbillion/wp-compat

PHPStan extension to help verify that your PHP code is compatible with a given version of WordPress

25166.1k18](/packages/johnbillion-wp-compat)

PHPackages © 2026

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