Completed
Push — develop ( 4f2388...3f4b0b )
by John
02:50
created
Alpha/Model/Article.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,6 @@
 block discarded – undo
8 8
 use Alpha\Model\Type\Boolean;
9 9
 use Alpha\Model\Type\Relation;
10 10
 use Alpha\Util\Logging\Logger;
11
-use Alpha\Util\Config\Configprovider;
12 11
 use Alpha\Util\Http\Session\SessionProviderFactory;
13 12
 use Alpha\Exception\ValidationException;
14 13
 use Alpha\Exception\FileNotFoundException;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -452,7 +452,7 @@
 block discarded – undo
452 452
         }
453 453
 
454 454
         if ($vote_count > 0) {
455
-            $score = $total_score / $vote_count;
455
+            $score = $total_score/$vote_count;
456 456
         }
457 457
 
458 458
         return sprintf('%01.2f', $score);
Please login to merge, or discard this patch.
public/index.php 1 patch
Unused Use Statements   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -2,15 +2,15 @@
 block discarded – undo
2 2
 
3 3
 require_once __DIR__.'/../vendor/autoload.php';
4 4
 
5
-use Alpha\Controller\Front\FrontController;
6
-use Alpha\Util\Config\ConfigProvider;
7
-use Alpha\Util\Http\Filter\ClientBlacklistFilter;
8
-use Alpha\Util\Http\Filter\IPBlacklistFilter;
9
-use Alpha\Util\Http\Filter\ClientTempBlacklistFilter;
10
-use Alpha\Util\Http\Request;
11
-use Alpha\Util\Http\Response;
12
-use Alpha\Exception\ResourceNotFoundException;
13
-use Alpha\Exception\ResourceNotAllowedException;
5
+use Alpha\Controller\Front\FrontController;
6
+use Alpha\Util\Config\ConfigProvider;
7
+use Alpha\Util\Http\Filter\ClientBlacklistFilter;
8
+use Alpha\Util\Http\Filter\IPBlacklistFilter;
9
+use Alpha\Util\Http\Filter\ClientTempBlacklistFilter;
10
+use Alpha\Util\Http\Request;
11
+use Alpha\Util\Http\Response;
12
+use Alpha\Exception\ResourceNotFoundException;
13
+use Alpha\Exception\ResourceNotAllowedException;
14 14
 use Alpha\View\View;
15 15
 
16 16
 try {
Please login to merge, or discard this patch.
Alpha/View/Widget/Image.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
             }
