Code Duplication    Length = 16-16 lines in 2 locations

src/Api/Puli.php 2 locations

@@ 547-562 (lines=16) @@
544
     *
545
     * @return EditableRepository The resource repository.
546
     */
547
    public function getRepository()
548
    {
549
        if (!$this->started) {
550
            throw new LogicException('Puli was not started');
551
        }
552
553
        if (!$this->context instanceof ProjectContext) {
554
            return null;
555
        }
556
557
        if (!$this->repo) {
558
            $this->repo = $this->getFactory()->createRepository();
559
        }
560
561
        return $this->repo;
562
    }
563
564
    /**
565
     * Returns the resource discovery of the project.
@@ 569-584 (lines=16) @@
566
     *
567
     * @return EditableDiscovery The resource discovery.
568
     */
569
    public function getDiscovery()
570
    {
571
        if (!$this->started) {
572
            throw new LogicException('Puli was not started');
573
        }
574
575
        if (!$this->context instanceof ProjectContext) {
576
            return null;
577
        }
578
579
        if (!$this->discovery) {
580
            $this->discovery = $this->getFactory()->createDiscovery($this->getRepository());
581
        }
582
583
        return $this->discovery;
584
    }
585
586
    /**
587
     * @return object