Code Duplication    Length = 11-11 lines in 2 locations

modules/users/controllers/frontend/DefaultController.php 1 location

@@ 172-182 (lines=11) @@
169
     * @return User the loaded model
170
     * @throws NotFoundHttpException if the model cannot be found
171
     */
172
    protected function findModel()
173
    {
174
        if (!Yii::$app->user->isGuest) {
175
            /** @var \modules\users\models\User $identity */
176
            $identity = Yii::$app->user->identity;
177
            if (($model = User::findOne($identity->id)) !== null) {
178
                return $model;
179
            }
180
        }
181
        throw new NotFoundHttpException(Module::t('module', 'The requested page does not exist.'));
182
    }
183
184
    /**
185
     * @param string $message

modules/users/controllers/frontend/ProfileController.php 1 location

@@ 148-158 (lines=11) @@
145
     * @return User the loaded model
146
     * @throws NotFoundHttpException if the model cannot be found
147
     */
148
    protected function findModel()
149
    {
150
        if (!Yii::$app->user->isGuest) {
151
            /** @var \modules\users\models\User $identity */
152
            $identity = Yii::$app->user->identity;
153
            if (($model = User::findOne($identity->id)) !== null) {
154
                return $model;
155
            }
156
        }
157
        throw new NotFoundHttpException(Module::t('module', 'The requested page does not exist.'));
158
    }
159
}
160