mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-09 11:31:49 +00:00
LegacySkinAdapter: an extra check for resourcePatch (fixes 3 phpstan explicitMixed errors)
This commit is contained in:
parent
a9d98bdf73
commit
e105578be0
@ -26,6 +26,7 @@ namespace pocketmine\network\mcpe\protocol\types;
|
|||||||
use pocketmine\entity\InvalidSkinException;
|
use pocketmine\entity\InvalidSkinException;
|
||||||
use pocketmine\entity\Skin;
|
use pocketmine\entity\Skin;
|
||||||
|
|
||||||
|
use function is_array;
|
||||||
use function is_string;
|
use function is_string;
|
||||||
use function json_decode;
|
use function json_decode;
|
||||||
use function json_encode;
|
use function json_encode;
|
||||||
@ -58,7 +59,7 @@ class LegacySkinAdapter implements SkinAdapter{
|
|||||||
$capeData = $data->isPersonaCapeOnClassic() ? "" : $data->getCapeImage()->getData();
|
$capeData = $data->isPersonaCapeOnClassic() ? "" : $data->getCapeImage()->getData();
|
||||||
|
|
||||||
$resourcePatch = json_decode($data->getResourcePatch(), true);
|
$resourcePatch = json_decode($data->getResourcePatch(), true);
|
||||||
if(isset($resourcePatch["geometry"]["default"]) && is_string($resourcePatch["geometry"]["default"])){
|
if(is_array($resourcePatch) && isset($resourcePatch["geometry"]["default"]) && is_string($resourcePatch["geometry"]["default"])){
|
||||||
$geometryName = $resourcePatch["geometry"]["default"];
|
$geometryName = $resourcePatch["geometry"]["default"];
|
||||||
}else{
|
}else{
|
||||||
throw new InvalidSkinException("Missing geometry name field");
|
throw new InvalidSkinException("Missing geometry name field");
|
||||||
|
@ -455,11 +455,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../../src/pocketmine/network/mcpe/protocol/StartGamePacket.php
|
path: ../../../src/pocketmine/network/mcpe/protocol/StartGamePacket.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot access offset 'geometry' on mixed\\.$#"
|
|
||||||
count: 3
|
|
||||||
path: ../../../src/pocketmine/network/mcpe/protocol/types/LegacySkinAdapter.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Cannot access offset string on mixed\\.$#"
|
message: "#^Cannot access offset string on mixed\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user