phpstan: add stub defines to improve analysis

This commit is contained in:
Dylan K. Taylor 2020-04-25 11:07:05 +01:00
parent e6f64c609e
commit da9731ef59
2 changed files with 9 additions and 26 deletions

View File

@ -163,28 +163,3 @@ parameters:
message: "#^Constructor of class pocketmine\\\\scheduler\\\\TaskScheduler has an unused parameter \\$logger\\.$#"
count: 1
path: src/pocketmine/scheduler/TaskScheduler.php
-
message: "#^Constant pocketmine\\\\COMPOSER_AUTOLOADER_PATH not found\\.$#"
path: src
-
message: "#^Constant pocketmine\\\\DATA not found\\.$#"
path: src
-
message: "#^Constant pocketmine\\\\GIT_COMMIT not found\\.$#"
path: src
-
message: "#^Constant pocketmine\\\\PLUGIN_PATH not found\\.$#"
path: src
-
message: "#^Constant pocketmine\\\\START_TIME not found\\.$#"
path: src
-
message: "#^Constant pocketmine\\\\VERSION not found\\.$#"
path: src

View File

@ -21,4 +21,12 @@
declare(strict_types=1);
define('pocketmine\_PHPSTAN_ANALYSIS', true);
define('pocketmine\_PHPSTAN_ANALYSIS', true);
//TODO: these need to be defined properly or removed
define('pocketmine\COMPOSER_AUTOLOADER_PATH', dirname(__DIR__, 2) . '/vendor/autoload.php');
define('pocketmine\DATA', '');
define('pocketmine\GIT_COMMIT', str_repeat('00', 20));
define('pocketmine\PLUGIN_PATH', '');
define('pocketmine\START_TIME', microtime(true));
define('pocketmine\VERSION', '9.9.9');