Code Duplication    Length = 17-18 lines in 2 locations

src/Api/Puli.php 2 locations

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