Code Duplication    Length = 16-16 lines in 2 locations

src/Api/Container.php 2 locations

@@ 565-580 (lines=16) @@
562
     *
563
     * @return EditableRepository The resource repository.
564
     */
565
    public function getRepository()
566
    {
567
        if (!$this->started) {
568
            throw new LogicException('Puli was not started');
569
        }
570
571
        if (!$this->context instanceof ProjectContext) {
572
            return null;
573
        }
574
575
        if (!$this->repo) {
576
            $this->repo = $this->getFactory()->createRepository();
577
        }
578
579
        return $this->repo;
580
    }
581
582
    /**
583
     * Returns the resource discovery of the project.
@@ 587-602 (lines=16) @@
584
     *
585
     * @return EditableDiscovery The resource discovery.
586
     */
587
    public function getDiscovery()
588
    {
589
        if (!$this->started) {
590
            throw new LogicException('Puli was not started');
591
        }
592
593
        if (!$this->context instanceof ProjectContext) {
594
            return null;
595
        }
596
597
        if (!$this->discovery) {
598
            $this->discovery = $this->getFactory()->createDiscovery($this->getRepository());
599
        }
600
601
        return $this->discovery;
602
    }
603
604
    /**
605
     * @return object