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.3k↓72.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 today

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 62% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

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

2416d 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.5k55.4M8.5k](/packages/larastan-larastan)[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/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)[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.

33422.6M550](/packages/spaze-phpstan-disallowed-calls)[tomasvotruba/cognitive-complexity

PHPStan rules to measure cognitive complexity of your classes and methods

1635.6M288](/packages/tomasvotruba-cognitive-complexity)

PHPackages © 2026

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