Completed
Push — 2.0.0 ( e99920...adb864 )
by John
04:51
created
Alpha/Controller/SearchController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         $config = ConfigProvider::getInstance();
200 200
 
201 201
         // used to track when our pagination range ends
202
-        $end = ($this->startPoint + $config->get('app.list.page.amount'));
202
+        $end = ($this->startPoint+$config->get('app.list.page.amount'));
203 203
 
204 204
         $body = '';
205 205
 
@@ -289,14 +289,14 @@  discard block
 block discarded – undo
289 289
 
290 290
         $body = '';
291 291
 
292
-        $end = ($this->startPoint + $config->get('app.list.page.amount'));
292
+        $end = ($this->startPoint+$config->get('app.list.page.amount'));
293 293
 
294 294
         if ($end > $this->resultCount) {
295 295
             $end = $this->resultCount;
296 296
         }
297 297
 
298 298
         if ($this->resultCount > 0) {
299
-            $body .= '<p align="center">Displaying '.($this->startPoint + 1).' to '.$end.' of <strong>'.$this->resultCount.'</strong>.&nbsp;&nbsp;';
299
+            $body .= '<p align="center">Displaying '.($this->startPoint+1).' to '.$end.' of <strong>'.$this->resultCount.'</strong>.&nbsp;&nbsp;';
300 300
         } else {
301 301
             if (!empty($this->query)) {
302 302
                 $body .= View::displayUpdateMessage('There were no search results for your query.');
@@ -308,9 +308,9 @@  discard block
 block discarded – undo
308 308
         if ($this->startPoint > 0) {
309 309
             // handle secure URLs
310 310
             if (isset($params['tk'])) {
311
-                $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint - $config->get('app.list.page.amount'))).'">&laquo;</a></li>';
311
+                $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint-$config->get('app.list.page.amount'))).'">&laquo;</a></li>';
312 312
             } else {
313
-                $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/start/'.($this->startPoint - $config->get('app.list.page.amount')).'">&laquo;</a></li>';
313
+                $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/start/'.($this->startPoint-$config->get('app.list.page.amount')).'">&laquo;</a></li>';
314 314
             }
315 315
         } elseif ($this->resultCount > $config->get('app.list.page.amount')) {
316 316
             $body .= '<li class="disabled"><a href="#">&laquo;</a></li>';
@@ -336,9 +336,9 @@  discard block
 block discarded – undo
336 336
         if ($this->resultCount > $end) {
337 337
             // handle secure URLs
338 338
             if (isset($params['tk'])) {
339
-                $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint + $config->get('app.list.page.amount'))).'">Next-&gt;&gt;</a></li>';
339
+                $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint+$config->get('app.list.page.amount'))).'">Next-&gt;&gt;</a></li>';
340 340
             } else {
341
-                $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/start/'.($this->startPoint + $config->get('app.list.page.amount')).'">&raquo;</a></li>';
341
+                $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/start/'.($this->startPoint+$config->get('app.list.page.amount')).'">&raquo;</a></li>';
342 342
             }
