Code Duplication    Length = 15-15 lines in 2 locations

src/View/TwigView.php 2 locations

@@ 240-254 (lines=15) @@
237
     * @throws \Exception
238
     * @return string
239
     */
240
    protected function _getViewFileName($name = null): string
241
    {
242
        $rethrow = new Exception('You\'re not supposed to get here');
243
        foreach ($this->extensions as $extension) {
244
            $this->_ext = $extension;
245
            try {
246
                return parent::_getViewFileName($name);
247
            } catch (Exception $exception) {
248
                $rethrow = $exception;
249
            }
250
        }
251
252
        throw $rethrow;
253
    }
254
255
    /**
256
     * @param  string|null $name
257
     * @throws \Exception
@@ 260-274 (lines=15) @@
257
     * @throws \Exception
258
     * @return string
259
     */
260
    protected function _getLayoutFileName($name = null): string
261
    {
262
        $rethrow = new Exception('You\'re not supposed to get here');
263
        foreach ($this->extensions as $extension) {
264
            $this->_ext = $extension;
265
            try {
266
                return parent::_getLayoutFileName($name);
267
            } catch (Exception $exception) {
268
                $rethrow = $exception;
269
            }
270
        }
271
272
        throw $rethrow;
273
    }
274
275
    /**
276
     * @param  string      $name
277
     * @param  bool        $pluginCheck