@@ -45,15 +45,22 @@ parameters:
4545 - ../../stubs/glpi_constants.php
4646```
4747
48- The GLPI version should be detected automatically, but you can specify it in the ` parameters ` section of your PHPStan configuration:
48+ The GLPI path and version should be detected automatically, but you can specify them in the ` parameters ` section of your PHPStan configuration:
4949``` neon
5050parameters:
5151 glpi:
52- glpiVersion: "11.0"
52+ glpiPath: "/path/to/glpi"
53+ glpiVersion: "11.0.0"
5354```
5455
5556See https://phpstan.org/config-reference fore more information about the PHPStan configuration options.
5657
58+ ## Analyser improvements
59+
60+ This extension will help PHPStan to resolve the GLPI global variables types.
61+ For instance, it will indicate that the ` global $DB; ` variable is an instance of the ` DBmysql ` class,
62+ so PHPStan will be able to detected bad method calls, deprecated methods usages, ...
63+
5764## Rules
5865
5966### ` ForbidDynamicInstantiationRule `
@@ -111,9 +118,10 @@ Therefore, its usage is discouraged.
111118> Since GLPI 10.0.
112119
113120By default, PHPStan is not able to detect the global variables types, and is therefore not able to detect any issue
114- related to their usage. To get around this limitation, we recommend that you declare each global variable type with
115- a PHPDoc tag.
121+ related to their usage. This extension will resolve the type of GLPI global variables, but cannot resolve your plugin
122+ specific global variables.
123+ To get around this limitation, we recommend that you declare each global variable type with a PHPDoc tag.
116124``` php
117- /** @var \DBmysql $DB */
118- global $DB ;
125+ /** @var \Migration $migration */
126+ global migration ;
119127```
0 commit comments