Code Duplication    Length = 19-19 lines in 2 locations

src/Controller/Dispatcher.php 2 locations

@@ 238-256 (lines=19) @@
235
    {
236
        if (!empty($data['path']) && $uri === $data['path']) {
237
238
            if ($this->requestType === 'default' && in_array($this->request->getMethod(), $data['method'])) {
239
240
                return [
241
                    $data['controller'],
242
                    $data['action'] . 'Action',
243
                    $data['permission'] ?? null,
244
                    []
245
                ];
246
247
            } else if ($this->requestType === 'api') {
248
249
                return [
250
                    $data['controller'],
251
                    $this->getRestfulAction(),
252
                    $data['permission'] ?? null,
253
                    []
254
                ];
255
256
            }
257
258
            throw new MethodNotFoundException('Non valid request method available.');
259
@@ 336-354 (lines=19) @@
333
334
            array_splice($var, 0, 1);
335
336
            if ($this->requestType === 'default'  && in_array($this->request->getMethod(), $data['method'])) {
337
338
                return [
339
                    $data['controller'],
340
                    $data['action'] . 'Action',
341
                    $data['permission'] ?? null,
342
                    $var
343
                ];
344
345
            } else if ($this->requestType === 'api') {
346
347
                return [
348
                    $data['controller'],
349
                    $this->getRestfulAction(),
350
                    $data['permission'] ?? null,
351
                    $var
352
                ];
353
354
            }
355
356
        }
357