mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
HungerManager: use AttributeMap->mustGet()
fixes 2 errors on phpstan level 8
This commit is contained in:
parent
7e391a8123
commit
3c1b8b83f5
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user