src/lib/Herrera/Phar/Update/Manifest.php
private static function create($decoded, Json $json)
    {
        $json->validate(
            $json->decodeFile(PHAR_UPDATE_MANIFEST_SCHEMA),
            $decoded
        );

        $updates = array();

        foreach ($decoded as $update) {
            $updates[] = new Update(
                $update->name,
                $update->sha1,
                $update->url,
                Parser::toVersion($update->version),
                isset($update->publicKey) ? $update->publicKey : null
            );
        }

        usort(
            $updates,
            function (Update $a, Update $b) {
                return Comparator::isGreaterThan(
                    $a->getVersion(),
                    $b->getVersion()
                );
            }
        );

        return new static($updates);
    }
private static function create($decoded, Json $json)
    {
        $json->validate(
            $json->decodeFile(PHAR_UPDATE_MANIFEST_SCHEMA),
            $decoded
        );

        $updates = array();

        foreach ($decoded as $update) {
            $updates[] = new Update(
                $update->name,
                $update->sha1,
                $update->url,
                Parser::toVersion($update->version),
                isset($update->publicKey) ? $update->publicKey : null
            );
        }

        usort(
            $updates,
            function (Update $a, Update $b) {
                return Comparator::isGreaterThan(
                    $a->getVersion(),
                    $b->getVersion()
                );
            }
        );

        return new static($updates);
    }
private static function create ( $ decoded , Json $ json ) { $ json -> validate ( $ json -> decodeFile ( PHAR_UPDATE_MANIFEST_SCHEMA ) , $ decoded ) ; $ updates = array ( ) ; foreach ( $ decoded as $ update ) { $ updates [ ] = new Update ( $ update -> name , $ update -> sha1 , $ update -> url , Parser :: toVersion ( $ update -> version ) , isset ( $ update -> publicKey ) ? $ update -> publicKey : null ) ; } usort ( $ updates , function ( Update $ a , Update $ b ) { return Comparator :: isGreaterThan ( $ a -> getVersion ( ) , $ b -> getVersion ( ) ) ; } ) ; return new static ( $ updates ) ; }
Validates the data, processes it, and returns a new instance of Manifest.

@param array $decoded The decoded JSON data.
@param Json  $json    The Json instance used to decode the data.

@return Manifest The new instance.
Validates the data processes it and returns a new instance of Manifest .