public function addRepositories(array $repositories)
    {
        foreach ($repositories as $index => $repo) {
            $this->validateRepositories($index, $repo);

            if ('package' === $repo['type']) {
                $name = $repo['package']['name'];
            } else {
                $name = \is_int($index) ? preg_replace('{^https?://}i', '', $repo['url']) : $index;
                $name = isset($repo['name']) ? $repo['name'] : $name;
                $repo['asset-repository-manager'] = $this;
                $repo['vcs-package-filter'] = $this->packageFilter;
            }

            $repoInstance = Util::addRepository($this->io, $this->rm, $this->repositories, $name, $repo, $this->pool);

            if (null === $this->pool && $repoInstance instanceof RepositoryInterface) {
                $this->poolRepositories[] = $repoInstance;
            }
        }
    }
public function addRepositories(array $repositories)
    {
        foreach ($repositories as $index => $repo) {
            $this->validateRepositories($index, $repo);

            if ('package' === $repo['type']) {
                $name = $repo['package']['name'];
            } else {
                $name = \is_int($index) ? preg_replace('{^https?://}i', '', $repo['url']) : $index;
                $name = isset($repo['name']) ? $repo['name'] : $name;
                $repo['asset-repository-manager'] = $this;
                $repo['vcs-package-filter'] = $this->packageFilter;
            }

            $repoInstance = Util::addRepository($this->io, $this->rm, $this->repositories, $name, $repo, $this->pool);

            if (null === $this->pool && $repoInstance instanceof RepositoryInterface) {
                $this->poolRepositories[] = $repoInstance;
            }
        }
    }
public function addRepositories ( array $ repositories ) { foreach ( $ repositories as $ index => $ repo ) { $ this -> validateRepositories ( $ index , $ repo ) ; if ( 'package' === $ repo [ 'type' ] ) { $ name = $ repo [ 'package' ] [ 'name' ] ; } else { $ name = \ is_int ( $ index ) ? preg_replace ( '{^https?://}i' , '' , $ repo [ 'url' ] ) : $ index ; $ name = isset ( $ repo [ 'name' ] ) ? $ repo [ 'name' ] : $ name ; $ repo [ 'asset-repository-manager' ] = $ this ; $ repo [ 'vcs-package-filter' ] = $ this -> packageFilter ; } $ repoInstance = Util :: addRepository ( $ this -> io , $ this -> rm , $ this -> repositories , $ name , $ repo , $ this -> pool ) ; if ( null === $ this -> pool && $ repoInstance instanceof RepositoryInterface ) { $ this -> poolRepositories [ ] = $ repoInstance ; } } }
Adds asset vcs repositories.

@param array $repositories The repositories

@throws \UnexpectedValueException When config of repository is not an array
@throws \UnexpectedValueException When the config of repository has not a type defined
@throws \UnexpectedValueException When the config of repository has an invalid type
Adds asset vcs repositories .