code: public function addRepository(RepositoryInterface $repository)
      {
          if ($repository instanceof self) {
              foreach ($repository->getRepositories() as $repo) {
                  $this->addRepository($repo);
              }
          } else {
              $this->repositories[] = $repository;
          }
      }
docs: Add a repository.
  @param RepositoryInterface $repository