PHPackages                             leovie/phpstan-baseline-guard - 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. leovie/phpstan-baseline-guard

ActiveLibrary[Testing &amp; Quality](/categories/testing)

leovie/phpstan-baseline-guard
=============================

Prevent your phpstan baseline from growing

v1.0.2(3y ago)18MITPHPPHP &gt;=8.1

Since Jan 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/LeoVie/phpstan-baseline-guard)[ Packagist](https://packagist.org/packages/leovie/phpstan-baseline-guard)[ RSS](/packages/leovie-phpstan-baseline-guard/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (8)Versions (8)Used By (0)

phpstan-baseline-guard
======================

[](#phpstan-baseline-guard)

The wonderful static analysis tool [PHPStan](https://phpstan.org/) has a [baseline feature](https://phpstan.org/user-guide/baseline). With that, you can generate a file containing all existing errors in your code. These errors than get ignored in further runs of PHPStan.

Using the baseline feature, you can make sure, that every new code you introduce can get analyzed on a high PHPStan level without having to fix all errors in your existing (legacy) code first.

You typically do not want to add more errors to you baseline, once generated. `phpstan-baseline-guard` is a small tool to make sure, you do not do that.

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

[](#installation)

Install via Composer

```
composer require --dev leovie/phpstan-baseline-guard
```

Usage
-----

[](#usage)

Given, you have generated a PHPStan baseline file `/foo/baseline.neon`

1. Run `phpstan-baseline-guard` with only the absolute path to your baseline file, e.g.

```
phpstan-baseline-guard /foo/baseline.neon
```

You will get an output like

```
 [INFO] Your baseline contains 20 ignored errors.
```

2. Use the count of ignored errors from the first command run and run `phpstan-baseline-guard` with a fixed max count of ignored errors in the baseline, e.g.

```
phpstan-baseline-guard /foo/baseline.neon --max-ignored-errors=20
```

You will get an output like

```
 [INFO] Your baseline contains 20 ignored errors. - OK
```

Now, if you add more ignored errors to your baseline and run the same command again, you will get an output like

```
 [ERROR] Your baseline contains 25 ignored errors. - That's more than allowed.
```

The command fails in that case and prevents you from adding more errors to your baseline file than you explicitly allow.

### CI

[](#ci)

You can add `phpstan-baseline-guard` to your CI pipeline. The command will fail, when a developer tries to add more ignored errors to the baseline.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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

Every ~15 days

Recently: every ~22 days

Total

7

Last Release

1163d ago

Major Versions

v0.1.3 → v1.0.02023-01-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/876f842b58e2a0e54d85eddfb8ed1b599586e94d9071efaddd208383ea85932c?d=identicon)[leo.viezens@web.de](/maintainers/leo.viezens@web.de)

---

Top Contributors

[![LeoVie](https://avatars.githubusercontent.com/u/7249788?v=4)](https://github.com/LeoVie "LeoVie (26 commits)")

---

Tags

dev

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/leovie-phpstan-baseline-guard/health.svg)

```
[![Health](https://phpackages.com/badges/leovie-phpstan-baseline-guard/health.svg)](https://phpackages.com/packages/leovie-phpstan-baseline-guard)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[testo/testo

A lightweight PHP testing framework.

1959.3k53](/packages/testo-testo)

PHPackages © 2026

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