Skip to content

Commit c9e9675

Browse files
feat: Add usage instructions and configuration details for phpstan.neon in README.md. (#18)
1 parent 9a306a1 commit c9e9675

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,34 @@ or add
4242
"yii2-extensions/phpstan": "^0.1"
4343
```
4444

45-
to the require-dev section of your `composer.json` file.
45+
## Usage
46+
47+
To use this extension, you need to add the following configuration to your `phpstan.neon` file:
48+
49+
```neon
50+
includes:
51+
- vendor/yii2-extensions/phpstan/extension.neon
52+
53+
parameters:
54+
bootstrapFiles:
55+
- tests/bootstrap.php
56+
57+
dynamicConstantNames:
58+
- YII_DEBUG
59+
- YII_ENV
60+
61+
level: 5
62+
63+
paths:
64+
- src
65+
66+
scanFiles:
67+
- vendor/yiisoft/yii2/Yii.php
68+
69+
yii2:
70+
# Path to your Yii2 configuration file
71+
config_path: %currentWorkingDirectory%/config/test.php
72+
```
4673

4774
## Quality code
4875

0 commit comments

Comments
 (0)