Code Duplication    Length = 3-5 lines in 2 locations

models/Content.php 1 location

@@ 100-102 (lines=3) @@
97
    {
98
        if ($user->can('setFlowContent')) {
99
            return self::find()->joinWith(['type']);
100
        } elseif ($user->can('setOwnFlowContent') && $user->identity instanceof \app\models\User) {
101
            return self::find()->joinWith(['type', 'flow.users'])->where(['username' => $user->identity->username]);
102
        }
103
    }
104
105
    /**

models/Flow.php 1 location

@@ 136-140 (lines=5) @@
133
     */
134
    public static function availableQuery($user)
135
    {
136
        if ($user->can('setFlowContent')) {
137
            return self::find();
138
        } elseif ($user->can('setOwnFlowContent') && $user->identity instanceof \app\models\User) {
139
            return self::find()->joinWith(['users'])->where(['username' => $user->identity->username]);
140
        }
141
    }
142
143
    /**