Code Duplication    Length = 15-15 lines in 2 locations

src/View/TwigView.php 2 locations

@@ 205-219 (lines=15) @@
202
     * @throws \Exception
203
     * @return string
204
     */
205
    protected function _getViewFileName($name = null): string
206
    {
207
        $rethrow = new Exception('You\'re not supposed to get here');
208
        foreach ($this->extensions as $extension) {
209
            $this->_ext = $extension;
210
            try {
211
                return parent::_getViewFileName($name);
212
            } catch (Exception $exception) {
213
                $rethrow = $exception;
214
            }
215
        }
216
217
        throw $rethrow;
218
    }
219
220
    /**
221
     * @param  string|null $name
222
     * @throws \Exception
@@ 225-239 (lines=15) @@
222
     * @throws \Exception
223
     * @return string
224
     */
225
    protected function _getLayoutFileName($name = null): string
226
    {
227
        $rethrow = new Exception('You\'re not supposed to get here');
228
        foreach ($this->extensions as $extension) {
229
            $this->_ext = $extension;
230
            try {
231
                return parent::_getLayoutFileName($name);
232
            } catch (Exception $exception) {
233
                $rethrow = $exception;
234
            }
235
        }
236
237
        throw $rethrow;
238
    }
239
240
    /**
241
     * @param  string      $name
242
     * @param  bool        $pluginCheck