fixing some PHPStan complaints about bootstrap

this isn't an ideal fix, but it'll do.
This commit is contained in:
Dylan K. Taylor 2019-11-07 18:22:21 +00:00
parent 95812252d6
commit 932418b951
3 changed files with 30 additions and 56 deletions

View File

@ -2,6 +2,9 @@
parameters:
level: 1
autoload_files:
- tests/phpstan/bootstrap.php
- src/pocketmine/PocketMine.php
paths:
- src
reportUnmatchedIgnoredErrors: false #no other way to silence platform-specific non-warnings
@ -10,61 +13,6 @@ parameters:
message: "#^pocketmine\\\\Player\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\entity\\\\Human\\.$#"
path: src/pocketmine/Player.php
-
message: "#^Function pocketmine\\\\critical_error not found while trying to analyse it \\- autoloading is probably not configured properly\\.$#"
count: 1
path: src/pocketmine/PocketMine.php
-
message: "#^Function pocketmine\\\\check_platform_dependencies not found while trying to analyse it \\- autoloading is probably not configured properly\\.$#"
count: 1
path: src/pocketmine/PocketMine.php
-
message: "#^Function pocketmine\\\\emit_performance_warnings not found while trying to analyse it \\- autoloading is probably not configured properly\\.$#"
count: 1
path: src/pocketmine/PocketMine.php
-
message: "#^Function pocketmine\\\\set_ini_entries not found while trying to analyse it \\- autoloading is probably not configured properly\\.$#"
count: 1
path: src/pocketmine/PocketMine.php
-
message: "#^Function pocketmine\\\\server not found while trying to analyse it \\- autoloading is probably not configured properly\\.$#"
count: 1
path: src/pocketmine/PocketMine.php
-
message: "#^Function check_platform_dependencies not found\\.$#"
count: 1
path: src/pocketmine/PocketMine.php
-
message: "#^Function critical_error not found\\.$#"
count: 6
path: src/pocketmine/PocketMine.php
-
message: "#^Function set_ini_entries not found\\.$#"
count: 1
path: src/pocketmine/PocketMine.php
-
message: "#^Function emit_performance_warnings not found\\.$#"
count: 1
path: src/pocketmine/PocketMine.php
-
message: "#^Function pocketmine\\\\server not found\\.$#"
count: 1
path: src/pocketmine/PocketMine.php
-
message: "#^Constant MIN_PHP_VERSION not found\\.$#"
count: 2
path: src/pocketmine/PocketMine.php
-
message: "#^pocketmine\\\\block\\\\[A-Za-z\\d]+\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\block\\\\Block\\.$#"
path: src/pocketmine/block

View File

@ -291,5 +291,7 @@ namespace pocketmine {
exit($exitCode);
}
\pocketmine\server();
if(!defined('pocketmine\_PHPSTAN_ANALYSIS')){
\pocketmine\server();
}
}

View File

@ -0,0 +1,24 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
define('pocketmine\_PHPSTAN_ANALYSIS', true);