Completed
Pull Request — master (#171)
by Corey
02:56
created
site/controllers/SiteController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
   public function actionBlog()
56 56
   {
57 57
     $time = Yii::$container->get(\common\interfaces\TimeInterface::class); 
58
-    $key = "index_blog_".$time->getLocalDate('UTC');
58
+    $key = "index_blog_" . $time->getLocalDate('UTC');
59 59
     $posts = Yii::$app->cache->get($key);
60
-    if($posts === false) {
60
+    if ($posts === false) {
61 61
       $posts = \Yii::$app->getModule('blog')
62 62
                             ->fetch()
63 63
                             ->parse()
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
   {
91 91
     $model = new \site\models\ContactForm();
92 92
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
93
-      if($model->sendEmail(Yii::$app->params['adminEmail'])) {
93
+      if ($model->sendEmail(Yii::$app->params['adminEmail'])) {
94 94
         Yii::$app->session->setFlash('success', 'Thank you for contacting us. We will respond to you as soon as possible.');
95 95
       } else {
96 96
         Yii::$app->session->setFlash('error', 'There was an error sending email.');
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
   public function actionSignup()
123 123
   {
124 124
     $model = Yii::$container->get(\site\models\SignupForm::class);
125
-    if($model->load(Yii::$app->request->post()) && $model->validate()) {
125
+    if ($model->load(Yii::$app->request->post()) && $model->validate()) {
126 126
       $model->signup();
127 127
       Yii::$app->session->setFlash('success', 'We have sent a verification email to the email address you provided. Please check your inbox and follow the instructions to verify your account.');
128
-      return $this->redirect('/',302);
128
+      return $this->redirect('/', 302);
129 129
     }
130 130
 
131 131
     return $this->render('signup', [
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
   public function actionRequestPasswordReset()
137 137
   {
138 138
     $model = Yii::$container->get(\site\models\PasswordResetRequestForm::class);
139
-    if($model->load(Yii::$app->request->post()) && $model->validate()) {
140
-      if(!$model->sendEmail()) {
139
+    if ($model->load(Yii::$app->request->post()) && $model->validate()) {
140
+      if (!$model->sendEmail()) {
141 141
         $ip = Yii::$app->getRequest()->getUserIP() ?: "UNKNOWN";
142
-        Yii::warning("$ip has tried to reset the password for ".$model->email);
142
+        Yii::warning("$ip has tried to reset the password for " . $model->email);
143 143
       }
144 144
 
145 145
       Yii::$app->session->setFlash('success', 'If there is an account with the submitted email address you will receive further instructions in your email inbox.');
@@ -183,14 +183,14 @@  discard block
 block discarded – undo
183 183
       throw new BadRequestHttpException("Wrong or expired email verification token. If you aren't sure why this error occurs perhaps you've already verified your account. Please try logging in.");
184 184
     }
185 185
 
186
-    if($user->isTokenConfirmed($user->verify_email_token)) {
186
+    if ($user->isTokenConfirmed($user->verify_email_token)) {
187 187
       Yii::$app->session->setFlash('success', 'Your account has already been verified. Please log in.');
188
-      return $this->redirect('/login',302);
188
+      return $this->redirect('/login', 302);
189 189
     } else if (Yii::$app->getUser()->login($user)) {
190 190
       $user->confirmVerifyEmailToken();
191 191
       $user->save();
192 192
       Yii::$app->session->setFlash('success', 'Your account has been verified. Please continue with your check-in.');
193
-      return $this->redirect('/welcome',302);
193
+      return $this->redirect('/welcome', 302);
194 194
     }
195 195
   }
196 196
 
Please login to merge, or discard this patch.
common/components/View.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         }
37 37
 
38 38
         if (!empty($this->json)) {
39
-          foreach($this->json[self::POS_READY] as $json_name => $json_value) {
39
+          foreach ($this->json[self::POS_READY] as $json_name => $json_value) {
40 40
             $lines[] = Html::script($json_value, ['type' => 'application/json', 'id' => $json_name]);
41 41
           }
42 42
         }
Please login to merge, or discard this patch.
common/components/Controller.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@
 block discarded – undo
33 33
   {
34 34
     return [
35 35
       'error' => [
36
-         'class' => 'yii\web\ErrorAction',
37
-       ],
36
+          'class' => 'yii\web\ErrorAction',
37
+        ],
38 38
       'captcha' => [
39 39
         'class' => 'yii\captcha\CaptchaAction',
40 40
       ],
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
       return false;
20 20
     }
21 21
 
22
-    if(!parent::beforeAction($action)) {
22
+    if (!parent::beforeAction($action)) {
23 23
       return false;
24 24
     }
25 25
 
Please login to merge, or discard this patch.
common/models/LoginForm.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,10 +60,10 @@
 block discarded – undo
60 60
    */
61 61
   public function login()
62 62
   {
63
-    if($this->validate()) {
63
+    if ($this->validate()) {
64 64
       $user = $this->getUser();
65
-      if($user->isVerified()) {
66
-        return Yii::$app->user->login($user, $this->rememberMe ? 3600 * 24 * 30 : 0);
65
+      if ($user->isVerified()) {
66
+        return Yii::$app->user->login($user, $this->rememberMe ? 3600*24*30 : 0);
67 67
       } else {
68 68
         Yii::$app->session->setFlash('warning', 'You must verify your account before you can proceed. Please check your email inbox for a verification email and follow the instructions.');
69 69
       }
Please login to merge, or discard this patch.