diff --git a/controllers/SiteController.php b/controllers/SiteController.php index f959941..4ffba24 100644 --- a/controllers/SiteController.php +++ b/controllers/SiteController.php @@ -61,11 +61,10 @@ class SiteController extends Controller $model = new LoginForm(); if ($model->load(Yii::$app->request->post()) && $model->login()) { return $this->goBack(); - } else { - return $this->render('login', [ - 'model' => $model, - ]); } + return $this->render('login', [ + 'model' => $model, + ]); } public function actionLogout() @@ -82,11 +81,10 @@ class SiteController extends Controller Yii::$app->session->setFlash('contactFormSubmitted'); return $this->refresh(); - } else { - return $this->render('contact', [ - 'model' => $model, - ]); } + return $this->render('contact', [ + 'model' => $model, + ]); } public function actionAbout() diff --git a/models/ContactForm.php b/models/ContactForm.php index d4052ee..361b80b 100644 --- a/models/ContactForm.php +++ b/models/ContactForm.php @@ -57,8 +57,7 @@ class ContactForm extends Model ->send(); return true; - } else { - return false; } + return false; } } diff --git a/models/LoginForm.php b/models/LoginForm.php index 7bd44d4..227168c 100644 --- a/models/LoginForm.php +++ b/models/LoginForm.php @@ -58,9 +58,8 @@ class LoginForm extends Model { if ($this->validate()) { return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0); - } else { - return false; } + return false; } /**