Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor 2019-12-04 11:11:29 +00:00
commit e65bc5c3ae
10 changed files with 20 additions and 57 deletions

View File

@ -14,37 +14,9 @@ parameters:
reportUnmatchedIgnoredErrors: false #no other way to silence platform-specific non-warnings
ignoreErrors:
-
message: "#^pocketmine\\\\Player\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\entity\\\\Human\\.$#"
path: src/pocketmine/Player.php
-
message: "#^pocketmine\\\\block\\\\[A-Za-z\\d]+\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\block\\\\Block\\.$#"
path: src/pocketmine/block
-
message: "#^pocketmine\\\\block\\\\Block\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\level\\\\Position\\.$#"
message: "#^Cannot instantiate interface pocketmine\\\\level\\\\format\\\\io\\\\LevelProvider\\.$#"
count: 1
path: src/pocketmine/block/Block.php
-
message: "#^pocketmine\\\\inventory\\\\DoubleChestInventory\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\inventory\\\\ChestInventory\\.$#"
count: 1
path: src/pocketmine/inventory/DoubleChestInventory.php
-
message: "#^pocketmine\\\\inventory\\\\EnderChestInventory\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\inventory\\\\ChestInventory\\.$#"
count: 1
path: src/pocketmine/inventory/EnderChestInventory.php
-
message: "#^pocketmine\\\\item\\\\GoldenAppleEnchanted\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\item\\\\GoldenApple\\.$#"
count: 1
path: src/pocketmine/item/GoldenAppleEnchanted.php
-
message: "#^pocketmine\\\\item\\\\WrittenBook\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\item\\\\WritableBook\\.$#"
count: 1
path: src/pocketmine/item/WrittenBook.php
path: src/pocketmine/Server.php
-
message: "#^Constructor of class pocketmine\\\\level\\\\generator\\\\hell\\\\Nether has an unused parameter \\$options\\.$#"
@ -102,4 +74,4 @@ parameters:
message: "#^Call to an undefined method pocketmine\\\\command\\\\CommandSender\\:\\:teleport\\(\\)\\.$#"
count: 1
path: src/pocketmine/command/defaults/TeleportCommand.php
comment: "not actually possible, but high cost to fix warning"
# comment: "not actually possible, but high cost to fix warning"

View File

@ -1799,7 +1799,6 @@ class Server{
return $this->broadcast($message, self::BROADCAST_CHANNEL_USERS);
}
/** @var CommandSender[] $recipients */
foreach($recipients as $recipient){
$recipient->sendMessage($message);
}
@ -1824,7 +1823,6 @@ class Server{
}
}
/** @var Player[] $recipients */
foreach($recipients as $recipient){
$recipient->sendTip($tip);
}
@ -1850,7 +1848,6 @@ class Server{
}
}
/** @var Player[] $recipients */
foreach($recipients as $recipient){
$recipient->sendPopup($popup);
}
@ -1880,7 +1877,6 @@ class Server{
}
}
/** @var Player[] $recipients */
foreach($recipients as $recipient){
$recipient->sendTitle($title, $subtitle, $fadeIn, $stay, $fadeOut);
}

View File

@ -56,7 +56,6 @@ abstract class Event{
throw new \BadMethodCallException(get_class($this) . " is not Cancellable");
}
/** @var Event $this */
return $this->isCancelled;
}
@ -70,7 +69,6 @@ abstract class Event{
throw new \BadMethodCallException(get_class($this) . " is not Cancellable");
}
/** @var Event $this */
$this->isCancelled = $value;
}

View File