243 243
         } else {
244 244
             // make a cache dir for the article
245
-            $cacheDir = $config->get('app.file.store.dir').'cache/images/article_'.mb_substr($this->source, mb_strpos($this->source, 'attachments/article_') + 20, 11);
245
+            $cacheDir = $config->get('app.file.store.dir').'cache/images/article_'.mb_substr($this->source, mb_strpos($this->source, 'attachments/article_')+20, 11);
246 246
             if (!file_exists($cacheDir)) {
247 247
                 $success = mkdir($cacheDir);
248 248
 
@@ -300,11 +300,11 @@  discard block
 block discarded – undo
300 300
             $targetScreenY = $targetScreenResolution[1];
301 301
 
302 302
             // calculate the new units we will scale by
303
-            $xu = $targetScreenX / $originalScreenX;
304
-            $yu = $targetScreenY / $originalScreenY;
303
+            $xu = $targetScreenX/$originalScreenX;
304
+            $yu = $targetScreenY/$originalScreenY;
305 305
 
306
-            $this->width = new Integer(intval($this->width->getValue() * $xu));
307
-            $this->height = new Integer(intval($this->height->getValue() * $yu));
306
+            $this->width = new Integer(intval($this->width->getValue()*$xu));
307
+            $this->height = new Integer(intval($this->height->getValue()*$yu));
308 308
 
309 309
             // need to update the cache filename as the dimensions have changed
310 310
             $this->setFilename();
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
                 if ($this->sourceType->getValue() == 'png' && $config->get('cms.images.perserve.png')) {
369 369
                     imagepng($new_image);
370 370
                 } else {
371
-                    imagejpeg($new_image, null, 100 * $this->quality->getValue());
371
+                    imagejpeg($new_image, null, 100*$this->quality->getValue());
372 372
                 }
373 373
 
374 374
                 $this->cache($new_image);
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
         if ($this->sourceType->getValue() == 'png' && $config->get('cms.images.perserve.png')) {
393 393
             imagepng($image, $this->filename);
394 394
         } else {
395
-            imagejpeg($image, $this->filename, 100 * $this->quality->getValue());
395
+            imagejpeg($image, $this->filename, 100*$this->quality->getValue());
396 396
         }
397 397
     }
398 398
 
Please login to merge, or discard this patch.
Alpha/View/DEnumView.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@
 block discarded – undo
111 111
 
112 112
         $html .= '</tr>';
113 113
 
114
-        $html .= '<tr><td colspan="'.($colCount + 1).'" style="text-align:center;">';
114
+        $html .= '<tr><td colspan="'.($colCount+1).'" style="text-align:center;">';
115 115
         // render edit buttons for admins only
116 116
         if ($session->get('currentUser') != null && $session->get('currentUser')->inGroup('Admin')) {
117 117
             $html .= '&nbsp;&nbsp;';
Please login to merge, or discard this patch.
Alpha/Task/CronManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             $task = new $taskClass();
86 86
 
87 87
             $startTime = microtime(true);
88
-            $maxAllowedTime = $startTime + $task->getMaxRunTime();
88
+            $maxAllowedTime = $startTime+$task->getMaxRunTime();
89 89
 
90 90
             self::$logger->info('Start time is ['.$startTime.'], maximum task run time is ['.$task->getMaxRunTime().']');
91 91
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             set_time_limit($task->getMaxRunTime());
94 94
             $task->doTask();
95 95
 
96
-            self::$logger->info('Done in ['.round(microtime(true) - $startTime, 5).'] seconds');
96
+            self::$logger->info('Done in ['.round(microtime(true)-$startTime, 5).'] seconds');
97 97
         }
98 98
 
99 99
         self::$logger->info('Finished processing all cron tasks');
Please login to merge, or discard this patch.
Alpha/Controller/ImageController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
             $imgWidth = $params['width'];
108 108
             $imgHeight = $params['height'];
109 109
             $imgType = $params['type'];
110
-            $imgQuality = (double) $params['quality'];
110
+            $imgQuality = (double)$params['quality'];
111 111
             $imgScale = new Boolean($params['scale']);
112 112
             $imgSecure = new Boolean($params['secure']);
113 113
         } catch (\Exception $e) {
Please login to merge, or discard this patch.
Alpha/Controller/ActiveRecordController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
         $body = '';
691 691
 
692 692
         // the index of the last record displayed on this page
693
-        $last = $this->start + $config->get('app.list.page.amount');
693
+        $last = $this->start+$config->get('app.list.page.amount');
694 694
 
695 695
         // ensure that the last index never overruns the total record count
696 696
         if ($last > $this->recordCount) {
@@ -710,9 +710,9 @@  discard block
 block discarded – undo
710 710
         if ($this->start > 0) {
711 711
             // handle secure URLs
712 712
             if ($this->request->getParam('token', null) != null) {
713
-                $body .= '<li><a href="'.FrontController::generateSecureURL('act=Alpha\Controller\ActiveRecordController&ActiveRecordType='.$this->request->getParam('ActiveRecordType').'&start='.($this->start - $this->limit).'&limit='.$this->limit).'">&lt;&lt;-Previous</a></li>';
713
+                $body .= '<li><a href="'.FrontController::generateSecureURL('act=Alpha\Controller\ActiveRecordController&ActiveRecordType='.$this->request->getParam('ActiveRecordType').'&start='.($this->start-$this->limit).'&limit='.$this->limit).'">&lt;&lt;-Previous</a></li>';
714 714
             } else {
715
-                $body .= '<li><a href="/records/'.urlencode($this->request->getParam('ActiveRecordType')).'/'.($this->start - $this->limit).'/'.$this->limit.'">&lt;&lt;-Previous</a></li>';
715
+                $body .= '<li><a href="/records/'.urlencode($this->request->getParam('ActiveRecordType')).'/'.($this->start-$this->limit).'/'.$this->limit.'">&lt;&lt;-Previous</a></li>';
716 716
             }
717 717
         } elseif ($this->recordCount > $this->limit) {
718 718
             $body .= '<li class="disabled"><a href="#">&lt;&lt;-Previous</a></li>';
@@ -742,9 +742,9 @@  discard block
 block discarded – undo
742 742
         if ($this->recordCount > $last) {
743 743
             // handle secure URLs
744 744
             if ($this->request->getParam('token', null) != null) {
745
-                $body .= '<li><a href="'.FrontController::generateSecureURL('act=Alpha\Controller\ActiveRecordController&ActiveRecordType='.$this->request->getParam('ActiveRecordType').'&start='.($this->start + $this->limit).'&limit='.$this->limit).'">Next-&gt;&gt;</a></li>';
745
+                $body .= '<li><a href="'.FrontController::generateSecureURL('act=Alpha\Controller\ActiveRecordController&ActiveRecordType='.$this->request->getParam('ActiveRecordType').'&start='.($this->start+$this->limit).'&limit='.$this->limit).'">Next-&gt;&gt;</a></li>';
746 746
             } else {
747
-                $body .= '<li><a href="/records/'.urlencode($this->request->getParam('ActiveRecordType')).'/'.($this->start + $this->limit.'/'.$this->limit).
747
+                $body .= '<li><a href="/records/'.urlencode($this->request->getParam('ActiveRecordType')).'/'.($this->start+$this->limit.'/'.$this->limit).
748 748
                     '">Next-&gt;&gt;</a></li>';
749 749
             }
750 750
         } elseif ($this->recordCount > $this->limit) {
Please login to merge, or discard this patch.
Alpha/Controller/TagController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -302,17 +302,17 @@
 block discarded – undo
302 302
                     $startTime = microtime(true);
303 303
                     $record = new $params['clearTaggedClass']();
304 304
                     $records = $record->loadAll();
305
-                    self::$logger->info('Loaded all of the active records (elapsed time ['.round(microtime(true) - $startTime, 5).'] seconds)');
305
+                    self::$logger->info('Loaded all of the active records (elapsed time ['.round(microtime(true)-$startTime, 5).'] seconds)');
306 306
                     ActiveRecord::begin();
307 307
                     $tag = new Tag();
308 308
                     $tag->deleteAllByAttribute('taggedClass', $params['clearTaggedClass']);
309
-                    self::$logger->info('Deleted all of the old tags (elapsed time ['.round(microtime(true) - $startTime, 5).'] seconds)');
309
+                    self::$logger->info('Deleted all of the old tags (elapsed time ['.round(microtime(true)-$startTime, 5).'] seconds)');
310 310
                     $this->regenerateTagsOnRecords($records);
311
-                    self::$logger->info('Saved all of the new tags (elapsed time ['.round(microtime(true) - $startTime, 5).'] seconds)');
311
+                    self::$logger->info('Saved all of the new tags (elapsed time ['.round(microtime(true)-$startTime, 5).'] seconds)');
312 312
                     self::$logger->action('Tags recreated on the ['.$params['clearTaggedClass'].'] class');
313 313
                     ActiveRecord::commit();
314 314
                     $this->setStatusMessage(View::displayUpdateMessage('Tags recreated on the '.$record->getFriendlyClassName().' class.'));
315
-                    self::$logger->info('Tags recreated on the ['.$params['clearTaggedClass'].'] class (time taken ['.round(microtime(true) - $startTime, 5).'] seconds).');
315
+                    self::$logger->info('Tags recreated on the ['.$params['clearTaggedClass'].'] class (time taken ['.round(microtime(true)-$startTime, 5).'] seconds).');
316 316
                 } catch (AlphaException $e) {
317 317
                     self::$logger->error($e->getMessage());
318 318
                     ActiveRecord::rollback();
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.