Code Duplication    Length = 19-19 lines in 2 locations

src/Controller/Dispatcher.php 2 locations

@@ 248-266 (lines=19) @@
245
    {
246
        if (!empty($data['path']) && $uri === $data['path']) {
247
248
            if ($this->requestType === 'default' && in_array($this->request->getMethod(), $data['method'])) {
249
250
                return [
251
                    $data['controller'],
252
                    $data['action'] . 'Action',
253
                    $data['permission'] ?? null,
254
                    []
255
                ];
256
257
            } else if ($this->requestType === 'api') {
258
259
                return [
260
                    $data['controller'],
261
                    $this->_getRestfulAction(),
262
                    $data['permission'] ?? null,
263
                    []
264
                ];
265
266
            }
267
268
            throw new MethodNotFoundException('Non valid request method available.');
269
@@ 297-315 (lines=19) @@
294
295
            array_splice($var, 0, 1);
296
297
            if ($this->requestType === 'default'  && in_array($this->request->getMethod(), $data['method'])) {
298
299
                return [
300
                    $data['controller'],
301
                    $data['action'] . 'Action',
302
                    $data['permission'] ?? null,
303
                    $var
304
                ];
305
306
            } else if ($this->requestType === 'api') {
307
308
                return [
309
                    $data['controller'],
310
                    $this->_getRestfulAction(),
311
                    $data['permission'] ?? null,
312
                    $var
313
                ];
314
315
            }
316
317
        }
318