Code Duplication    Length = 7-7 lines in 2 locations

Admin/CommentAdmin.php 2 locations

@@ 70-76 (lines=7) @@
67
        $commentModule->setPosition(21);
68
        $commentModule->setIcon('su-comment');
69
70
        if ($this->securityChecker->hasPermission(self::COMMENT_SECURITY_CONTEXT, PermissionTypes::VIEW)) {
71
            $comments = new NavigationItem('sulu_comment.comments');
72
            $comments->setPosition(10);
73
            $comments->setMainRoute(static::COMMENT_LIST_ROUTE);
74
75
            $commentModule->addChild($comments);
76
        }
77
78
        if ($this->securityChecker->hasPermission(self::THREAD_SECURITY_CONTEXT, PermissionTypes::VIEW)) {
79
            $threads = new NavigationItem('sulu_comment.threads');
@@ 78-84 (lines=7) @@
75
            $commentModule->addChild($comments);
76
        }
77
78
        if ($this->securityChecker->hasPermission(self::THREAD_SECURITY_CONTEXT, PermissionTypes::VIEW)) {
79
            $threads = new NavigationItem('sulu_comment.threads');
80
            $threads->setPosition(20);
81
            $threads->setMainRoute(static::THREAD_LIST_ROUTE);
82
83
            $commentModule->addChild($threads);
84
        }
85
86
        if ($commentModule->hasChildren()) {
87
            $rootNavigationItem->addChild($commentModule);