Code Duplication    Length = 17-18 lines in 2 locations

src/Api/Puli.php 2 locations

@@ 645-661 (lines=17) @@
642
     *
643
     * @return RepositoryManager The repository manager.
644
     */
645
    public function getRepositoryManager()
646
    {
647
        if (!$this->started) {
648
            throw new LogicException('Puli was not started');
649
        }
650
651
        if (!$this->repositoryManager && $this->context instanceof ProjectContext) {
652
            $this->repositoryManager = new RepositoryManagerImpl(
653
                $this->context,
654
                $this->getRepository(),
655
                $this->getPackageManager()->findPackages(Expr::method('isEnabled', Expr::same(true))),
656
                $this->getPackageFileStorage()
657
            );
658
        }
659
660
        return $this->repositoryManager;
661
    }
662
663
    /**
664
     * Returns the resource discovery manager.
@@ 668-685 (lines=18) @@
665
     *
666
     * @return DiscoveryManager The discovery manager.
667
     */
668
    public function getDiscoveryManager()
669
    {
670
        if (!$this->started) {
671
            throw new LogicException('Puli was not started');
672
        }
673
674
        if (!$this->discoveryManager && $this->context instanceof ProjectContext) {
675
            $this->discoveryManager = new DiscoveryManagerImpl(
676
                $this->context,
677
                $this->getDiscovery(),
678
                $this->getPackageManager()->findPackages(Expr::method('isEnabled', Expr::same(true))),
679
                $this->getPackageFileStorage(),
680
                $this->logger
681
            );
682
        }
683
684
        return $this->discoveryManager;
685
    }
686
687
    /**
688
     * Returns the asset manager.