proget-hq / phpstan-yii2
Yii2 extension for PHPStan
Installs: 417 854
Dependents: 7
Suggesters: 0
Security: 0
Stars: 52
Watchers: 2
Forks: 21
Open Issues: 10
Requires
- php: ^7.2|^8.0
- nikic/php-parser: ^4.1.0
- phpstan/phpstan: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.1
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^8.0
- yiisoft/yii2: ^2.0.42
README
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.