PHPackages                             tetreum/cancerstan - 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. tetreum/cancerstan

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

tetreum/cancerstan
==================

Fix some PHPStan errors automatically

v0.3(9mo ago)14MITPHPPHP ^8.2CI passing

Since Jul 17Pushed 9mo agoCompare

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

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

```
        _________                                   _________ __
        \_   ___ \_____    ____   ____  ___________/   _____//  |______    ____
        /    \  \/\__  \  /    \_/ ___\/ __ \_  __ \_____  \\   __\__  \  /    \
        \     \____/ __ \|   |  \  \__\  ___/|  | \/        \|  |  / __ \|   |  \
         \______  (____  /___|  /\___  >___  >__| /_______  /|__| (____  /___|  /
                \/     \/     \/     \/    \/             \/           \/     \/

```

Tired of manually fixing PHPStan "errors"?

With CancerStan you can fix some of them automatically or build new fixers yourself to fix even more.

[![Screenshot from 2025-07-20 11-02-17](https://private-user-images.githubusercontent.com/1708730/468364520-06f71f4a-9e34-4813-9cee-871c60a5ec3b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxODU4NjYsIm5iZiI6MTc3NTE4NTU2NiwicGF0aCI6Ii8xNzA4NzMwLzQ2ODM2NDUyMC0wNmY3MWY0YS05ZTM0LTQ4MTMtOWNlZS04NzFjNjBhNWVjM2IucG5nP1gtQW16LUFsZ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zPWhvc3QifQ.36gPYh_ZvbGfQSkFv6j8B8dI3IK7vVri8l1IUVFYItU)Install
-------

[](#install)

`composer require --dev tetreum/cancerstan`

Usage
-----

[](#usage)

`vendor/bin/cancerstan --dry-run`

CancerStan will run PHPStan first to gather the error list and then try to fix them for you.

Options
-------

[](#options)

- `--dry-run`: Will return the changes to apply without applying them
- `--stan`: To provide PHPStan's location. Ex: --stan=/docker/phpstan . Default: /vendor/bin/phpstan
- `--custom-fixers`: Path to custom fixers directory. Ex: --custom-fixers=./MyCustomFixers

Custom fixers
-------------

[](#custom-fixers)

Your codebase may have it's own tricks and requirements, so you can also make and load custom fixers. Check the `src/Fixers` folder to get an idea on how to build them.

To load them just point CancerStan to their folder like: `vendor/bin/cancerstan --custom-fixers=YOUR_FIXERS_FOLDER_PATH`

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance55

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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

Total

3

Last Release

296d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/71266106071cb2021cd95755a704956b877d6f759ed8708d864ee20e41faf5bb?d=identicon)[tetreum](/maintainers/tetreum)

---

Top Contributors

[![tetreum](https://avatars.githubusercontent.com/u/1708730?v=4)](https://github.com/tetreum "tetreum (6 commits)")

---

Tags

PHPStandev

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tetreum-cancerstan/health.svg)

```
[![Health](https://phpackages.com/badges/tetreum-cancerstan/health.svg)](https://phpackages.com/packages/tetreum-cancerstan)
```

###  Alternatives

[phpstan/phpstan

PHPStan - PHP Static Analysis Tool

13.9k341.8M29.6k](/packages/phpstan-phpstan)[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[larastan/larastan

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

6.4k43.5M5.2k](/packages/larastan-larastan)[phpmd/phpmd

PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.

2.4k108.5M4.8k](/packages/phpmd-phpmd)[slevomat/coding-standard

Slevomat Coding Standard for PHP\_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.

1.5k123.5M1.8k](/packages/slevomat-coding-standard)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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