@ -359,12 +359,9 @@ class AvailableCommandsPacket extends DataPacket{
$enumValueIndexes[$str] = $enumValueIndexes[$str] ?? count($enumValueIndexes); //latest index
}
}
/** @var CommandParameter[] $overload */
foreach($commandData->overloads as $overload){
/**
* @var CommandParameter[] $overload
* @var CommandParameter $parameter
*/
/** @var CommandParameter $parameter */
foreach($overload as $parameter){
if($parameter->enum !== null){
if(!isset($enumIndexes[$parameter->enum->enumName])){

View File

@ -733,7 +733,7 @@ class PluginManager{
$eventClass = $parameters[0]->getClass();
}catch(\ReflectionException $e){ //class doesn't exist
if(isset($tags["softDepend"]) && !isset($this->plugins[$tags["softDepend"]])){
$this->server->getLogger()->debug("Not registering @softDepend listener " . Utils::getNiceClosureName($handlerClosure) . "(" . $parameters[0]->getType()->getName() . ") because plugin \"" . $tags["softDepend"] . "\" not found");
$this->server->getLogger()->debug("Not registering @softDepend listener " . Utils::getNiceClosureName($handlerClosure) . "() because plugin \"" . $tags["softDepend"] . "\" not found");
continue;
}

View File

@ -3,10 +3,10 @@ parameters:
-
message: "#^Instantiated class COM not found\\.$#"
count: 2
path: src/pocketmine/network/upnp/UPnP.php
path: ../../../src/pocketmine/network/upnp/UPnP.php
-
message: "#^Access to property \\$StaticPortMappingCollection on an unknown class COM\\.$#"
count: 4
path: src/pocketmine/network/upnp/UPnP.php
path: ../../../src/pocketmine/network/upnp/UPnP.php

View File

@ -2,29 +2,29 @@ parameters:
ignoreErrors:
-
message: "#^Used constant LEVELDB_ZLIB_RAW_COMPRESSION not found\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
path: ../../../src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Constant LEVELDB_ZLIB_RAW_COMPRESSION not found\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
path: ../../../src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Instantiated class LevelDB not found\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
path: ../../../src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Return typehint of method pocketmine\\\\level\\\\format\\\\io\\\\leveldb\\\\LevelDB\\:\\:createDB\\(\\) has invalid type LevelDB\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
path: ../../../src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Return typehint of method pocketmine\\\\level\\\\format\\\\io\\\\leveldb\\\\LevelDB\\:\\:getDatabase\\(\\) has invalid type LevelDB\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
path: ../../../src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Property pocketmine\\\\level\\\\format\\\\io\\\\leveldb\\\\LevelDB\\:\\:\\$db has unknown class LevelDB as its type\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
path: ../../../src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Call to method (get|put|delete|close)\\(\\) on an unknown class LevelDB\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
path: ../../../src/pocketmine/level/format/io/leveldb/LevelDB.php

View File

@ -1,10 +1,10 @@
parameters:
ignoreErrors:
-
message: "#^PHPDoc tag @param has invalid value \\(.+\\)\\: Unexpected token \"&\", expected TOKEN_VARIABLE at offset \\d+$#"
path: src/pocketmine
message: "#^PHPDoc tag @param has invalid value \\(.+\\)\\: Unexpected token \"&\", expected variable at offset \\d+$#"
path: ../../../src/pocketmine
-
message: "#^Default value of the parameter \\#\\d+ \\$[A-Za-z\\d_]+ \\(\\-?\\d+\\) of method .+\\(\\) is incompatible with type float\\.$#"
path: src/pocketmine
path: ../../../src/pocketmine

View File

@ -2,5 +2,5 @@ parameters:
ignoreErrors:
-
message: "#^Variable \\$GLOBALS in isset\\(\\) always exists and is not nullable\\.$#"
path: src/pocketmine/MemoryManager.php
path: ../../../src/pocketmine/MemoryManager.php

View File

@ -21,7 +21,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
[ ! -f phpstan.phar ] && echo "Downloading PHPStan..." && curl -sSLO https://github.com/phpstan/phpstan/releases/download/0.11.19/phpstan.phar
[ ! -f phpstan.phar ] && echo "Downloading PHPStan..." && curl -sSLO https://github.com/phpstan/phpstan/releases/download/0.12.0/phpstan.phar
"$PHP_BINARY" phpstan.phar analyze --no-progress --memory-limit=2G || exit 1
echo "PHPStan scan succeeded"