Code Duplication    Length = 3-3 lines in 6 locations

src/Http/Traits/FluteRoutesTrait.php 6 locations

@@ 58-60 (lines=3) @@
55
56
        // if the class implements any of CRUD methods a corresponding route will be added
57
        $classInterfaces = class_implements($controllerClass);
58
        if (in_array(ControllerIndexInterface::class, $classInterfaces) === true) {
59
            $group->get($resourceName, $handler(CI::METHOD_INDEX), $params(CI::METHOD_INDEX));
60
        }
61
        if (in_array(ControllerCreateInterface::class, $classInterfaces) === true) {
62
            $group->post($resourceName, $handler(CI::METHOD_CREATE), $params(CI::METHOD_CREATE));
63
        }
@@ 61-63 (lines=3) @@
58
        if (in_array(ControllerIndexInterface::class, $classInterfaces) === true) {
59
            $group->get($resourceName, $handler(CI::METHOD_INDEX), $params(CI::METHOD_INDEX));
60
        }
61
        if (in_array(ControllerCreateInterface::class, $classInterfaces) === true) {
62
            $group->post($resourceName, $handler(CI::METHOD_CREATE), $params(CI::METHOD_CREATE));
63
        }
64
        if (in_array(ControllerReadInterface::class, $classInterfaces) === true) {
65
            $group->get($resourceName . $indexSlug, $handler(CI::METHOD_READ), $params(CI::METHOD_READ));
66
        }
@@ 64-66 (lines=3) @@
61
        if (in_array(ControllerCreateInterface::class, $classInterfaces) === true) {
62
            $group->post($resourceName, $handler(CI::METHOD_CREATE), $params(CI::METHOD_CREATE));
63
        }
64
        if (in_array(ControllerReadInterface::class, $classInterfaces) === true) {
65
            $group->get($resourceName . $indexSlug, $handler(CI::METHOD_READ), $params(CI::METHOD_READ));
66
        }
67
        if (in_array(ControllerUpdateInterface::class, $classInterfaces) === true) {
68
            $group->patch($resourceName . $indexSlug, $handler(CI::METHOD_UPDATE), $params(CI::METHOD_UPDATE));
69
        }
@@ 67-69 (lines=3) @@
64
        if (in_array(ControllerReadInterface::class, $classInterfaces) === true) {
65
            $group->get($resourceName . $indexSlug, $handler(CI::METHOD_READ), $params(CI::METHOD_READ));
66
        }
67
        if (in_array(ControllerUpdateInterface::class, $classInterfaces) === true) {
68
            $group->patch($resourceName . $indexSlug, $handler(CI::METHOD_UPDATE), $params(CI::METHOD_UPDATE));
69
        }
70
        if (in_array(ControllerDeleteInterface::class, $classInterfaces) === true) {
71
            $group->delete($resourceName . $indexSlug, $handler(CI::METHOD_DELETE), $params(CI::METHOD_DELETE));
72
        }
@@ 70-72 (lines=3) @@
67
        if (in_array(ControllerUpdateInterface::class, $classInterfaces) === true) {
68
            $group->patch($resourceName . $indexSlug, $handler(CI::METHOD_UPDATE), $params(CI::METHOD_UPDATE));
69
        }
70
        if (in_array(ControllerDeleteInterface::class, $classInterfaces) === true) {
71
            $group->delete($resourceName . $indexSlug, $handler(CI::METHOD_DELETE), $params(CI::METHOD_DELETE));
72
        }
73
74
        return $group;
75
    }
@@ 97-99 (lines=3) @@
94
        // if the class implements any of CRUD methods a corresponding route will be added
95
        // as HTML forms do not support methods other than GET/POST we use POST and special URI for update and delete.
96
        $classInterfaces = class_implements($controllerClass);
97
        if (in_array(ControllerIndexInterface::class, $classInterfaces) === true) {
98
            $group->get($subUri, $handler(CI::METHOD_INDEX), $params(CI::METHOD_INDEX));
99
        }
100
        if (in_array(ControllerCreateInterface::class, $classInterfaces) === true) {
101
            $group->post($subUri, $handler(CI::METHOD_CREATE), $params(CI::METHOD_CREATE));
102
        }