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

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

phpstan/extension-installer
===========================

Composer plugin for automatic installation of PHPStan extensions

1.4.3(1y ago)506109.3M↓19.7%31[2 issues](https://github.com/phpstan/extension-installer/issues)[2 PRs](https://github.com/phpstan/extension-installer/pulls)20MITPHPPHP ^7.2 || ^8.0CI passing

Since May 19Pushed 1w ago5 watchersCompare

[ Source](https://github.com/phpstan/extension-installer)[ Packagist](https://packagist.org/packages/phpstan/extension-installer)[ RSS](/packages/phpstan-extension-installer/feed)WikiDiscussions 1.4.x Synced 2d ago

READMEChangelog (10)Dependencies (5)Versions (25)Used By (20)

PHPStan Extension Installer
===========================

[](#phpstan-extension-installer)

[![Build](https://github.com/phpstan/extension-installer/workflows/Build/badge.svg)](https://github.com/phpstan/extension-installer/actions)[![Latest Stable Version](https://camo.githubusercontent.com/23b997403934f757207660d0bf52d48ff55d0809e861c0327c4ba5ece717544d/68747470733a2f2f706f7365722e707567782e6f72672f7068707374616e2f657874656e73696f6e2d696e7374616c6c65722f762f737461626c65)](https://packagist.org/packages/phpstan/extension-installer)[![License](https://camo.githubusercontent.com/4fcf18935e097b8b84f05786b696a9c2491f4871baa9ec306c0f62ccae8e29d2/68747470733a2f2f706f7365722e707567782e6f72672f7068707374616e2f657874656e73696f6e2d696e7374616c6c65722f6c6963656e7365)](https://packagist.org/packages/phpstan/extension-installer)

Composer plugin for automatic installation of [PHPStan](https://phpstan.org/) extensions.

Motivation
==========

[](#motivation)

```
diff --git a/phpstan.neon b/phpstan.neon
index db4e3df32e..2ca30fa20a 100644
--- a/phpstan.neon
+++ b/phpstan.neon
@@ -1,12 +1,3 @@
-includes:
-	- vendor/phpstan/phpstan-doctrine/extension.neon
-	- vendor/phpstan/phpstan-doctrine/rules.neon
-	- vendor/phpstan/phpstan-nette/extension.neon
-	- vendor/phpstan/phpstan-nette/rules.neon
-	- vendor/phpstan/phpstan-phpunit/extension.neon
-	- vendor/phpstan/phpstan-phpunit/rules.neon
-	- vendor/phpstan/phpstan-strict-rules/rules.neon
-
 parameters:
 	autoload_directories:
 		- %rootDir%/../../../build/SlevomatSniffs
diff --git a/composer.json b/composer.json
index 1b578dd624..f6ebf6e477 100644
--- a/composer.json
+++ b/composer.json
@@ -142,6 +142,7 @@
 		"jakub-onderka/php-parallel-lint": "1.0.0",
 		"justinrainbow/json-schema": "5.2.8",
 		"ondrejmirtes/mocktainer": "0.8",
+		"phpstan/extension-installer": "^1.0",
 		"phpstan/phpstan": "^0.11.7",
 		"phpstan/phpstan-doctrine": "^0.11.3",
 		"phpstan/phpstan-nette": "^0.11.1",
```

Usage
-----

[](#usage)

```
composer require --dev phpstan/extension-installer
```

Starting from Composer 2.2.0 you'll get the following question:

```
phpstan/extension-installer contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "phpstan/extension-installer" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?]

```

Answer with `y` to allow the plugin.

Instructions for extension developers
-------------------------------------

[](#instructions-for-extension-developers)

It's best (but optional) to set the extension's composer package [type](https://getcomposer.org/doc/04-schema.md#type) to `phpstan-extension` for this plugin to be able to recognize it and to be [discoverable on Packagist](https://packagist.org/explore/?type=phpstan-extension).

Add `phpstan` key in the extension `composer.json`'s `extra` section:

```
{
  "extra": {
    "phpstan": {
      "includes": [
        "extension.neon"
      ]
    }
  }
}
```

Console output
--------------

[](#console-output)

After each `composer install` or `composer update`, the plugin reports per-package status when the configuration changes:

- **installed** — the extension was successfully registered.
- **not supported** — a package has `phpstan` in its name but is not configured as a PHPStan extension (missing the `phpstan-extension` type and `extra.phpstan` key). This may indicate the package requires manual `includes` configuration.
- **ignored** — the extension was skipped due to the ignore list (see below).

Ignoring a particular extension
-------------------------------

[](#ignoring-a-particular-extension)

You may want to disable auto-installation of a particular extension to handle installation manually. Ignore an extension by adding an `extra.phpstan/extension-installer.ignore` array in `composer.json` that specifies a list of packages to ignore:

```
{
  "extra": {
    "phpstan/extension-installer": {
      "ignore": [
        "phpstan/phpstan-phpunit"
      ]
    }
  }
}
```

Limitations
-----------

[](#limitations)

The extension installer depends on Composer script events, therefore you cannot use `--no-scripts` flag.

###  Health Score

70

—

ExcellentBetter than 100% of packages

Maintenance69

Regular maintenance activity

Popularity73

Solid adoption and visibility

Community55

Growing community involvement

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 57.7% 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 ~160 days

Recently: every ~179 days

Total

17

Last Release

39d ago

PHP version history (4 changes)1.0PHP ^7.1

1.0.5PHP ^7.1 || ^8.0

1.2.0PHP ^7.2 || ^8.0

1.4.x-devPHP ^7.4 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/104888?v=4)[Ondřej Mirtes](/maintainers/ondrejmirtes)[@ondrejmirtes](https://github.com/ondrejmirtes)

---

Top Contributors

[![ondrejmirtes](https://avatars.githubusercontent.com/u/104888?v=4)](https://github.com/ondrejmirtes "ondrejmirtes (86 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (18 commits)")[![renovate-bot](https://avatars.githubusercontent.com/u/25180681?v=4)](https://github.com/renovate-bot "renovate-bot (10 commits)")[![lookyman](https://avatars.githubusercontent.com/u/3863468?v=4)](https://github.com/lookyman "lookyman (9 commits)")[![ruudk](https://avatars.githubusercontent.com/u/104180?v=4)](https://github.com/ruudk "ruudk (5 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (5 commits)")[![mad-briller](https://avatars.githubusercontent.com/u/28307684?v=4)](https://github.com/mad-briller "mad-briller (3 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (2 commits)")[![Kocal](https://avatars.githubusercontent.com/u/2103975?v=4)](https://github.com/Kocal "Kocal (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![step-security-bot](https://avatars.githubusercontent.com/u/89328645?v=4)](https://github.com/step-security-bot "step-security-bot (1 commits)")[![Chris53897](https://avatars.githubusercontent.com/u/7104259?v=4)](https://github.com/Chris53897 "Chris53897 (1 commits)")[![herndlm](https://avatars.githubusercontent.com/u/5738896?v=4)](https://github.com/herndlm "herndlm (1 commits)")[![jdeniau](https://avatars.githubusercontent.com/u/1398469?v=4)](https://github.com/jdeniau "jdeniau (1 commits)")[![PavelJurasek](https://avatars.githubusercontent.com/u/1270132?v=4)](https://github.com/PavelJurasek "PavelJurasek (1 commits)")[![simPod](https://avatars.githubusercontent.com/u/327717?v=4)](https://github.com/simPod "simPod (1 commits)")[![BackEndTea](https://avatars.githubusercontent.com/u/14289961?v=4)](https://github.com/BackEndTea "BackEndTea (1 commits)")

---

Tags

phpstanphpstan-extensiondevstatic analysis

### Embed Badge

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

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

###  Alternatives

[deptrac/deptrac

Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.

3.0k8.8M118](/packages/deptrac-deptrac)[rector/rector

Instant Upgrade and Automated Refactoring of any PHP code

10.4k139.2M9.2k](/packages/rector-rector)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79475.7M2.2k](/packages/phpstan-phpstan-symfony)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67272.8M1.4k](/packages/phpstan-phpstan-doctrine)[shipmonk/composer-dependency-analyser

Fast detection of composer dependency issues (dead dependencies, shadow dependencies, misplaced dependencies)

6198.4M667](/packages/shipmonk-composer-dependency-analyser)[shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.

4853.5M91](/packages/shipmonk-dead-code-detector)

PHPackages © 2026

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