Code Duplication    Length = 16-16 lines in 2 locations

src/Api/Container.php 2 locations

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