Skip to content

Commit d40d67e

Browse files
committed
Add a configuration example
1 parent 1498353 commit d40d67e

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,44 @@ See https://phpstan.org/user-guide/extension-library#installing-extensions for m
1616

1717
## Configuration
1818

19-
The GLPI version should be detected automatically, but you can specify it in your PHPStan configuration:
20-
```yaml
19+
The PHPStan configuration depends on your GLPI version.
20+
If your plugin is located in either the `plugins` or `marketplace` directory of GLPI,
21+
you can use the following configuration file example:
22+
23+
```neon
24+
parameters:
25+
level: 0
26+
paths:
27+
- ajax
28+
- front
29+
- inc # or `src` if your PHP class files are in the `src` directory
30+
- hook.php
31+
- setup.php
32+
scanDirectories:
33+
- ../../inc
34+
- ../../src
35+
36+
# for GLPI 11.x the following configuration entries must be used
37+
bootstrapFiles:
38+
- ../../stubs/glpi_constants.php
39+
- ../../vendor/autoload.php
40+
41+
# for GLPI 10.x the following configuration entries must be used
42+
bootstrapFiles:
43+
- ../../inc/based_config.php
44+
stubFiles:
45+
- ../../stubs/glpi_constants.php
46+
```
47+
48+
The GLPI version should be detected automatically, but you can specify it in the `parameters` section of your PHPStan configuration:
49+
```neon
2150
parameters:
2251
glpi:
2352
glpiVersion: "11.0"
2453
```
2554

55+
See https://phpstan.org/config-reference fore more information about the PHPStan configuration options.
56+
2657
## Rules
2758

2859
### `ForbidDynamicInstantiationRule`

0 commit comments

Comments
 (0)