-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Yii2 extension for PHPStan | ||
|
||
## What does it do? | ||
|
||
* Provides correct return type for `Yii::$container->get('service_id')` method, | ||
* Ignore common problems with active record and request/response objects. | ||
|
||
## Installation | ||
|
||
```sh | ||
composer require --dev proget-hq/phpstan-yii2 | ||
``` | ||
|
||
## Configuration | ||
|
||
Put this into your `phpstan.neon` config: | ||
|
||
```neon | ||
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. |