Skip to content

yii2-extensions/phpstan

Extension for PHPStan.

PHP-Version Yii-22.0.52 Yii2-22 PHPUnit Static-Analysis Codecov

Installation

The preferred way to install this extension is through composer.

Either run

composer require --dev --prefer-dist yii2-extensions/phpstan:^0.2

or add

"yii2-extensions/phpstan": "^0.2"

Usage

To use this extension, you need to add the following configuration to your phpstan.neon file:

includes:
	- vendor/yii2-extensions/phpstan/extension.neon

parameters:
    bootstrapFiles:
        - tests/bootstrap.php

    dynamicConstantNames:
        - YII_DEBUG
        - YII_ENV

    level: 5

    paths:
        - src

    scanFiles:
        - vendor/yiisoft/yii2/Yii.php

    yii2:
        # Path to your Yii2 configuration file
        config_path: %currentWorkingDirectory%/config/test.php

Quality code

phpstan-level style-ci

Testing

Check the documentation testing to learn about testing.

Our social networks

Twitter

License

BSD-3-Clause license. Please see License File for more information.

Fork

This package is a fork of proget-hq/phpstan-yii2 with some corrections.