Code Duplication    Length = 15-15 lines in 2 locations

source/Spiral/Views/Engines/StemplerEngine.php 1 location

@@ 221-235 (lines=15) @@
218
     *
219
     * @return \Spiral\Stempler\LoaderInterface
220
     */
221
    private function wrapLoader(): \Spiral\Stempler\LoaderInterface
222
    {
223
        $processors = [];
224
        foreach ($this->modifiers as $modifier) {
225
            if (is_object($modifier)) {
226
                $processors[] = $modifier;
227
            } else {
228
                $processors[] = $this->container->make($modifier);
229
            }
230
        }
231
232
        return new LoaderBridge(
233
            new ModifiableLoader($this->environment, $this->loader, $processors)
234
        );
235
    }
236
}

source/Spiral/Views/Engines/TwigEngine.php 1 location

@@ 210-224 (lines=15) @@
207
     *
208
     * @return \Twig_LoaderInterface
209
     */
210
    private function makeLoader(): \Twig_LoaderInterface
211
    {
212
        $modifiers = [];
213
        foreach ($this->modifiers as $modifier) {
214
            if (is_object($modifier)) {
215
                $modifiers[] = $modifier;
216
            } else {
217
                $modifiers[] = $this->container->make($modifier);
218
            }
219
        }
220
221
        return new LoaderBridge(
222
            new ModifiableLoader($this->environment, $this->loader, $modifiers)
223
        );
224
    }
225
226
    /**
227
     * @return bool|TwigCache