inviqa/phpstan-magento2

Extension for PHPStan to allow analysis of Magento2 code.

0.1.2 2019-11-22 14:59 UTC

This package is auto-updated.

Last update: 2024-11-23 02:06:50 UTC


README

Extension for PHPStan to allow analysis of Magento2 code.

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

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