From 9df2ca3655a327b953762deb90d21257af7d3802 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 18 Jun 2019 14:12:37 +0100 Subject: [PATCH] fixup some formatting issues --- .../inventory/CallbackInventoryChangeListener.php | 4 ++-- src/pocketmine/network/mcpe/ChunkCache.php | 2 +- src/pocketmine/network/mcpe/NetworkSession.php | 10 +++++----- .../network/mcpe/protocol/AvailableCommandsPacket.php | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pocketmine/inventory/CallbackInventoryChangeListener.php b/src/pocketmine/inventory/CallbackInventoryChangeListener.php index b27499740..82c6b8ebb 100644 --- a/src/pocketmine/inventory/CallbackInventoryChangeListener.php +++ b/src/pocketmine/inventory/CallbackInventoryChangeListener.php @@ -46,10 +46,10 @@ class CallbackInventoryChangeListener implements InventoryChangeListener{ public static function onAnyChange(\Closure $onChange) : self{ return new self( - static function(Inventory $inventory, int $unused) use($onChange) : void{ + static function(Inventory $inventory, int $unused) use ($onChange) : void{ $onChange($inventory); }, - static function(Inventory $inventory) use($onChange) : void{ + static function(Inventory $inventory) use ($onChange) : void{ $onChange($inventory); } ); diff --git a/src/pocketmine/network/mcpe/ChunkCache.php b/src/pocketmine/network/mcpe/ChunkCache.php index 44776857f..8249175e0 100644 --- a/src/pocketmine/network/mcpe/ChunkCache.php +++ b/src/pocketmine/network/mcpe/ChunkCache.php @@ -98,7 +98,7 @@ class ChunkCache implements ChunkListener{ $chunkZ, $this->world->getChunk($chunkX, $chunkZ), $this->caches[$chunkHash], - function() use($chunkX, $chunkZ){ + function() use ($chunkX, $chunkZ){ $this->world->getLogger()->error("Failed preparing chunk $chunkX $chunkZ, retrying"); $this->restartPendingRequest($chunkX, $chunkZ); diff --git a/src/pocketmine/network/mcpe/NetworkSession.php b/src/pocketmine/network/mcpe/NetworkSession.php index 094f7414d..9604f50aa 100644 --- a/src/pocketmine/network/mcpe/NetworkSession.php +++ b/src/pocketmine/network/mcpe/NetworkSession.php @@ -449,7 +449,7 @@ class NetworkSession{ * @param bool $notify */ public function disconnect(string $reason, bool $notify = true) : void{ - $this->tryDisconnect(function() use($reason, $notify){ + $this->tryDisconnect(function() use ($reason, $notify){ if($this->player !== null){ $this->player->disconnect($reason, null, $notify); } @@ -467,7 +467,7 @@ class NetworkSession{ * @throws \UnsupportedOperationException */ public function transfer(string $ip, int $port, string $reason = "transfer") : void{ - $this->tryDisconnect(function() use($ip, $port, $reason){ + $this->tryDisconnect(function() use ($ip, $port, $reason){ $this->sendDataPacket(TransferPacket::create($ip, $port), true); $this->disconnect($reason, false); if($this->player !== null){ @@ -484,7 +484,7 @@ class NetworkSession{ * @param bool $notify */ public function onPlayerDestroyed(string $reason, bool $notify = true) : void{ - $this->tryDisconnect(function() use($reason, $notify){ + $this->tryDisconnect(function() use ($reason, $notify){ $this->doServerDisconnect($reason, $notify); }); } @@ -510,7 +510,7 @@ class NetworkSession{ * @param string $reason */ public function onClientDisconnect(string $reason) : void{ - $this->tryDisconnect(function() use($reason){ + $this->tryDisconnect(function() use ($reason){ if($this->player !== null){ $this->player->disconnect($reason, null, false); } @@ -742,7 +742,7 @@ class NetworkSession{ ChunkCache::getInstance($this->player->getWorld())->request($chunkX, $chunkZ)->onResolve( //this callback may be called synchronously or asynchronously, depending on whether the promise is resolved yet - function(CompressBatchPromise $promise) use($chunkX, $chunkZ, $onCompletion){ + function(CompressBatchPromise $promise) use ($chunkX, $chunkZ, $onCompletion){ if(!$this->isConnected()){ return; } diff --git a/src/pocketmine/network/mcpe/protocol/AvailableCommandsPacket.php b/src/pocketmine/network/mcpe/protocol/AvailableCommandsPacket.php index 13f087fee..f89697fbb 100644 --- a/src/pocketmine/network/mcpe/protocol/AvailableCommandsPacket.php +++ b/src/pocketmine/network/mcpe/protocol/AvailableCommandsPacket.php @@ -356,7 +356,7 @@ class AvailableCommandsPacket extends DataPacket implements ClientboundPacket{ /** @var CommandEnum[] $enums */ $enums = []; - $addEnumFn = static function(CommandEnum $enum) use(&$enums, &$enumIndexes, &$enumValueIndexes){ + $addEnumFn = static function(CommandEnum $enum) use (&$enums, &$enumIndexes, &$enumValueIndexes){ if(!isset($enumIndexes[$enum->getName()])){ $enums[$enumIndexes[$enum->getName()] = count($enumIndexes)] = $enum; }