Code Duplication    Length = 17-18 lines in 2 locations

src/Api/Puli.php 2 locations

@@ 666-682 (lines=17) @@
663
     *
664
     * @return RepositoryManager The repository manager.
665
     */
666
    public function getRepositoryManager()
667
    {
668
        if (!$this->started) {
669
            throw new LogicException('Puli was not started');
670
        }
671
672
        if (!$this->repositoryManager && $this->context instanceof ProjectContext) {
673
            $this->repositoryManager = new RepositoryManagerImpl(
674
                $this->context,
675
                $this->getRepository(),
676
                $this->getPackageManager()->findPackages(Expr::method('isEnabled', Expr::same(true))),
677
                $this->getPackageFileStorage()
678
            );
679
        }
680
681
        return $this->repositoryManager;
682
    }
683
684
    /**
685
     * Returns the resource discovery manager.
@@ 689-706 (lines=18) @@
686
     *
687
     * @return DiscoveryManager The discovery manager.
688
     */
689
    public function getDiscoveryManager()
690
    {
691
        if (!$this->started) {
692
            throw new LogicException('Puli was not started');
693
        }
694
695
        if (!$this->discoveryManager && $this->context instanceof ProjectContext) {
696
            $this->discoveryManager = new DiscoveryManagerImpl(
697
                $this->context,
698
                $this->getDiscovery(),
699
                $this->getPackageManager()->findPackages(Expr::method('isEnabled', Expr::same(true))),
700
                $this->getPackageFileStorage(),
701
                $this->logger
702
            );
703
        }
704
705
        return $this->discoveryManager;
706
    }
707
708
    /**
709
     * Returns the asset manager.