Code Duplication    Length = 12-13 lines in 2 locations

src/Tools/Generator.php 2 locations

@@ 288-300 (lines=13) @@
285
    {
286
        // @group tag on the method overrides that on the controller
287
        $docBlockComment = $method->getDocComment();
288
        if ($docBlockComment) {
289
            $phpdoc = new DocBlock($docBlockComment);
290
            foreach ($phpdoc->getTags() as $tag) {
291
                if ($tag->getName() === 'group') {
292
                    $routeGroup = trim($tag->getContent());
293
                    $routeGroupParts = explode("\n", $tag->getContent());
294
                    $routeGroupName = array_shift($routeGroupParts);
295
                    $routeGroupDescription = implode("\n", $routeGroupParts);
296
297
                    return [$routeGroupName, $routeGroupDescription];
298
                }
299
            }
300
        }
301
302
        $docBlockComment = $controller->getDocComment();
303
        if ($docBlockComment) {
@@ 303-314 (lines=12) @@
300
        }
301
302
        $docBlockComment = $controller->getDocComment();
303
        if ($docBlockComment) {
304
            $phpdoc = new DocBlock($docBlockComment);
305
            foreach ($phpdoc->getTags() as $tag) {
306
                if ($tag->getName() === 'group') {
307
                    $routeGroupParts = explode("\n", $tag->getContent());
308
                    $routeGroupName = array_shift($routeGroupParts);
309
                    $routeGroupDescription = implode("\n", $routeGroupParts);
310
311
                    return [$routeGroupName, $routeGroupDescription];
312
                }
313
            }
314
        }
315
316
        return [$this->config->get(('default_group')), ''];
317
    }