Completed
Pull Request — master (#163)
by Corey
02:41
created
site/models/EditProfileForm.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
   }
54 54
 
55 55
   /**
56
-     * @codeCoverageIgnore
57
-     */
56
+   * @codeCoverageIgnore
57
+   */
58 58
   public function attributeLabels() {
59 59
     return [
60 60
       'partner_email1' => "Partner Email #1",
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
         // generate scores graph image
87 87
         $checkins_last_month = (Yii::$container->get(\common\interfaces\UserBehaviorInterface::class))
88
-                                               ->getCheckInBreakdown();
88
+                                                ->getCheckInBreakdown();
89 89
 
90 90
         // if they haven't done a check-in in the last month this will explode
91 91
         // 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
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
       $graph = Yii::$container
78 78
         ->get(\common\components\Graph::class, [$this->user]);
79 79
 
80
-      if($this->timezone) {
80
+      if ($this->timezone) {
81 81
         $user->timezone = $this->timezone;
82 82
       }
83
-      if($this->expose_graph) {
83
+      if ($this->expose_graph) {
84 84
         $user->expose_graph = true;
85 85
 
86 86
         // generate scores graph image
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
         // if they haven't done a check-in in the last month this will explode
91 91
         // because $checkins_last_month is an empty array
92
-        if($checkins_last_month) {
92
+        if ($checkins_last_month) {
93 93
           $graph->create($checkins_last_month, true);
94 94
         }
95 95
       } else {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $graph->destroy();
99 99
       }
100 100
 
101
-      if($this->send_email) {
101
+      if ($this->send_email) {
102 102
         $user->send_email = true;
103 103
         $user->partner_email1  = $this->partner_email1;
104 104
         $user->partner_email2  = $this->partner_email2;
Please login to merge, or discard this patch.
common/components/Graph.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
   public function getFilepath() {
29 29
     $path = Yii::getAlias('@graphImgPath');
30 30
     $filename = $this->user->getIdHash() . ".png";
31
-    return $path. '/' . $filename;
31
+    return $path . '/' . $filename;
32 32
   }
33 33
 
34 34
   /**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
    * @return string the encoded image
62 62
    */
63 63
   public function create(array $checkins, bool $toDisk = false) {
64
-    if($toDisk) {
64
+    if ($toDisk) {
65 65
       // wipe out the current image, if it exists
66 66
       $this->destroy();
67 67
     }
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
 
82 82
     // Setup dates as labels on the X-axis
83 83
     $graph->xaxis->SetTickLabels(array_keys($checkins));
84
-    $graph->xaxis->HideTicks(false,false);
84
+    $graph->xaxis->HideTicks(false, false);
85 85
 
86 86
     $graph->yaxis->scale->SetAutoMin(0);
87 87
     $graph->yaxis->HideLine(false);
88
-    $graph->yaxis->HideTicks(false,false);
88
+    $graph->yaxis->HideTicks(false, false);
89 89
     $graph->xaxis->SetLabelAngle(45);
90 90
     $graph->xaxis->SetFont(FF_ARIAL, FS_NORMAL, 10);
91 91
     $graph->yaxis->SetFont(FF_ARIAL, FS_NORMAL, 15);
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
 
94 94
     // format the data into something nicer
95 95
     $accum = [];
96
-    foreach($checkins as $checkin_sum) {
97
-      for($i = 1; $i <= 7; $i ++) {
96
+    foreach ($checkins as $checkin_sum) {
97
+      for ($i = 1; $i <= 7; $i++) {
98 98
         $accum[$i][] = array_key_exists($i, $checkin_sum) ? $checkin_sum[$i]['count'] : 0;
99 99
       }
100 100
     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     // Create the bar plots
103 103
     $plots = [];
104 104
     $category = Yii::$container->get(\common\interfaces\CategoryInterface::class);
105
-    foreach($accum as $category_key => $category_data) {
105
+    foreach ($accum as $category_key => $category_data) {
106 106
       $bplot = new BarPlot($category_data);
107 107
       $color = $category::$colors[$category_key]['color'];
108 108
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     $graph->Add($gbbplot);
118 118
 
119 119
     $graph->legend->SetColumns(3);
120
-    $graph->legend->SetPos(0.5,0.98,'center','bottom'); // position it at the center, just above the bottom edge
120
+    $graph->legend->SetPos(0.5, 0.98, 'center', 'bottom'); // position it at the center, just above the bottom edge
121 121
 
122 122
     $img = $graph->Stroke(_IMG_HANDLER);
123 123
 
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
     imagepng($img);
126 126
     $img_data = ob_get_clean();
127 127
 
128
-    if($toDisk) {
128
+    if ($toDisk) {
129 129
       $filepath = $this->getFilepath(); 
130
-      if(!is_dir(dirname($filepath))) {
130
+      if (!is_dir(dirname($filepath))) {
131 131
         mkdir(dirname($filepath), 0766, true);
132 132
       }
133 133
 
Please login to merge, or discard this patch.