Code Duplication    Length = 8-8 lines in 2 locations

models/Comment.php 2 locations

@@ 108-115 (lines=8) @@
105
    /**
106
     * @return bool
107
     */
108
    public function canUpdate()
109
    {
110
        $User = \Yii::$app->getUser();
111
112
        return Comments\Module::instance()->useRbac === true
113
            ? (\Yii::$app->getUser()->can(Comments\Permission::UPDATE) || \Yii::$app->getUser()->can(Comments\Permission::UPDATE_OWN, ['Comment' => $this]))
114
            : ($User->isGuest ? false : ($this->created_by === $User->id));
115
    }
116
117
    /**
118
     * @return bool
@@ 120-127 (lines=8) @@
117
    /**
118
     * @return bool
119
     */
120
    public function canDelete()
121
    {
122
        $User = \Yii::$app->getUser();
123
124
        return Comments\Module::instance()->useRbac === true
125
            ? (\Yii::$app->getUser()->can(Comments\Permission::DELETE) || \Yii::$app->getUser()->can(Comments\Permission::DELETE_OWN, ['Comment' => $this]))
126
            : ($User->isGuest ? false : ($this->created_by === $User->id));
127
    }
128
129
    /**
130
     * @return queries\CommentQuery