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

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

craftcms/phpstan
================

PHPStan configuration for Craft CMS projects

12265.0k—9%5[2 issues](https://github.com/craftcms/phpstan/issues)[1 PRs](https://github.com/craftcms/phpstan/pulls)20

Since Apr 12Pushed 4y ago4 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (20)

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

30

—

LowBetter than 64% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community33

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ccdf8b493035de2343c55bd889513e3af5c04d5823482a2b186ad16adb1c3e3?d=identicon)[brandonkelly](/maintainers/brandonkelly)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[outerweb/filament-settings

Filament integration for the outerweb/settings package

3690.9k4](/packages/outerweb-filament-settings)[leeovery/wordpress-to-laravel

1142.4k](/packages/leeovery-wordpress-to-laravel)

PHPackages © 2026

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