Code Duplication    Length = 12-13 lines in 2 locations

src/Tools/Generator.php 2 locations

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