diff --git a/src/entity/HungerManager.php b/src/entity/HungerManager.php index 77eb87d11..f0e0e9d8e 100644 --- a/src/entity/HungerManager.php +++ b/src/entity/HungerManager.php @@ -57,7 +57,7 @@ class HungerManager{ } private static function fetchAttribute(Entity $entity, string $attributeId) : Attribute{ - $attribute = AttributeFactory::getInstance()->get($attributeId); + $attribute = AttributeFactory::getInstance()->mustGet($attributeId); $entity->getAttributeMap()->add($attribute); return $attribute; } diff --git a/tests/phpstan/configs/l8-baseline.neon b/tests/phpstan/configs/l8-baseline.neon index 1d158dd67..d7379254a 100644 --- a/tests/phpstan/configs/l8-baseline.neon +++ b/tests/phpstan/configs/l8-baseline.neon @@ -130,16 +130,6 @@ parameters: count: 1 path: ../../../src/entity/Entity.php - - - message: "#^Parameter \\#1 \\$attribute of method pocketmine\\\\entity\\\\AttributeMap\\:\\:add\\(\\) expects pocketmine\\\\entity\\\\Attribute, pocketmine\\\\entity\\\\Attribute\\|null given\\.$#" - count: 1 - path: ../../../src/entity/HungerManager.php - - - - message: "#^Method pocketmine\\\\entity\\\\HungerManager\\:\\:fetchAttribute\\(\\) should return pocketmine\\\\entity\\\\Attribute but returns pocketmine\\\\entity\\\\Attribute\\|null\\.$#" - count: 1 - path: ../../../src/entity/HungerManager.php - - message: "#^Cannot call method getEffectLevel\\(\\) on pocketmine\\\\entity\\\\effect\\\\EffectInstance\\|null\\.$#" count: 3