proget-hq/phpstan-yii2

Yii2 extension for PHPStan

0.8.0 2022-01-10 14:49 UTC

This package is auto-updated.

Last update: 2024-09-10 20:46:32 UTC


README

Minimum PHP Version Latest Stable Version Build Status Total Downloads License

What does it do?

  • Provides correct return type for Yii::$container->get('service_id') method,
  • Provides correct methods and properties for Yii::$app->request
  • Ignore common problems with response objects (to be removed).

Compatibility

Installation

composer require --dev proget-hq/phpstan-yii2

Configuration

Put this into your phpstan.neon config:

includes:
	- vendor/proget-hq/phpstan-yii2/extension.neon
parameters:
    yii2:
        config_path: %rootDir%/../../../config/test.php

Limitations

Container closures must have return types.

You have to provide a path to config/test.php or other yii2 config file.