Code Duplication    Length = 10-10 lines in 3 locations

src/Charcoal/Cms/Service/Loader/AbstractLoader.php 1 location

@@ 89-98 (lines=10) @@
86
     * @throws RuntimeException If the model factory was not previously set.
87
     * @return FactoryInterface
88
     */
89
    public function modelFactory()
90
    {
91
        if (!isset($this->modelFactory)) {
92
            throw new RuntimeException(
93
                sprintf('Model Factory is not defined for "%s"', get_class($this))
94
            );
95
        }
96
97
        return $this->modelFactory;
98
    }
99
100
    /**
101
     * Set a model collection loader.

src/Charcoal/Cms/Service/Manager/AbstractManager.php 1 location

@@ 94-103 (lines=10) @@
91
     * @throws RuntimeException If the model factory was not previously set.
92
     * @return FactoryInterface
93
     */
94
    public function modelFactory()
95
    {
96
        if (!isset($this->modelFactory)) {
97
            throw new RuntimeException(
98
                sprintf('Model Factory is not defined for "%s"', get_class($this))
99
            );
100
        }
101
102
        return $this->modelFactory;
103
    }
104
105
    /**
106
     * Set a model collection loader.

src/Charcoal/Cms/Route/GenericRoute.php 1 location

@@ 526-535 (lines=10) @@
523
     * @throws RuntimeException If the model factory was not previously set.
524
     * @return FactoryInterface
525
     */
526
    public function modelFactory()
527
    {
528
        if (!isset($this->modelFactory)) {
529
            throw new RuntimeException(
530
                sprintf('Model Factory is not defined for "%s"', get_class($this))
531
            );
532
        }
533
534
        return $this->modelFactory;
535
    }
536
537
    /**
538
     * Retrieve the model collection loader.