Server: be explicit about the player promise resolver type

since there's no way for phpstan to infer the type of this, it becomes implicit mixed, which can conceal bugs.
This commit is contained in:
Dylan K. Taylor 2022-09-02 19:13:16 +01:00
parent 1ee02d7e02
commit 033dac3d16
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -570,6 +570,7 @@ class Server{
$playerPos = null;
$spawn = $world->getSpawnLocation();
}
/** @phpstan-var PromiseResolver<Player> $playerPromiseResolver */
$playerPromiseResolver = new PromiseResolver();
$world->requestChunkPopulation($spawn->getFloorX() >> Chunk::COORD_BIT_SIZE, $spawn->getFloorZ() >> Chunk::COORD_BIT_SIZE, null)->onCompletion(
function() use ($playerPromiseResolver, $class, $session, $playerInfo, $authenticated, $world, $playerPos, $spawn, $offlinePlayerData) : void{