public static function addRepositoryInstance(IOInterface $io, RepositoryManager $rm, array &$repos, $name, RepositoryInterface $repo, Pool $pool = null)
    {
        $notAddedRepo = null;

        if (!isset($repos[$name])) {
            static::writeAddRepository($io, $name);
            $notAddedRepo = $repo;
            $repos[$name] = $repo;
            $rm->addRepository($repo);

            if (null !== $pool) {
                $pool->addRepository($repo);
                $notAddedRepo = null;
            }
        }

        return $notAddedRepo;
    }
public static function addRepositoryInstance(IOInterface $io, RepositoryManager $rm, array &$repos, $name, RepositoryInterface $repo, Pool $pool = null)
    {
        $notAddedRepo = null;

        if (!isset($repos[$name])) {
            static::writeAddRepository($io, $name);
            $notAddedRepo = $repo;
            $repos[$name] = $repo;
            $rm->addRepository($repo);

            if (null !== $pool) {
                $pool->addRepository($repo);
                $notAddedRepo = null;
            }
        }

        return $notAddedRepo;
    }
public static function addRepositoryInstance ( IOInterface $ io , RepositoryManager $ rm , array & $ repos , $ name , RepositoryInterface $ repo , Pool $ pool = null ) { $ notAddedRepo = null ; if ( ! isset ( $ repos [ $ name ] ) ) { static :: writeAddRepository ( $ io , $ name ) ; $ notAddedRepo = $ repo ; $ repos [ $ name ] = $ repo ; $ rm -> addRepository ( $ repo ) ; if ( null !== $ pool ) { $ pool -> addRepository ( $ repo ) ; $ notAddedRepo = null ; } } return $ notAddedRepo ; }
Add repository instance.
The instance of repository is returned if the repository in't added in the pool.

@param IOInterface         $io    The IO instance
@param RepositoryManager   $rm    The repository mamanger
@param array               $repos The list of already repository added (passed by reference)
@param string              $name  The name of the new repository
@param RepositoryInterface $repo  The repository instance
@param null|Pool           $pool  The pool

@return null|RepositoryInterface
Add repository instance . The instance of repository is returned if the repository in t added in the pool .