mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Fix PHPStan errors
This commit is contained in:
parent
ba079bd9aa
commit
a64adbfffe
@ -38,8 +38,14 @@ final class CreativeInventory{
|
||||
|
||||
private function __construct(){
|
||||
$creativeItems = json_decode(file_get_contents(Path::join(\pocketmine\BEDROCK_DATA_PATH, "creativeitems.json")), true);
|
||||
if(!is_array($creativeItems)){
|
||||
throw new SavedDataLoadingException("Invalid creative items file, expected array as root type");
|
||||
}
|
||||
|
||||
foreach($creativeItems as $data){
|
||||
if(!is_array($data)){
|
||||
throw new SavedDataLoadingException("Invalid creative items file, expected array as item type");
|
||||
}
|
||||
try{
|
||||
$item = Item::legacyJsonDeserialize($data);
|
||||
}catch(SavedDataLoadingException){
|
||||
|
Loading…
x
Reference in New Issue
Block a user