PHPackages                             juampi92/phpstan-baseline-warnings - 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. juampi92/phpstan-baseline-warnings

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

juampi92/phpstan-baseline-warnings
==================================

PHPStan baseline warnings generator for GitHub Actions

v0.4(1y ago)26[1 PRs](https://github.com/juampi92/phpstan-baseline-warnings/pulls)MITPHPPHP ^8.1CI passing

Since Feb 24Pushed 1y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (6)Versions (6)Used By (0)

PHPStan Baseline Warnings
=========================

[](#phpstan-baseline-warnings)

 [![Latest Version on Packagist](https://camo.githubusercontent.com/9a08faeac2471ef95646d78d94057af42888bcee76615de8df57e12ec82606dd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a75616d706939322f7068707374616e2d626173656c696e652d7761726e696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juampi92/phpstan-baseline-warnings) [![Downloads Per Month](https://camo.githubusercontent.com/d477b42d788f738f933ee172640aa0574eb080531e97f081492534cd18175c89/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6a75616d706939322f7068707374616e2d626173656c696e652d7761726e696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juampi92/phpstan-baseline-warnings) [![GitHub Tests Action Status](https://camo.githubusercontent.com/21188e686b89e256715dd46d908205ff9f098fc596f6d01824f23caeaa1b40dd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a75616d706939322f7068707374616e2d626173656c696e652d7761726e696e67732f74657374732e796d6c3f6272616e63683d6d61696e)](https://github.com/juampi92/phpstan-baseline-warnings/actions?query=workflow%3Atests+branch%3Amain) [![PHP from Packagist](https://camo.githubusercontent.com/c1812ad62869fd0dcdaad04324b5719b05ed3d7e1ec66655dd62be1936a8d7ea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a75616d706939322f7068707374616e2d626173656c696e652d7761726e696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juampi92/phpstan-baseline-warnings)

**TL;DR:** Compare your PR's changed files with your PHPStan baseline, and let developers know they modified a file that has skipped errors, prompting them to fix them!

```
$ vendor/bin/phpstan-baseline-warnings src/Foo.php src/Bar.php src/Baz.php

::warning file=src/Foo.php,line=0,title=Found 3 errors that occur a total of 6 times:%0A- `#^Property Juampi92\\PhpstanBaselineWarnings\\Domain\\BaselineParser\:\:\$storage is never read, only written\.$#` : 3 times%0A- `#^Unsafe usage of new static\(\)\.$#` : 2 times
::warning file=src/Baz.php,line=0,title=Found 1 errors that occur a total of 2 times:%0A- `#^Unsafe usage of new static\(\)\.$#` : 2 times

```

It also comes avaialble as a [github action](#github-action)!

 [![Example of a PR with warnings](docs/images/example.png)](docs/images/example.png)

A Composer package that analyzes PHPStan baseline files and generates GitHub PR warning annotations for files with baseline-ignored errors. This helps teams maintain code quality by highlighting technical debt that's been temporarily suppressed through baselines whenever that file is modified.

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

[](#installation)

You can install the package via composer, or directly using a github action (see below).

```
composer require --dev juampi92/phpstan-baseline-warnings
```

Usage
-----

[](#usage)

After installing, you can run the command to analyze specific files against your PHPStan baseline:

```
# Basic usage with default baseline path
vendor/bin/phpstan-baseline-warnings src/MyClass.php src/OtherClass.php

# Specify a custom baseline path and base directory
vendor/bin/phpstan-baseline-warnings \
    --baseline-path=tools/phpstan-baseline.neon \
    --base-dir=../ \
    src/Domain/Entity/Post.php \
    src/Domain/Repository/PostRepository.php
```

The command will:

1. Read your PHPStan baseline file (default: `phpstan-baseline.neon`)
2. Check if the provided files have any baseline-ignored errors
3. Generate GitHub-compatible warning annotations for those files

### Options

[](#options)

- `--baseline-path`: Path to your PHPStan baseline file (default: `./phpstan-baseline.neon`)
- `--base-dir`: Base directory for resolving relative paths. Useful when your phpstan config is inside a sub-folder (default: `./`)

GitHub Action
-------------

[](#github-action)

You can also use this tool as a GitHub Action in your workflows:

```
name: PHPStan Baseline Warnings
on:
  pull_request:

jobs:
  phpstan-baseline-warnings:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: PHPStan Baseline Warnings
        uses: juampi92/phpstan-baseline-warnings@v0.4
        with:
          baseline-path: ./phpstan-baseline.neon
          base-dir: ./
```

This will analyze your PHPStan baseline file and create warning annotations in your GitHub repository.

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

License
-------

[](#license)

This package is open-sourced software licensed under the MIT license.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance45

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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 ~2 days

Total

4

Last Release

433d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f8d31c9bb6d7862e21aac7af0f7b2615dc06485b4c30b19b8d9fdffaa42c712?d=identicon)[juampi92](/maintainers/juampi92)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/juampi92-phpstan-baseline-warnings/health.svg)

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

###  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)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[phpbench/phpbench

PHP Benchmarking Framework

2.0k13.0M627](/packages/phpbench-phpbench)[maglnet/composer-require-checker

CLI tool to analyze composer dependencies and verify that no unknown symbols are used in the sources of a package

99810.9M671](/packages/maglnet-composer-require-checker)

PHPackages © 2026

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