PHPackages                             marcusgaius/phpstan - 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. marcusgaius/phpstan

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

marcusgaius/phpstan
===================

PHPStan configuration for Craft CMS projects

1.2.3(1y ago)0813PHP

Since Feb 28Pushed 1y agoCompare

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

READMEChangelogDependencies (3)Versions (7)Used By (3)

PHPStan config for Craft CMS
============================

[](#phpstan-config-for-craft-cms)

This package provides a base [PHPStan](https://github.com/phpstan/phpstan) configuration for Craft CMS plugins and projects.

To install, run the following commands within your plugin or project:

```
composer config minimum-stability dev
```

```
composer config prefer-stable true
```

```
composer require craftcms/phpstan:dev-main --dev
```

Then add a `phpstan.neon` config file to the root of your project:

```
includes:
    - vendor/craftcms/phpstan/phpstan.neon

parameters:
    level: 0
    paths:
        - src
```

Change the `paths` array to whichever directory(s) contain the source code you want PHPStan to inspect.

(See PHPStan’s [Config Reference](https://phpstan.org/config-reference) for a full list of supported config parameters.)

With that in place, you can begin running PHPStan with the following command:

```
vendor/bin/phpstan --memory-limit=1G
```

Or define a `phpstan` script in `composer.json`:

```
{
  "...": "...",
  "scripts": {
    "phpstan": "phpstan --memory-limit=1G"
  }
}
```

And then run PHPStan with:

```
composer run-script phpstan
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance47

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.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 ~9 days

Total

6

Last Release

398d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/21ac7de48035ffaa381b80963784a7f967352174002334a5093bbec4a9e39814?d=identicon)[MarcusGaius](/maintainers/MarcusGaius)

---

Top Contributors

[![marcusgaius](https://avatars.githubusercontent.com/u/39379513?v=4)](https://github.com/marcusgaius "marcusgaius (7 commits)")[![brandonkelly](https://avatars.githubusercontent.com/u/47792?v=4)](https://github.com/brandonkelly "brandonkelly (4 commits)")

### Embed Badge

![Health badge](/badges/marcusgaius-phpstan/health.svg)

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

###  Alternatives

[ticketswap/phpstan-error-formatter

A minimalistic error formatter for PHPStan

87578.8k35](/packages/ticketswap-phpstan-error-formatter)

PHPackages © 2026

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