343 343
         } elseif ($this->resultCount > $config->get('app.list.page.amount')) {
344 344
             $body .= '<li class="disabled"><a href="#">&raquo;</a></li>';
Please login to merge, or discard this patch.
Alpha/Util/Search/SearchProviderTags.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
                     if (isset($matches[$key])) {
123 123
                         // increment the weight if the same BO is tagged more than once
124
-                        $weight = intval($matches[$key]) + 1;
124
+                        $weight = intval($matches[$key])+1;
125 125
                         $matches[$key] = $weight;
126 126
                     } else {
127 127
                         $matches[$key] = 1;
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $this->numberFound = count($matches);
142 142
 
143 143
         // now paginate
144
-        $matches = array_slice($matches, $start, $limit + 5); // the +5 is just some padding in case of orphans
144
+        $matches = array_slice($matches, $start, $limit+5); // the +5 is just some padding in case of orphans
145 145
 
146 146
         // now load each object
147 147
         foreach ($matches as $key => $weight) {
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
                         if (isset($matches[$key])) {
229 229
                             // increment the weight if the same BO is tagged more than once
230
-                            $weight = intval($matches[$key]) + 1;
230
+                            $weight = intval($matches[$key])+1;
231 231
                             $matches[$key] = $weight;
232 232
                         } else {
233 233
                             $matches[$key] = 1;
Please login to merge, or discard this patch.
Alpha/Util/Logging/KPI.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 
168 168
         $this->endTime = microtime(true);
169 169
 
170
-        $this->duration = $this->endTime - $this->startTime;
170
+        $this->duration = $this->endTime-$this->startTime;
171 171
 
172 172
         $logfile = new LogProviderFile();
173 173
         $logfile->setPath($config->get('app.file.store.dir').'logs/kpi-'.$this->name->getValue().'.csv');
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
         $this->endTime = microtime(true);
191 191
 
192
-        $this->duration = $this->endTime - $this->startTime;
192
+        $this->duration = $this->endTime-$this->startTime;
193 193
 
194 194
         $logfile = new LogProviderFile();
195 195
         $logfile->setPath($config->get('app.file.store.dir').'logs/kpi-'.$this->name->getValue().'.csv');
Please login to merge, or discard this patch.
Alpha/Util/Logging/Logger.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         if ($this->level == 'DEBUG' || in_array($this->classname, $this->debugClasses)) {
130 130
             $dateTime = date('Y-m-d H:i:s');
131 131
             $this->logProvider->writeLine(array($dateTime, 'DEBUG', $this->classname, $message,
132
-                $this->request->getUserAgent(), $this->request->getIP(), gethostname(), ));
132
+                $this->request->getUserAgent(), $this->request->getIP(), gethostname(),));
133 133
         }
134 134
     }
135 135
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         if ($this->level == 'DEBUG' || $this->level == 'INFO' || in_array($this->classname, $this->debugClasses)) {
146 146
             $dateTime = date('Y-m-d H:i:s');
147 147
             $this->logProvider->writeLine(array($dateTime, 'INFO', $this->classname, $message,
148
-                $this->request->getUserAgent(), $this->request->getIP(), gethostname(), ));
148
+                $this->request->getUserAgent(), $this->request->getIP(), gethostname(),));
149 149
         }
150 150
     }
151 151
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         if ($this->level == 'DEBUG' || $this->level == 'INFO' || $this->level == 'WARN' || in_array($this->classname, $this->debugClasses)) {
162 162
             $dateTime = date('Y-m-d H:i:s');
163 163
             $this->logProvider->writeLine(array($dateTime, 'WARN', $this->classname, $message,
164
-                $this->request->getUserAgent(), $this->request->getIP(), gethostname(), ));
164
+                $this->request->getUserAgent(), $this->request->getIP(), gethostname(),));
165 165
         }
166 166
     }
167 167
 
Please login to merge, or discard this patch.
Alpha/Util/Logging/LogProviderFile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@
 block discarded – undo
140 140
     {
141 141
         $size = filesize($this->path);
142 142
 
143
-        return ($size / 1024) / 1024;
143
+        return ($size/1024)/1024;
144 144
     }
145 145
 
