Passed
Pull Request — master (#175)
by Corey
03:02
created
site/views/profile/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,11 +71,11 @@
 block discarded – undo
71 71
 ]); ?>
72 72
             <?= $form->field($profile, 'timezone')->dropDownList(array_combine($timezones, $timezones)); ?>
73 73
             <?= $form->field($profile, 'expose_graph')->checkbox() ?>
74
-            <?php if($profile->expose_graph): ?>
74
+            <?php if ($profile->expose_graph): ?>
75 75
             <div class='alert alert-success behaviors-graph-info'>Your behaviors graph can be found at:<br /> <a id="behaviors-graph-link" target="_blank" href="<?=$graph_url?>"><?=$graph_url?></a></div>
76 76
             <?php endif; ?>
77 77
             <?= $form->field($profile, 'send_email')->checkbox() ?>
78
-            <div id='send_email_fields' <?php if(!$profile->send_email) { ?>style="display: none;"<?php } ?>>
78
+            <div id='send_email_fields' <?php if (!$profile->send_email) { ?>style="display: none;"<?php } ?>>
79 79
               <?= $form->field($profile, 'email_category')->dropdownList(Category::getCategories(), ['data-toggle' => 'tooltip', 'data-placement' => 'left', 'data-trigger' => 'hover', 'data-delay' => '{"show": 500, "hide": 100}', 'title' => 'Want to send an email with every check-in? Try setting this to "Restoration"']) ?>
80 80
               <?= $form->field($profile, 'partner_email1')->input('email'); ?>
81 81
               <?= $form->field($profile, 'partner_email2')->input('email'); ?>
Please login to merge, or discard this patch.
site/models/EditProfileForm.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
   }
61 61
 
