mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
ChestInventory: document that getHolder() may return Position
there is a variance issue with EnderChestInventory that was detected by phpstan-strict-rules which can't be addressed without a BC break. This fix will at least allow static analysers to be aware that code using this function might catch fire when it sees an EnderChestInventory without realizing it.
This commit is contained in:
parent
a1622fa345
commit
4e693e91e6
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\inventory;
|
||||
|
||||
use pocketmine\level\Position;
|
||||
use pocketmine\network\mcpe\protocol\BlockEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\types\WindowTypes;
|
||||
@ -53,7 +54,7 @@ class ChestInventory extends ContainerInventory{
|
||||
|
||||
/**
|
||||
* This override is here for documentation and code completion purposes only.
|
||||
* @return Chest
|
||||
* @return Chest|Position
|
||||
*/
|
||||
public function getHolder(){
|
||||
return $this->holder;
|
||||
|
@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\inventory;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\level\Position;
|
||||
use pocketmine\Player;
|
||||
use pocketmine\tile\Chest;
|
||||
use function array_merge;
|
||||
@ -56,7 +57,7 @@ class DoubleChestInventory extends ChestInventory implements InventoryHolder{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Chest
|
||||
* @return Chest|Position
|
||||
*/
|
||||
public function getHolder(){
|
||||
return $this->left->getHolder();
|
||||
|
Loading…
x
Reference in New Issue
Block a user