protected function validatePackageRepositories($index, $repo)
    {
        if ('package' !== $repo['type']) {
            return;
        }

        if (!isset($repo['package'])) {
            throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a package definition"');
        }

        foreach (array('name', 'type', 'version', 'dist') as $key) {
            if (!isset($repo['package'][$key])) {
                throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have the "'.$key.'" key  in the package definition"');
            }
        }
    }
protected function validatePackageRepositories($index, $repo)
    {
        if ('package' !== $repo['type']) {
            return;
        }

        if (!isset($repo['package'])) {
            throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a package definition"');
        }

        foreach (array('name', 'type', 'version', 'dist') as $key) {
            if (!isset($repo['package'][$key])) {
                throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have the "'.$key.'" key  in the package definition"');
            }
        }
    }
protected function validatePackageRepositories ( $ index , $ repo ) { if ( 'package' !== $ repo [ 'type' ] ) { return ; } if ( ! isset ( $ repo [ 'package' ] ) ) { throw new \ UnexpectedValueException ( 'Repository ' . $ index . ' (' . json_encode ( $ repo ) . ') must have a package definition"' ) ; } foreach ( array ( 'name' , 'type' , 'version' , 'dist' ) as $ key ) { if ( ! isset ( $ repo [ 'package' ] [ $ key ] ) ) { throw new \ UnexpectedValueException ( 'Repository ' . $ index . ' (' . json_encode ( $ repo ) . ') must have the "' . $ key . '" key  in the package definition"' ) ; } } }
Validates the config of package repositories.

@param int|string  $index The index
@param array|mixed $repo  The config repo

@throws \UnexpectedValueException
Validates the config of package repositories .