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(1y ago)15MITPHPPHP ^8.2CI passing

Since Jul 17Pushed 1y agoCompare

[ Source](https://github.com/tetreum/cancerstan)[ Packagist](https://packagist.org/packages/tetreum/cancerstan)[ RSS](/packages/tetreum-cancerstan/feed)WikiDiscussions main Synced 1w 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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODQ5ODg5NjQsIm5iZiI6MTc4NDk4ODY2NCwicGF0aCI6Ii8xNzA4NzMwLzQ2ODM2NDUyMC0wNmY3MWY0YS05ZTM0LTQ4MTMtOWNlZS04NzFjNjBhNWVjM2IucG5nP1gtQW16LUFsZ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Y0YWE5YTY3N2I2NjFiMTcyMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.dQ6yvyD1302CyVtNqXMjDqPPIosSIeF1bAqInbSq_Ug)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

27

—

LowBetter than 46% of packages

Maintenance47

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

394d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1708730?v=4)[tetreum](/maintainers/tetreum)[@tetreum](https://github.com/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

14.1k380.4M46.1k](/packages/phpstan-phpstan)[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k563.0M820](/packages/phpspec-prophecy)[larastan/larastan

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

6.5k60.6M10.5k](/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.5k116.6M5.8k](/packages/phpmd-phpmd)[slevomat/coding-standard

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

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

Laravel Testing Helper for Packages Development

2.2k43.6M45.8k](/packages/orchestra-testbench)

PHPackages © 2026

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