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

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

inviqa/phpstan-magento2
=======================

Extension for PHPStan to allow analysis of Magento2 code.

0.1.2(6y ago)559.4k↓76.1%2[2 issues](https://github.com/inviqa/phpstan-magento2/issues)MITPHP

Since Apr 5Pushed 6y ago6 watchersCompare

[ Source](https://github.com/inviqa/phpstan-magento2)[ Packagist](https://packagist.org/packages/inviqa/phpstan-magento2)[ RSS](/packages/inviqa-phpstan-magento2/feed)WikiDiscussions master Synced 1w ago

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

phpstan-magento2 extension
==========================

[](#phpstan-magento2-extension)

Extension for [PHPStan](https://github.com/phpstan/phpstan) to allow analysis of Magento2 code.

This is fairly bare-bones at the moment, just bootstrapping Magento

Usage
-----

[](#usage)

Add `phpstan.neon` to your Magento2 project.

Make sure it has

```
includes:
	- vendor/inviqa/phpstan-magento2/extension.neon
```

Whilst this extension depends on phpstan/phpstan, it can also depend on phpstan/phpstan-shim, which decouples its dependencies from Magento's own use of them. Some versions of Magento 2 will require the latter due to conflicting symfony/console version constraints.

With coupled dependencies:

```
composer require inviqa/phpstan-magento2 phpstan/phpstan
```

With uncoupled phar package:

```
composer require inviqa/phpstan-magento2 phpstan/phpstan-shim
```

###  Health Score

30

—

LowBetter than 61% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

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

Total

3

Last Release

2461d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6b33b247b870cf3add3d95961e04f7b87c63d0817af5c373837c28ae3c1aeaf0?d=identicon)[inviqa-session](/maintainers/inviqa-session)

---

Top Contributors

[![andytson-inviqa](https://avatars.githubusercontent.com/u/11387086?v=4)](https://github.com/andytson-inviqa "andytson-inviqa (7 commits)")

### Embed Badge

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

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

###  Alternatives

[larastan/larastan

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

6.5k60.6M10.5k](/packages/larastan-larastan)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67475.0M1.6k](/packages/phpstan-phpstan-doctrine)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79378.2M2.5k](/packages/phpstan-phpstan-symfony)[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.

5014.2M111](/packages/shipmonk-dead-code-detector)[spaze/phpstan-disallowed-calls

PHPStan rules to detect disallowed method &amp; function calls, constant, namespace, attribute, property &amp; superglobal usages, with powerful rules to re-allow a call or a usage in places where it should be allowed.

33923.4M633](/packages/spaze-phpstan-disallowed-calls)[mglaman/phpstan-drupal

Drupal extension and rules for PHPStan

20832.2M213](/packages/mglaman-phpstan-drupal)

PHPackages © 2026

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