Skip to content

Commit

Permalink
ClientDataToSkinDataHelper: Remove SingletonTrait
Browse files Browse the repository at this point in the history
SingletonTrait is pointless here for multiple reasons:
1) the class is final
2) this is protocol-specific translation of types, no loss of data or alternative mutation of it needs to occur

Using SingletonTrait is an obstacle to separating the protocol library from the core code, so it has to go.
  • Loading branch information
dktapps committed Jul 14, 2021
1 parent b48e2fd commit 8c72b49
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/types/login/ClientDataToSkinDataHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@
use pocketmine\network\mcpe\protocol\types\skin\SkinAnimation;
use pocketmine\network\mcpe\protocol\types\skin\SkinData;
use pocketmine\network\mcpe\protocol\types\skin\SkinImage;
use pocketmine\utils\SingletonTrait;
use function array_map;
use function base64_decode;

final class ClientDataToSkinDataHelper{
use SingletonTrait;

/**
* @throws \InvalidArgumentException
Expand All @@ -49,7 +47,7 @@ private static function safeB64Decode(string $base64, string $context) : string{
/**
* @throws \InvalidArgumentException
*/
public function fromClientData(ClientData $clientData) : SkinData{
public static function fromClientData(ClientData $clientData) : SkinData{
/** @var SkinAnimation[] $animations */
$animations = [];
foreach($clientData->AnimatedImageData as $k => $animation){
Expand Down

0 comments on commit 8c72b49

Please sign in to comment.