Completed
Pull Request — master (#163)
by Corey
02:42
created
site/models/CheckinForm.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
   public function setBehaviors($behaviors) {
67 67
     foreach($behaviors as $category_id => $category_data) {
68 68
       $attribute = "behaviors$category_id";
69
-			$this->$attribute = [];
69
+      $this->$attribute = [];
70 70
       foreach($category_data['behaviors'] as $behavior) {
71 71
         $this->{$attribute}[] = $behavior['id'];
72 72
       }
@@ -85,12 +85,12 @@  discard block
 block discarded – undo
85 85
 
86 86
   public function compileBehaviors() {
87 87
     $behaviors = array_merge((array)$this->behaviors1,
88
-                           (array)$this->behaviors2,
89
-                           (array)$this->behaviors3,
90
-                           (array)$this->behaviors4,
91
-                           (array)$this->behaviors5,
92
-                           (array)$this->behaviors6,
93
-                           (array)$this->behaviors7);
88
+                            (array)$this->behaviors2,
89
+                            (array)$this->behaviors3,
90
+                            (array)$this->behaviors4,
91
+                            (array)$this->behaviors5,
92
+                            (array)$this->behaviors6,
93
+                            (array)$this->behaviors7);
94 94
 
95 95
     return array_filter($behaviors); // strip out false values
96 96
   }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
   }
65 65
 
66 66
   public function setBehaviors($behaviors) {
67
-    foreach($behaviors as $category_id => $category_data) {
67
+    foreach ($behaviors as $category_id => $category_data) {
68 68
       $attribute = "behaviors$category_id";
69 69
 			$this->$attribute = [];
70
-      foreach($category_data['behaviors'] as $behavior) {
70
+      foreach ($category_data['behaviors'] as $behavior) {
71 71
         $this->{$attribute}[] = $behavior['id'];
72 72
       }
73 73
     }   
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 
76 76
   public function validateBehaviors($attribute, $params) {
77 77
     if (!$this->hasErrors()) {
78
-      foreach($this->$attribute as $behavior) {
79
-        if(!is_numeric($behavior)) {
78
+      foreach ($this->$attribute as $behavior) {
79
+        if (!is_numeric($behavior)) {
80 80
           $this->addError($attribute, 'One of your behaviors is not an integer!');
81 81
         }
82 82
       }
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
   }
111 111
 
112 112
   public function save() {
113
-    if(empty($this->compiled_behaviors)) {
113
+    if (empty($this->compiled_behaviors)) {
114 114
       $this->commpiled_behaviors = $this->compileBehaviors();
115 115
     }
116 116
 
117 117
     $rows = [];
118
-    foreach($this->compiled_behaviors as $behavior_id) {
118
+    foreach ($this->compiled_behaviors as $behavior_id) {
119 119
       $temp = [
120 120
         Yii::$app->user->id,
121 121
         (int)$behavior_id,
Please login to merge, or discard this patch.
site/models/ContactForm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
     return Yii::$app->mailer->compose()
57 57
       ->setTo($email)
58 58
       ->setFrom([$this->email => $this->name])
59
-      ->setSubject("[FSA Contact] ".$this->subject)
59
+      ->setSubject("[FSA Contact] " . $this->subject)
60 60
       ->setTextBody($this->body)
61 61
       ->send();
62 62
   }
Please login to merge, or discard this patch.
site/models/QuestionForm.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -157,11 +157,11 @@
 block discarded – undo
157 157
       foreach($this->behaviorToAnswers($behavior_id) as $answer_letter => $answer) {
158 158
         $question_id = \common\models\Question::$TYPES[$answer_letter];
159 159
         array_push($answers, [
160
-                               'behavior_id'    => $user_bhvr->behavior_id,
161
-                               'user_bhvr_id' => $user_bhvr->id,
162
-                               'question_id'  => $question_id,
163
-                               'answer'       => $answer,
164
-                             ]);
160
+                                'behavior_id'    => $user_bhvr->behavior_id,
161
+                                'user_bhvr_id' => $user_bhvr->id,
162
+                                'question_id'  => $question_id,
163
+                                'answer'       => $answer,
164
+                              ]);
165 165
       }
166 166
     }
167 167
     return $answers;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         'whenClient' => "function(attribute, value) { return false; }", // lame, but acceptable
84 84
         "message" => "You must select a behavior your responses apply to."],
85 85
 
86
-      [['answer_1a','answer_1b','answer_1c','answer_2a','answer_2b','answer_2c','answer_3a','answer_3b','answer_3c','answer_4a','answer_4b','answer_4c','answer_5a', 'answer_5b','answer_5c','answer_6a', 'answer_6b','answer_6c','answer_7a','answer_7b','answer_7c'], 'safe']
86
+      [['answer_1a', 'answer_1b', 'answer_1c', 'answer_2a', 'answer_2b', 'answer_2c', 'answer_3a', 'answer_3b', 'answer_3c', 'answer_4a', 'answer_4b', 'answer_4c', 'answer_5a', 'answer_5b', 'answer_5c', 'answer_6a', 'answer_6b', 'answer_6c', 'answer_7a', 'answer_7b', 'answer_7c'], 'safe']
87 87
     ];
88 88
   }
89 89
 
@@ -101,10 +101,10 @@  discard block
 block discarded – undo
101 101
 
102 102
   public function getBhvrValidator() {
103 103
     return function($model, $attr) {
104
-      $attrNum = $attr[strlen($attr)-1];
105
-      foreach(['a', 'b', 'c'] as $l) {
104
+      $attrNum = $attr[strlen($attr) - 1];
105
+      foreach (['a', 'b', 'c'] as $l) {
106 106
         $attr = "answer_{$attrNum}{$l}";
107
-        if($model->$attr) return true;
107
+        if ($model->$attr) return true;
108 108
       }
109 109
       return false;
110 110
     };
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
   public function getPrefixProps($prefix) {
136 136
     return array_filter(get_object_vars($this), function($v, $k) use($prefix) {
137
-      if(strpos($k, $prefix) === 0 && strlen($v)) {
137
+      if (strpos($k, $prefix) === 0 && strlen($v)) {
138 138
         return true;
139 139
       }
140 140
     }, ARRAY_FILTER_USE_BOTH);
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
   public function getAnswers($bhvrs) {
153 153
     $answers = [];
154 154
     $user_bhvrs = array_combine($this->getUserBehaviorProps(), $bhvrs);
155
-    foreach($user_bhvrs as $property => $user_bhvr) {
155
+    foreach ($user_bhvrs as $property => $user_bhvr) {
156 156
       $behavior_id = intval(substr($property, -1, 1));
157
-      foreach($this->behaviorToAnswers($behavior_id) as $answer_letter => $answer) {
157
+      foreach ($this->behaviorToAnswers($behavior_id) as $answer_letter => $answer) {
158 158
         $question_id = \common\models\Question::$TYPES[$answer_letter];
159 159
         array_push($answers, [
160 160
                                'behavior_id'    => $user_bhvr->behavior_id,
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
   public function saveAnswers($bhvrs) {
171 171
     $result = true;
172
-    foreach($this->getAnswers($bhvrs) as $answer) {
172
+    foreach ($this->getAnswers($bhvrs) as $answer) {
173 173
       $model = new \common\models\Question;
174 174
       $model->user_id = Yii::$app->user->id;
175 175
       $model->behavior_id = $answer['behavior_id'];
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
       $model->date = new Expression("now()::timestamp");
178 178
       $model->question = $answer['question_id'];
179 179
       $model->answer = $answer['answer'];
180
-      if(!$model->save()) {
180
+      if (!$model->save()) {
181 181
         $result = false;
182 182
       }
183 183
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,9 @@
 block discarded – undo
104 104
       $attrNum = $attr[strlen($attr)-1];
105 105
       foreach(['a', 'b', 'c'] as $l) {
106 106
         $attr = "answer_{$attrNum}{$l}";
107
-        if($model->$attr) return true;
107
+        if($model->$attr) {
108
+          return true;
109
+        }
108 110
       }
109 111
       return false;
110 112
     };
Please login to merge, or discard this patch.
site/web/router.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,12 +7,12 @@
 block discarded – undo
7 7
 set_include_path(get_include_path().':'.__DIR__);
8 8
 if(file_exists($root.$path))
9 9
 {
10
-	if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/')
11
-		$path = rtrim($path,'/').'/index.php';
12
-	if(strpos($path,'.php') === false) return false;
13
-	else {
14
-		chdir(dirname($root.$path));
15
-		require_once $root.$path;
16
-	}
10
+  if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/')
11
+    $path = rtrim($path,'/').'/index.php';
12
+  if(strpos($path,'.php') === false) return false;
13
+  else {
14
+    chdir(dirname($root.$path));
15
+    require_once $root.$path;
16
+  }
17 17
 }else include_once 'index.php';
18 18
 ?>
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,16 +3,16 @@
 block discarded – undo
3 3
 header("Access-Control-Allow-Origin: *");
4 4
 $root = $_SERVER['DOCUMENT_ROOT'];
5 5
 chdir($root);
6
-$path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/');
7
-set_include_path(get_include_path().':'.__DIR__);
8
-if(file_exists($root.$path))
6
+$path = '/' . ltrim(parse_url($_SERVER['REQUEST_URI'])['path'], '/');
7
+set_include_path(get_include_path() . ':' . __DIR__);
8
+if (file_exists($root . $path))
9 9
 {
10
-	if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/')
11
-		$path = rtrim($path,'/').'/index.php';
12
-	if(strpos($path,'.php') === false) return false;
10
+	if (is_dir($root . $path) && substr($path, strlen($path) - 1, 1) !== '/')
11
+		$path = rtrim($path, '/') . '/index.php';
12
+	if (strpos($path, '.php') === false) return false;
13 13
 	else {
14
-		chdir(dirname($root.$path));
15
-		require_once $root.$path;
14
+		chdir(dirname($root . $path));
15
+		require_once $root . $path;
16 16
 	}
17
-}else include_once 'index.php';
17
+} else include_once 'index.php';
18 18
 ?>
Please login to merge, or discard this patch.
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,12 +7,16 @@
 block discarded – undo
7 7
 set_include_path(get_include_path().':'.__DIR__);
8 8
 if(file_exists($root.$path))
9 9
 {
10
-	if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/')
11
-		$path = rtrim($path,'/').'/index.php';
12
-	if(strpos($path,'.php') === false) return false;
13
-	else {
10
+	if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') {
11
+			$path = rtrim($path,'/').'/index.php';
12
+	}
13
+	if(strpos($path,'.php') === false) {
14
+	  return false;
15
+	} else {
14 16
 		chdir(dirname($root.$path));
15 17
 		require_once $root.$path;
16 18
 	}
17
-}else include_once 'index.php';
19
+} else {
20
+  include_once 'index.php';
21
+}
18 22
 ?>
Please login to merge, or discard this patch.
site/tests/_support/UnitTester.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 {
21 21
     use _generated\UnitTesterActions;
22 22
 
23
-   /**
24
-    * Define custom actions here
25
-    */
23
+    /**
24
+     * Define custom actions here
25
+     */
26 26
 }
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
@@ -35,12 +35,12 @@
 block discarded – undo
35 35
                 <th>Behavior</th>
36 36
                 <th>Category</th>
37 37
             </tr>
38
-<?php foreach($top_behaviors as $key => $row) {
38
+<?php foreach ($top_behaviors as $key => $row) {
39 39
 $num = $key + 1;
40
-print "<tr>".
41
-  "<td>{$row['count']}</td>".
42
-  "<td>{$row['behavior']['name']}</td>".
43
-  "<td>{$row['behavior']['category']['name']}</td>".
40
+print "<tr>" .
41
+  "<td>{$row['count']}</td>" .
42
+  "<td>{$row['behavior']['name']}</td>" .
43
+  "<td>{$row['behavior']['category']['name']}</td>" .
44 44
   "</tr>";
45 45
 }
46 46
 ?>
Please login to merge, or discard this patch.
common/tests/unit/components/TimeTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
       $this->container->set('common\interfaces\UserBehaviorInterface', '\site\tests\_support\MockUserBehavior');
25 25
       $this->container->set('common\interfaces\QuestionInterface', '\site\tests\_support\MockQuestion');
26 26
 
27
-      $this->container->set('common\interfaces\TimeInterface', function () {
27
+      $this->container->set('common\interfaces\TimeInterface', function() {
28 28
         return new \common\components\Time('America/Los_Angeles');
29 29
       });
30 30
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     public function testGetLocalTime()
42 42
     {
43
-      $this->specify('getLocalTime should function correctly', function () {
43
+      $this->specify('getLocalTime should function correctly', function() {
44 44
         expect("getLocalTime should work with user's set time", $this->assertEquals($this->time->getLocalTime(), (new DateTime("now", new DateTimeZone("America/Los_Angeles")))->format("Y-m-d H:i:s")));
45 45
         expect('getLocalTime should work with a custom timezone', $this->assertEquals($this->time->getLocalTime("UTC"), (new DateTime("now"))->format("Y-m-d H:i:s")));
46 46
       });
@@ -48,13 +48,13 @@  discard block
 block discarded – undo
48 48
 
49 49
     public function testConvertLocalToUTC()
50 50
     {
51
-      $this->specify('convertLocalToUTC should function correctly', function () {
51
+      $this->specify('convertLocalToUTC should function correctly', function() {
52 52
         $la_tz = (new DateTime("now", new DateTimeZone("America/Los_Angeles")))->format("Y-m-d H:i:s");
53 53
 
54 54
         expect('convertLocalToUTC should convert a Los Angeles tz to UTC with the included time', $this->assertEquals($this->time->convertLocalToUTC($la_tz), (new DateTime("now"))->format("Y-m-d H:i:s")));
55 55
         expect('convertLocalToUTC should convert a Los Angeles tz to UTC without the included time', $this->assertEquals($this->time->convertLocalToUTC($la_tz, false), (new DateTime("now"))->format("Y-m-d")));
56 56
         // with UTC
57
-        $this->container->set('common\interfaces\TimeInterface', function () {
57
+        $this->container->set('common\interfaces\TimeInterface', function() {
58 58
           return new \common\components\Time('UTC');
59 59
         });
60 60
         $time = $this->container->get('common\interfaces\TimeInterface');
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
 
68 68
     public function testConvertUTCToLocal()
69 69
     {
70
-      $this->specify('convertUTCToLocal should function correctly', function () {
70
+      $this->specify('convertUTCToLocal should function correctly', function() {
71 71
         $utc_tz = (new DateTime("now"))->format("Y-m-d H:i:s");
72 72
 
73 73
         expect('convertUTCToLocal should convert a UTC tz to Los Angeles with the included timezone', $this->assertEquals((new DateTime("now", new DateTimeZone("America/Los_Angeles")))->format(DateTime::ATOM), $this->time->convertUTCToLocal($utc_tz)));
74 74
         expect('convertUTCToLocal should convert a UTC tz to Los Angeles without the included timezone', $this->assertEquals($this->time->convertUTCToLocal($utc_tz, false), (new DateTime("now", new DateTimeZone("America/Los_Angeles")))->format("Y-m-d H:i:s")));
75 75
 
76 76
         // with UTC
77
-        $this->container->set('common\interfaces\TimeInterface', function () {
77
+        $this->container->set('common\interfaces\TimeInterface', function() {
78 78
           return new \common\components\Time('UTC');
79 79
         });
80 80
         $time = $this->container->get('common\interfaces\TimeInterface');
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
     public function testGetLocalDate()
89 89
     {
90
-      $this->specify('getLocalDate should function correctly', function () {
90
+      $this->specify('getLocalDate should function correctly', function() {
91 91
         expect("getLocalDate should correctly get the user's local date", $this->assertEquals($this->time->getLocalDate(), (new DateTime("now", new DateTimeZone("America/Los_Angeles")))->format("Y-m-d")));
92 92
         expect("getLocalDate should correctly get the local date of a specified timezone", $this->assertEquals($this->time->getLocalDate("UTC"), (new DateTime("now", new DateTimeZone("UTC")))->format("Y-m-d")));
93 93
       });
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         expect('getUTCBookends should return false if there is a space at the end of the time string', $this->assertFalse($this->time->getUTCBookends('2016-05-30 00:00:00 ')));
110 110
         expect('getUTCBookends should return UTC bookend times from the Los_Angeles tz', $this->assertEquals($this->time->getUTCBookends('2016-05-30'), ['2016-05-30 07:00:00', '2016-05-31 06:59:59']));
111 111
         // with UTC
112
-        $this->container->set('common\interfaces\TimeInterface', function () {
112
+        $this->container->set('common\interfaces\TimeInterface', function() {
113 113
           return new \common\components\Time('UTC');
114 114
         });
115 115
         $time = $this->container->get('common\interfaces\TimeInterface');
Please login to merge, or discard this patch.
common/config/main.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@
 block discarded – undo
10 10
       'common\interfaces\QuestionInterface' => \common\models\Question::class,
11 11
       'common\interfaces\BehaviorInterface' => \common\models\Behavior::class,
12 12
       'common\interfaces\CategoryInterface' => \common\models\Category::class,
13
-      'common\interfaces\TimeInterface' => function () {
14
-        if(Yii::$app->user->getIsGuest()) {
13
+      'common\interfaces\TimeInterface' => function() {
14
+        if (Yii::$app->user->getIsGuest()) {
15 15
           return new \common\components\Time('UTC');
16 16
         } else {
17 17
           return new \common\components\Time(Yii::$app->user->identity->timezone);
Please login to merge, or discard this patch.
site/views/checkin/old_view.php 4 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
     print $form
93 93
             ->field($model, "behaviors{$category['id']}")
94 94
             ->checkboxList($behaviors,
95
-                           ['item' => "checkboxItemTemplate"]);
95
+                            ['item' => "checkboxItemTemplate"]);
96 96
   }
97 97
   ActiveForm::end();
98 98
 
Please login to merge, or discard this patch.
Switch Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,10 +41,10 @@
 block discarded – undo
41 41
 
42 42
   <?php
43 43
               switch(true) {
44
-                case ($score < 30):
45
-                  $alert_level = "success";
46
-                  $alert_msg = "You're doing well! Keep on doing whatever it is you're doing!";
47
-                  break;
44
+              case ($score < 30):
45
+                $alert_level = "success";
46
+                $alert_msg = "You're doing well! Keep on doing whatever it is you're doing!";
47
+                break;
48 48
 
49 49
               case ($score < 40):
50 50
                 $alert_level = "info";
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 $this->title = "The Faster Scale App | Previous Check-ins";
16 16
 $time = Yii::$container->get('common\interfaces\TimeInterface');
17 17
 $this->registerJsFile('/js/checkin/view.js', ['depends' => [\site\assets\AppAsset::class]]);
18
-if($answer_pie) {
18
+if ($answer_pie) {
19 19
   $this->registerJsFile('/js/checkin/charts/pie.js', ['depends' => [\site\assets\AppAsset::class]]);
20 20
 }
21 21
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 }
26 26
 
27 27
 $pie_data = [];
28
-if($answer_pie) {
28
+if ($answer_pie) {
29 29
   $values     = array_map('intval', array_column($answer_pie, "count"));
30 30
   $labels     = array_column($answer_pie, "name");
31 31
   $colors     = array_column($answer_pie, "color");
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
   <h1>View Previous Check-ins</h1>
52 52
 
53 53
   <?php
54
-              switch(true) {
54
+              switch (true) {
55 55
                 case ($score < 30):
56 56
                   $alert_level = "success";
57 57
                   $alert_msg = "You're doing well! Keep on doing whatever it is you're doing!";
@@ -112,16 +112,16 @@  discard block
 block discarded – undo
112 112
 </div>
113 113
 
114 114
 
115
-  <?php if($questions) {
115
+  <?php if ($questions) {
116 116
   print "<h3>Processing Questions:</h3>";
117
-  foreach($questions as $behavior_id => $behavior_questions) {
117
+  foreach ($questions as $behavior_id => $behavior_questions) {
118 118
     print "<div class='well well-sm'>";
119 119
     print "<button type='button' class='btn btn-primary' disabled='disabled'>{$behavior_questions['question']['title']}</button>";
120 120
     print "<div class='row'>";
121
-    foreach($behavior_questions['answers'] as $question) { 
121
+    foreach ($behavior_questions['answers'] as $question) { 
122 122
       print "<div class='col-md-4'>";
123 123
       print "<p><strong>{$question['title']}</strong></p>";
124
-      print "<p>".Html::encode($question['answer'])."</p>";
124
+      print "<p>" . Html::encode($question['answer']) . "</p>";
125 125
       print "</div>";
126 126
     }
127 127
     print "</div></div>";
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
     'options' => ['class' => 'form-horizontal'],
137 137
   ]);
138 138
 
139
-  foreach($categories as $category) {
139
+  foreach ($categories as $category) {
140 140
     $behaviors = AH::map($behaviorsList[$category['id']], 'id', 'name');
141 141
     print $form
142 142
             ->field($model, "behaviors{$category['id']}")
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
   ActiveForm::end();
147 147
 
148 148
 $this->registerJson($past_checkin_dates, "past-checkin-dates");
149
-if($answer_pie) {
149
+if ($answer_pie) {
150 150
   $this->registerJson($pie_data, "pie_data");
151 151
 }
152 152
 ?>
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -102,9 +102,12 @@
 block discarded – undo
102 102
         <div class='card-text'>
103 103
           <?php if ($pie_data): ?>
104 104
           <canvas id='category-pie-chart'></canvas>
105
-          <?php else: ?>
105
+          <?php else {
106
+  : ?>
106 107
           <p>no data</p>
107
-          <?php endif; ?>
108
+          <?php endif;
109
+}
110
+?>
108 111
         </div>
109 112
       </div>
110 113
     </div>
Please login to merge, or discard this patch.