146 146
     /**
Please login to merge, or discard this patch.
Alpha/Util/Extension/TCPDFFacade.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         foreach ($attachments[0] as $attachmentURL) {
157 157
             $start = mb_strpos($attachmentURL, '/');
158 158
             $end = mb_strrpos($attachmentURL, '"');
159
-            $fileName = mb_substr($attachmentURL, $start + 1, $end - ($start + 1));
159
+            $fileName = mb_substr($attachmentURL, $start+1, $end-($start+1));
160 160
 
161 161
             if (method_exists($this->BO, 'getAttachmentSecureURL')) {
162 162
                 $this->content = str_replace($attachmentURL, 'href='.$this->BO->getAttachmentSecureURL($fileName), $this->content);
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         foreach ($attachments[0] as $attachmentURL) {
171 171
             $start = mb_strpos($attachmentURL, '/');
172 172
             $end = mb_strrpos($attachmentURL, '" alt');
173
-            $fileName = mb_substr($attachmentURL, $start + 1, $end - ($start + 1));
173
+            $fileName = mb_substr($attachmentURL, $start+1, $end-($start+1));
174 174
 
175 175
             if ($config->get('cms.images.widget')) {
176 176
                 // get the details of the source image
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
                     $type = 'png';
186 186
                 }
187 187
 
188
-                $img = new Image($path, $image_details[0], $image_details[1], $type, 0.95, false, (boolean) $config->get('cms.images.widget.secure'));
188
+                $img = new Image($path, $image_details[0], $image_details[1], $type, 0.95, false, (boolean)$config->get('cms.images.widget.secure'));
189 189
                 $this->content = str_replace($attachmentURL, $img->renderHTMLLink(), $this->content);
190 190
             } else {
191 191
                 // render a normal image link to the ViewAttachment controller
Please login to merge, or discard this patch.
Alpha/Util/Extension/TCPDF.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,9 +94,9 @@
 block discarded – undo
94 94
 
95 95
         try {
96 96
             if (mb_strpos($file, '/tk/') !== false) {
97
-                $start = mb_strpos($file, '/tk/') + 3;
97
+                $start = mb_strpos($file, '/tk/')+3;
98 98
                 $end = mb_strlen($file);
99
-                $tk = mb_substr($file, $start + 1, $end - ($start + 1));
99
+                $tk = mb_substr($file, $start+1, $end-($start+1));
100 100
                 $decoded = FrontController::getDecodeQueryParams($tk);
101 101
 
102 102
                 parent::Image($decoded['source'], $x, $y, $w, $h, $type, $link, $align, $resize, $dpi, $palign, $ismask, $imgmask, $border);
Please login to merge, or discard this patch.
Alpha/Util/Graph/GraphNode.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -467,9 +467,9 @@  discard block
 block discarded – undo
467 467
     public function getChildrenCenter()
468 468
     {
469 469
         $node = $this->getChildAt(0);
470
-        $node1 = $this->getChildAt(count($this->children) - 1);
470
+        $node1 = $this->getChildAt(count($this->children)-1);
471 471
 
472
-        return $node->getOffset() + (($node1->getOffset() - $node->getOffset()) + $node1->getWidth()) / 2;
472
+        return $node->getOffset()+(($node1->getOffset()-$node->getOffset())+$node1->getWidth())/2;
473 473
     }
474 474
 
475 475
     /**
@@ -529,14 +529,14 @@  discard block
 block discarded – undo
529 529
         $yc = 0;
530 530
         $xd = 0;
531 531
         $yd = 0;
532
-        $xa = $this->x + ($this->width / 2);
533
-        $ya = $this->y + $this->height;
532
+        $xa = $this->x+($this->width/2);
533
+        $ya = $this->y+$this->height;
534 534
 
535 535
         foreach ($this->children as $child) {
536
-            $xd = $xc = $child->getX() + ($child->getWidth() / 2);
536
+            $xd = $xc = $child->getX()+($child->getWidth()/2);
537 537
             $yd = $child->getY();
538 538
             $xb = $xa;
539
-            $yb = $yc = $ya + ($yd - $ya) / 2;
539
+            $yb = $yc = $ya+($yd-$ya)/2;
540 540
             $this->links[$child->id]['xa'] = $xa;
541 541
             $this->links[$child->id]['ya'] = $ya;
542 542
             $this->links[$child->id]['xb'] = $xb;
Please login to merge, or discard this patch.
Alpha/Util/Graph/TreeGraph.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
             $leftSibling = $node->getLeftSibling();
213 213
 
214 214
             if (isset($leftSibling)) {
215
-                $node->setOffset($leftSibling->getOffset() + $leftSibling->getWidth() + $this->colSpace);
215
+                $node->setOffset($leftSibling->getOffset()+$leftSibling->getWidth()+$this->colSpace);
216 216
             } else {
217 217
                 $node->setOffset(0);
218 218
             }
@@ -220,16 +220,16 @@  discard block
 block discarded – undo
220 220
             $childCount = $node->childCount();
221 221
 
222 222
             for ($i = 0; $i < $childCount; ++$i) {
223
-                $this->firstPass($node->getChildAt($i), $level + 1);
223
+                $this->firstPass($node->getChildAt($i), $level+1);
224 224
             }
225 225
 
226 226
             $midPoint = $node->getChildrenCenter();
227
-            $midPoint -= $node->getWidth() / 2;
227
+            $midPoint -= $node->getWidth()/2;
228 228
             $leftSibling = $node->getLeftSibling();
229 229
 
230 230
             if (isset($leftSibling)) {
231
-                $node->setOffset($leftSibling->getOffset() + $leftSibling->getWidth() + $this->colSpace);
232
-                $node->setModifier($node->getOffset() - $midPoint);
231
+                $node->setOffset($leftSibling->getOffset()+$leftSibling->getWidth()+$this->colSpace);
232
+                $node->setModifier($node->getOffset()-$midPoint);
233 233
 
234 234
                 $this->layout($node, $level);
235 235
             } else {
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             }
238 238
         }
239 239
 
240
-        self::$logger->debug('Memory usage at first scan ['.((memory_get_usage(true) / 1024) / 1024).' MB]');
240
+        self::$logger->debug('Memory usage at first scan ['.((memory_get_usage(true)/1024)/1024).' MB]');
241 241
     }
242 242
 
243 243
     /**
@@ -252,17 +252,17 @@  discard block
 block discarded – undo
252 252
      */
