Code Duplication    Length = 8-8 lines in 2 locations

src/View/Helper/Route.php 1 location

@@ 45-52 (lines=8) @@
42
43
        $path   = '';
44
45
        foreach ($routes as $routeName => $data) {
46
47
            if ($routeName === $name) {
48
                $path = preg_replace('|/\((.*)\)|', '', $data['path']);
49
                break;
50
            }
51
52
        }
53
54
        if (empty($path)) {
55
            throw new RouteInvalidException('No route for name "' . $name . '" found');

src/Controller/AbstractController.php 1 location

@@ 207-214 (lines=8) @@
204
        $routes    = array_merge($routes, $apiRoutes);
205
        $path      = '';
206
207
        foreach ($routes as $routeName => $data) {
208
209
            if ($routeName === $name) {
210
                $path = preg_replace('|/\((.*)\)|', '', $data['path']);
211
                break;
212
            }
213
214
        }
215
216
        if (empty($path)) {
217