mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 07:39:57 +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{
|
private static function fetchAttribute(Entity $entity, string $attributeId) : Attribute{
|
||||||
$attribute = AttributeFactory::getInstance()->get($attributeId);
|
$attribute = AttributeFactory::getInstance()->mustGet($attributeId);
|
||||||
$entity->getAttributeMap()->add($attribute);
|
$entity->getAttributeMap()->add($attribute);
|
||||||
return $attribute;
|
return $attribute;
|
||||||
}
|
}
|
||||||
|
@ -130,16 +130,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../../src/entity/Entity.php
|
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\\.$#"
|
message: "#^Cannot call method getEffectLevel\\(\\) on pocketmine\\\\entity\\\\effect\\\\EffectInstance\\|null\\.$#"
|
||||||
count: 3
|
count: 3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user