@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | if ($form->load(Yii::$app->request->post()) && $form->validate()) { |
40 | 40 | $form->compiled_behaviors = $form->compileBehaviors(); |
41 | 41 | |
42 | - if(sizeof($form->compiled_behaviors) === 0) { |
|
42 | + if (sizeof($form->compiled_behaviors) === 0) { |
|
43 | 43 | return $this->redirect(['view']); |
44 | 44 | } |
45 | 45 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | return $this->redirect(['questions']); |
51 | 51 | } else { |
52 | - $behaviors = Yii::$container->get(BehaviorInterface::class)::$behaviors; |
|
52 | + $behaviors = Yii::$container->get(BehaviorInterface::class)::$behaviors; |
|
53 | 53 | return $this->render('index', [ |
54 | 54 | 'categories' => Yii::$container->get(CategoryInterface::class)::$categories, |
55 | 55 | 'model' => $form, |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $date = Yii::$container->get(TimeInterface::class)->getLocalDate(); |
65 | 65 | |
66 | 66 | $user_behaviors = $user_behavior->getUserBehaviorsWithCategory($date); |
67 | - if(count($user_behaviors) === 0) { |
|
67 | + if (count($user_behaviors) === 0) { |
|
68 | 68 | return $this->redirect(['view']); |
69 | 69 | } |
70 | 70 | |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | $form->deleteToday(); |
75 | 75 | |
76 | 76 | $behaviors = $user_behavior->findAll($form->getUserBehaviorIds()); |
77 | - if($result = $form->saveAnswers($behaviors)) { |
|
77 | + if ($result = $form->saveAnswers($behaviors)) { |
|
78 | 78 | |
79 | 79 | $score = $user_behavior->getDailyScore(); |
80 | - if(Yii::$app->user->identity->isOverThreshold($score)) { |
|
80 | + if (Yii::$app->user->identity->isOverThreshold($score)) { |
|
81 | 81 | Yii::$app->user->identity->sendEmailReport($date); |
82 | 82 | Yii::$app->session->setFlash('warning', 'Your check-in is complete. A notification has been sent to your report partners because of your high score. Reach out to them!'); |
83 | 83 | } else { |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | public function actionBlog() |
71 | 71 | { |
72 | 72 | $time = Yii::$container->get(\common\interfaces\TimeInterface::class); |
73 | - $key = "index_blog_".$time->getLocalDate('UTC'); |
|
73 | + $key = "index_blog_" . $time->getLocalDate('UTC'); |
|
74 | 74 | $posts = Yii::$app->cache->get($key); |
75 | - if($posts === false) { |
|
75 | + if ($posts === false) { |
|
76 | 76 | $posts = \Yii::$app->getModule('blog') |
77 | 77 | ->fetch() |
78 | 78 | ->parse() |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | { |
106 | 106 | $model = new \site\models\ContactForm(); |
107 | 107 | if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
108 | - if($model->sendEmail(Yii::$app->params['adminEmail'])) { |
|
108 | + if ($model->sendEmail(Yii::$app->params['adminEmail'])) { |
|
109 | 109 | Yii::$app->session->setFlash('success', 'Thank you for contacting us. We will respond to you as soon as possible.'); |
110 | 110 | } else { |
111 | 111 | Yii::$app->session->setFlash('error', 'There was an error sending email.'); |
@@ -137,10 +137,10 @@ discard block |
||
137 | 137 | public function actionSignup() |
138 | 138 | { |
139 | 139 | $model = Yii::$container->get(\site\models\SignupForm::class); |
140 | - if($model->load(Yii::$app->request->post()) && $model->validate()) { |
|
140 | + if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
|
141 | 141 | $model->signup(); |
142 | 142 | Yii::$app->getSession()->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.'); |
143 | - return $this->redirect('/',302); |
|
143 | + return $this->redirect('/', 302); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | return $this->render('signup', [ |
@@ -151,10 +151,10 @@ discard block |
||
151 | 151 | public function actionRequestPasswordReset() |
152 | 152 | { |
153 | 153 | $model = Yii::$container->get(\site\models\PasswordResetRequestForm::class); |
154 | - if($model->load(Yii::$app->request->post()) && $model->validate()) { |
|
155 | - if(!$model->sendEmail()) { |
|
154 | + if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
|
155 | + if (!$model->sendEmail()) { |
|
156 | 156 | $ip = Yii::$app->getRequest()->getUserIP() ?: "UNKNOWN"; |
157 | - Yii::warning("$ip has tried to reset the password for ".$model->email); |
|
157 | + Yii::warning("$ip has tried to reset the password for " . $model->email); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | Yii::$app->getSession()->setFlash('success', 'If there is an account with the submitted email address you will receive further instructions in your email inbox.'); |
@@ -198,14 +198,14 @@ discard block |
||
198 | 198 | 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."); |
199 | 199 | } |
200 | 200 | |
201 | - if($user->isTokenConfirmed($user->verify_email_token)) { |
|
201 | + if ($user->isTokenConfirmed($user->verify_email_token)) { |
|
202 | 202 | Yii::$app->getSession()->setFlash('success', 'Your account has already been verified. Please log in.'); |
203 | - return $this->redirect('/login',302); |
|
203 | + return $this->redirect('/login', 302); |
|
204 | 204 | } else if (Yii::$app->getUser()->login($user)) { |
205 | 205 | $user->confirmVerifyEmailToken(); |
206 | 206 | $user->save(); |
207 | 207 | Yii::$app->getSession()->setFlash('success', 'Your account has been verified. Please continue with your check-in.'); |
208 | - return $this->redirect('/welcome',302); |
|
208 | + return $this->redirect('/welcome', 302); |
|
209 | 209 | } |
210 | 210 | } |
211 | 211 |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | $graph = Yii::$container |
82 | 82 | ->get(\common\components\Graph::class, [$this->user]); |
83 | 83 | |
84 | - if($this->timezone) { |
|
84 | + if ($this->timezone) { |
|
85 | 85 | $user->timezone = $this->timezone; |
86 | 86 | } |
87 | - if($this->expose_graph) { |
|
87 | + if ($this->expose_graph) { |
|
88 | 88 | $user->expose_graph = true; |
89 | 89 | |
90 | 90 | // generate scores graph image |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | // if they haven't done a check-in in the last month this |
93 | 93 | // will explode because $scores_last_month is an empty |
94 | 94 | // array |
95 | - if($scores_last_month) { |
|
95 | + if ($scores_last_month) { |
|
96 | 96 | $graph->create($scores_last_month, true); |
97 | 97 | } |
98 | 98 | } else { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | // remove scores graph image |
101 | 101 | $graph->destroy(); |
102 | 102 | } |
103 | - if($this->send_email) { |
|
103 | + if ($this->send_email) { |
|
104 | 104 | $user->email_threshold = $this->email_threshold; |
105 | 105 | $user->partner_email1 = $this->partner_email1; |
106 | 106 | $user->partner_email2 = $this->partner_email2; |
@@ -59,8 +59,8 @@ |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | - * @codeCoverageIgnore |
|
63 | - */ |
|
62 | + * @codeCoverageIgnore |
|
63 | + */ |
|
64 | 64 | public function attributeLabels() { |
65 | 65 | return [ |
66 | 66 | 'partner_email1' => "Partner Email #1", |
@@ -35,7 +35,7 @@ |
||
35 | 35 | { |
36 | 36 | /* @var $user User */ |
37 | 37 | $user = $this->user; |
38 | - if($user->isGuest) { |
|
38 | + if ($user->isGuest) { |
|
39 | 39 | $user = $this->user->findOne([ |
40 | 40 | 'email' => $this->email, |
41 | 41 | ]); |