Code Duplication    Length = 19-19 lines in 2 locations

src/Controller/Dispatcher.php 2 locations

@@ 246-264 (lines=19) @@
243
    {
244
        if (!empty($data['path']) && $uri === $data['path']) {
245
246
            if ($this->requestType === 'default' && in_array($this->request->getMethod(), $data['method'])) {
247
248
                return [
249
                    $data['controller'],
250
                    $data['action'] . 'Action',
251
                    $data['permission'] ?? null,
252
                    []
253
                ];
254
255
            } else if ($this->requestType === 'api') {
256
257
                return [
258
                    $data['controller'],
259
                    $this->getRestfulAction(),
260
                    $data['permission'] ?? null,
261
                    []
262
                ];
263
264
            }
265
266
            throw new MethodNotFoundException('Non valid request method available.');
267
@@ 344-362 (lines=19) @@
341
342
            array_splice($var, 0, 1);
343
344
            if ($this->requestType === 'default'  && in_array($this->request->getMethod(), $data['method'])) {
345
346
                return [
347
                    $data['controller'],
348
                    $data['action'] . 'Action',
349
                    $data['permission'] ?? null,
350
                    $var
351
                ];
352
353
            } else if ($this->requestType === 'api') {
354
355
                return [
356
                    $data['controller'],
357
                    $this->getRestfulAction(),
358
                    $data['permission'] ?? null,
359
                    $var
360
                ];
361
362
            }
363
364
        }
365