fixed a couple of new phpstan errors

This commit is contained in:
Dylan K. Taylor 2020-09-04 01:44:21 +01:00
parent 0aee39027e
commit 101dc1e1d7
2 changed files with 2 additions and 0 deletions

View File

@ -1645,6 +1645,7 @@ abstract class Entity{
/**
* @return MetadataProperty[]
* @phpstan-return array<int, MetadataProperty>
*/
final protected function getSyncedNetworkData(bool $dirtyOnly) : array{
$this->syncNetworkData($this->networkProperties);

View File

@ -45,6 +45,7 @@ final class EntityDataHelper{
if(!($yawPitch instanceof ListTag) or $yawPitch->getTagType() !== NBT::TAG_Float){
throw new \UnexpectedValueException("'Rotation' should be a List<Float>");
}
/** @var FloatTag[] $values */
$values = $yawPitch->getValue();
if(count($values) !== 2){
throw new \UnexpectedValueException("Expected exactly 2 entries for 'Rotation'");