src/PatchCollection.php
public static function fromJson($json)
    {
        if (!is_object($json)) {
            $json = json_decode($json);
        }
        $collection = new static();

        foreach ($json->patches as $package => $patches) {
            foreach ($patches as $patch_json) {
                $patch = Patch::fromJson($patch_json);
                $collection->addPatch($patch);
            }
        }

        return $collection;
    }
public static function fromJson($json)
    {
        if (!is_object($json)) {
            $json = json_decode($json);
        }
        $collection = new static();

        foreach ($json->patches as $package => $patches) {
            foreach ($patches as $patch_json) {
                $patch = Patch::fromJson($patch_json);
                $collection->addPatch($patch);
            }
        }

        return $collection;
    }
public static function fromJson ( $ json ) { if ( ! is_object ( $ json ) ) { $ json = json_decode ( $ json ) ; } $ collection = new static ( ) ; foreach ( $ json -> patches as $ package => $ patches ) { foreach ( $ patches as $ patch_json ) { $ patch = Patch :: fromJson ( $ patch_json ) ; $ collection -> addPatch ( $ patch ) ; } } return $ collection ; }
Create a PatchCollection from a serialized representation.

@param $json
A json_encode'd representation of a PatchCollection.

@return PatchCollection
A PatchCollection with all of the serialized patches included.
Create a PatchCollection from a serialized representation .