253 253
     private function secondPass($node, $level, $x = 0, $y = 0)
254 254
     {
255
-        $nodeX = $node->getOffset() + $x;
255
+        $nodeX = $node->getOffset()+$x;
256 256
         $nodeY = $y;
257 257
 
258 258
         $node->setX($nodeX);
259 259
         $node->setY($nodeY);
260 260
 
261
-        $this->height = ($this->height > $node->getY() + $node->getWidth()) ? $this->height : $node->getY() + $node->getWidth();
262
-        $this->width = ($this->width > $nodeX + $node->getWidth()) ? $this->width : $nodeX + $node->getWidth() + 10;
261
+        $this->height = ($this->height > $node->getY()+$node->getWidth()) ? $this->height : $node->getY()+$node->getWidth();
262
+        $this->width = ($this->width > $nodeX+$node->getWidth()) ? $this->width : $nodeX+$node->getWidth()+10;
263 263
 
264 264
         if ($node->childCount() > 0) {
265
-            $this->secondPass($node->getChildAt(0), $level + 1, $x + $node->getModifier(), $y + $node->getHeight() + $this->rowSpace);
265
+            $this->secondPass($node->getChildAt(0), $level+1, $x+$node->getModifier(), $y+$node->getHeight()+$this->rowSpace);
266 266
         }
267 267
 
268 268
         $rightSibling = $node->getRightSibling();
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
             $this->secondPass($rightSibling, $level, $x, $y);
272 272
         }
273 273
 
274
-        self::$logger->debug('Memory usage at second scan ['.((memory_get_usage(true) / 1024) / 1024).' MB]');
274
+        self::$logger->debug('Memory usage at second scan ['.((memory_get_usage(true)/1024)/1024).' MB]');
275 275
     }
276 276
 
277 277
     /**
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
                 $modifierSumLeft += $leftAncestor->getModifier();
301 301
             }
302 302
 
303
-            $totalGap = ($firstChildLeftNeighbour->getOffset() + $modifierSumLeft + $firstChildLeftNeighbour->getWidth() + $this->branchSpace) - ($firstChild->getOffset() + $modifierSumRight);
303
+            $totalGap = ($firstChildLeftNeighbour->getOffset()+$modifierSumLeft+$firstChildLeftNeighbour->getWidth()+$this->branchSpace)-($firstChild->getOffset()+$modifierSumRight);
304 304
 
305 305
             if ($totalGap > 0) {
306 306
                 $subTree = $node;
@@ -312,14 +312,14 @@  discard block
 block discarded – undo
312 312
                 }
313 313
 
314 314
                 $subTreeMove = $node;
315
-                $singleGap = $totalGap / $subTreesCount;
315
+                $singleGap = $totalGap/$subTreesCount;
316 316
 
317 317
                 while (isset($subTreeMove) && $subTreeMove !== $leftAncestor) {
318 318
                     $subTreeMove = $subTreeMove->getLeftSibling();
319 319
 
320 320
                     if (isset($subTreeMove)) {
321
-                        $subTreeMove->setOffset($subTreeMove->getOffset() + $totalGap);
322
-                        $subTreeMove->setModifier($subTreeMove->getModifier() + $totalGap);
321
+                        $subTreeMove->setOffset($subTreeMove->getOffset()+$totalGap);
322
+                        $subTreeMove->setModifier($subTreeMove->getModifier()+$totalGap);
323 323
                         $totalGap -= $singleGap;
324 324
                     }
325 325
                 }
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
         for ($i = 0; $i < $childCount; ++$i) {
384 384
             $child = $node->getChildAt($i);
385 385
 
386
-            $leftmostDescendant = $this->getLeftmost($child, $level + 1, $maxlevel);
386
+            $leftmostDescendant = $this->getLeftmost($child, $level+1, $maxlevel);
387 387
 
388 388
             if (isset($leftmostDescendant)) {
389 389
                 return $leftmostDescendant;
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
             $this->render();
452 452
         }
453 453
 
454
-        if (isset($this->nodes[$this->position + 1])) {
454
+        if (isset($this->nodes[$this->position+1])) {
455 455
             ++$this->position;
456 456
 
457 457
             return $this->nodes[$this->position];
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
      */
470 470
     public function hasNext()
471 471
     {
472
-        if (isset($this->nodes[$this->position + 1])) {
472
+        if (isset($this->nodes[$this->position+1])) {
473 473
             return true;
474 474
         } else {
475 475
             return false;
Please login to merge, or discard this patch.