62 62
   /**
63
-     * @codeCoverageIgnore
64
-     */
63
+   * @codeCoverageIgnore
64
+   */
65 65
   public function attributeLabels() {
66 66
     return [
67 67
       'partner_email1' => "Partner Email #1",
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
         // generate behaviors graph image
95 95
         $checkins_last_month = (Yii::$container->get(\common\interfaces\UserBehaviorInterface::class))
96
-                                               ->getCheckInBreakdown();
96
+                                                ->getCheckInBreakdown();
97 97
 
98 98
         // if they haven't done a check-in in the last month this will explode
99 99
         // because $checkins_last_month is an empty array
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
       $graph = Yii::$container
86 86
         ->get(\common\components\Graph::class, [$this->user]);
87 87
 
88
-      if($this->timezone) {
88
+      if ($this->timezone) {
89 89
         $user->timezone = $this->timezone;
90 90
       }
91
-      if($this->expose_graph) {
91
+      if ($this->expose_graph) {
92 92
         $user->expose_graph = true;
93 93
 
94 94
         // generate behaviors graph image
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
         // if they haven't done a check-in in the last month this will explode
99 99
         // because $checkins_last_month is an empty array
100
-        if($checkins_last_month) {
100
+        if ($checkins_last_month) {
101 101
           $graph->create($checkins_last_month, true);
102 102
         }
103 103
       } else {
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         $graph->destroy();
107 107
       }
108 108
 
109
-      if($this->send_email) {
109
+      if ($this->send_email) {
110 110
         $user->send_email = true;
111 111
         $user->email_category = $this->email_category;
112 112
         $user->partner_email1 = $this->partner_email1;
Please login to merge, or discard this patch.
site/controllers/CheckinController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
-        if(Yii::$app->user->identity->send_email) {
80
-          if(Yii::$app->user->identity->sendEmailReport($date)) {
79
+        if (Yii::$app->user->identity->send_email) {
80
+          if (Yii::$app->user->identity->sendEmailReport($date)) {
81 81
             Yii::$app->session->setFlash('success', 'Your check-in is complete. A notification has been sent to your report partners.');
82 82
           } else {
83 83
             Yii::$app->session->setFlash('success', 'Your check-in is complete.');
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     $raw_pie_data  = $user_behavior::decorateWithCategory($user_behavior->getBehaviorsWithCounts());
132 132
     $answer_pie    = $user_behavior->getBehaviorsByCategory($raw_pie_data);
133 133
 
134
-    $pie_data   = [
134
+    $pie_data = [
135 135
       "labels"   => array_column($answer_pie, "name"),
136 136
       "datasets" => [[
137 137
           "data"                 => array_map('intval', array_column($answer_pie, "count")),
@@ -166,14 +166,14 @@  discard block
 block discarded – undo
166 166
     $checkins = $user_behavior->getCheckInBreakdown($period);
167 167
 
168 168
     $accum = [];
169
-    foreach($checkins as $date => $cats) {
170
-      for($i = 1; $i <= 7; $i ++) {
169
+    foreach ($checkins as $date => $cats) {
170
+      for ($i = 1; $i <= 7; $i++) {
171 171
         $accum[$i][] = array_key_exists($i, $cats) ? $cats[$i]['count'] : [];
172 172
       }
173 173
     }
174 174
 
175 175
     $bar_datasets = [];
176
-    foreach($accum as $idx => $data) {
176
+    foreach ($accum as $idx => $data) {
177 177
       $bar_datasets[] = [
178 178
         'label' => ($category::getCategories())[$idx],
179 179
         'backgroundColor' => $category::$colors[$idx]['color'],
Please login to merge, or discard this patch.
site/models/SignupForm.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
    */
90 90
   public function signup() {
91 91
     $user = $this->user->findByEmail($this->email);
92
-    if(!$user) {
92
+    if (!$user) {
93 93
       // this is a brand new user
94 94
       $this->user = $this->setFields($this->user);
95 95
       $this->user->save();
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
        * this is a user that for whatever reason is trying to sign up again
104 104
        * with the same email address.
105 105
        */
106
-      if(!$user->isTokenConfirmed()) {
106
+      if (!$user->isTokenConfirmed()) {
107 107
         /*
108 108
          * they've never verified their account. We don't care if their
109 109
          * verification token is current or expired. We're resetting their
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
       $user->generateAuthKey();
132 132
       $user->generateVerifyEmailToken();
133 133
 
134
-      if($user->send_email) {
134
+      if ($user->send_email) {
135 135
         $user->send_email = true;
136 136
         $user->email_category = $this->email_category;
137 137
         $user->partner_email1 = $this->partner_email1;
Please login to merge, or discard this patch.
site/views/checkin/report.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@
 block discarded – undo
25 25
                   <th>Behavior</th>
26 26
                   <th>Category</th>
27 27
               </tr>
28
-  <?php foreach($top_behaviors as $key => $row) {
28
+  <?php foreach ($top_behaviors as $key => $row) {
29 29
   $num = $key + 1;
30
-  print "<tr>".
31
-    "<td>{$row['count']}</td>".
32
-    "<td>{$row['behavior']['name']}</td>".
33
-    "<td>{$row['behavior']['category']['name']}</td>".
30
+  print "<tr>" .
31
+    "<td>{$row['count']}</td>" .
32
+    "<td>{$row['behavior']['name']}</td>" .
33
+    "<td>{$row['behavior']['category']['name']}</td>" .
34 34
     "</tr>";
35 35
   }
36 36
   ?>
Please login to merge, or discard this patch.
site/assets/assets.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
  */
5 5
 
6 6
 // In the console environment, some path aliases may not exist. Please define these:
7
- Yii::setAlias('@webroot', __DIR__ . '/../web');
8
- Yii::setAlias('@web', '/');
7
+  Yii::setAlias('@webroot', __DIR__ . '/../web');
8
+  Yii::setAlias('@web', '/');
9 9
 
10 10
 $mainConf = yii\helpers\ArrayHelper::merge(
11 11
   require Yii::getAlias('@site/config/main.php'),
Please login to merge, or discard this patch.