diff --git a/src/entity/EntityFactory.php b/src/entity/EntityFactory.php index a032c088f..060e152da 100644 --- a/src/entity/EntityFactory.php +++ b/src/entity/EntityFactory.php @@ -161,12 +161,11 @@ final class EntityFactory{ } /** - * @phpstan-param class-string $baseClass * @phpstan-param \Closure(World, CompoundTag) : Entity $creationFunc */ - private static function validateCreationFunc(string $baseClass, \Closure $creationFunc) : void{ + private static function validateCreationFunc(\Closure $creationFunc) : void{ $sig = new CallbackType( - new ReturnType($baseClass), + new ReturnType(Entity::class), new ParameterType("world", World::class), new ParameterType("nbt", CompoundTag::class) ); @@ -193,7 +192,7 @@ final class EntityFactory{ throw new \InvalidArgumentException("At least one save name must be provided"); } Utils::testValidInstance($className, Entity::class); - self::validateCreationFunc($className, $creationFunc); + self::validateCreationFunc($creationFunc); foreach($saveNames as $name){ $this->creationFuncs[$name] = $creationFunc;