Code Duplication    Length = 17-18 lines in 2 locations

src/Api/Container.php 2 locations

@@ 693-709 (lines=17) @@
690
     *
691
     * @return RepositoryManager The repository manager.
692
     */
693
    public function getRepositoryManager()
694
    {
695
        if (!$this->started) {
696
            throw new LogicException('Puli was not started');
697
        }
698
699
        if (!$this->repositoryManager && $this->context instanceof ProjectContext) {
700
            $this->repositoryManager = new RepositoryManagerImpl(
701
                $this->context,
702
                $this->getRepository(),
703
                $this->getModuleManager()->findModules(Expr::method('isEnabled', Expr::same(true))),
704
                $this->getJsonStorage()
705
            );
706
        }
707
708
        return $this->repositoryManager;
709
    }
710
711
    /**
712
     * Returns the resource discovery manager.
@@ 716-733 (lines=18) @@
713
     *
714
     * @return DiscoveryManager The discovery manager.
715
     */
716
    public function getDiscoveryManager()
717
    {
718
        if (!$this->started) {
719
            throw new LogicException('Puli was not started');
720
        }
721
722
        if (!$this->discoveryManager && $this->context instanceof ProjectContext) {
723
            $this->discoveryManager = new DiscoveryManagerImpl(
724
                $this->context,
725
                $this->getDiscovery(),
726
                $this->getModuleManager()->findModules(Expr::method('isEnabled', Expr::same(true))),
727
                $this->getJsonStorage(),
728
                $this->logger
729
            );
730
        }
731
732
        return $this->discoveryManager;
733
    }
734
735
    /**
736
     * Returns the asset manager.