Code Duplication    Length = 11-11 lines in 2 locations

src/GenericRouteGenerator.php 2 locations

@@ 178-188 (lines=11) @@
175
            $optionalPattern .= '{' . $parameter . '}/';
176
177
            // Add SamsonPHP specific async method
178
            foreach (array(Route::METHOD_GET, Route::METHOD_POST) as $httpMethod) {
179
                // Add route for this controller action
180
                $routes->add(
181
                    new Route(
182
                        $optionalPattern,
183
                        $module->id.'#'.$method, // Route callback
184
                        $module->id . '_' . $httpMethod . '_' . $method.'_'.$parameter, // Route identifier
185
                        $async . $httpMethod // Prepend async prefix to method if found
186
                    )
187
                );
188
            }
189
        }
190
191
        // Add SamsonPHP without optional parameters
@@ 192-202 (lines=11) @@
189
        }
190
191
        // Add SamsonPHP without optional parameters
192
        foreach (array(Route::METHOD_GET, Route::METHOD_POST) as $httpMethod) {
193
            // Add route for this controller action
194
            $routes->add(
195
                new Route(
196
                    $pattern,
197
                    $module->id.'#'.$method, // Route callback
198
                    $module->id . '_' . $httpMethod . '_' . $method, // Route identifier
199
                    $async . $httpMethod // Prepend async prefix to method if found
200
                )
201
            );
202
        }
203
204
        return $routes;
205
    }