Completed
Pull Request — develop (#300)
by John
06:42 queued 02:25
created
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 2 patches
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.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
      *
89 89
      * @param Alpha\Util\Http\Request $request
90 90
      *
91
-     * @return Alpha\Util\Http\Response
91
+     * @return Response
92 92
      *
93 93
      * @since 1.0
94 94
      */
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/Extension/TCPDFFacade.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -238,14 +238,14 @@  discard block
 block discarded – undo
238 238
         self::$logger->debug('<<__construct()');
239 239
     }
240 240
 
241
-     /**
242
-      * Facade method which will invoke our custom markdown class rather than the standard one.
243
-      *
244
-      * @since 1.0
245
-      */
246
-     private function markdown($text, $attachURL = '')
247
-     {
248
-         $config = ConfigProvider::getInstance();
241
+        /**
242
+         * Facade method which will invoke our custom markdown class rather than the standard one.
243
+         *
244
+         * @since 1.0
245
+         */
246
+        private function markdown($text, $attachURL = '')
247
+        {
248
+            $config = ConfigProvider::getInstance();
249 249
 
250 250
         /*
251 251
          * Initialize the parser and return the result of its transform method.
@@ -253,9 +253,9 @@  discard block
 block discarded – undo
253 253
          */
254 254
         static $parser;
255 255
 
256
-         if (!isset($parser)) {
257
-             $parser = new \Alpha\Util\Extension\Markdown();
258
-         }
256
+            if (!isset($parser)) {
257
+                $parser = new \Alpha\Util\Extension\Markdown();
258
+            }
259 259
 
260 260
         /*
261 261
          * Replace all instances of $sysURL in the text with the app.url setting from config
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 
266 266
         // transform text using parser.
267 267
         return $parser->transform($text);
268
-     }
268
+        }
269 269
 
270 270
     /**
271 271
      * Fetter for the content.
Please login to merge, or discard this 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/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.
Alpha/Util/Helper/Validator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -379,6 +379,6 @@
 block discarded – undo
379 379
      */
380 380
     public static function isBase64($value)
381 381
     {
382
-        return (bool) preg_match('/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/', $value);
382
+        return (bool)preg_match('/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/', $value);
383 383
     }
384 384
 }
Please login to merge, or discard this patch.
Alpha/Util/Http/PHPServerUtils.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
             // Execute the command and store the process ID
98 98
             $output = array();
99 99
             exec($command, $output);
100
-            $pid = (int) $output[0];
100
+            $pid = (int)$output[0];
101 101
         }
102 102
 
103 103
         if (!isset($pid)) {
Please login to merge, or discard this patch.
Alpha/Model/ActiveRecordProviderSQLite.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -981,8 +981,8 @@  discard block
 block discarded – undo
981 981
                 $stmt->bindValue(':OID', $this->BO->getOID(), SQLITE3_INTEGER);
982 982
 
983 983
                 $temp = $this->BO->getVersionNumber()->getValue();
984
-                $this->BO->set('version_num', $temp + 1);
985
-                $stmt->bindValue(':version_num', $temp + 1, SQLITE3_INTEGER);
984
+                $this->BO->set('version_num', $temp+1);
985
+                $stmt->bindValue(':version_num', $temp+1, SQLITE3_INTEGER);
986 986
 
987 987
                 $stmt->execute();
988 988
             } else {
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
         } else {
1066 1066
             // there has been an error, so decrement the version number back
1067 1067
             $temp = $this->BO->getVersionNumber()->getValue();
1068
-            $this->BO->set('version_num', $temp - 1);
1068
+            $this->BO->set('version_num', $temp-1);
1069 1069
 
1070 1070
             throw new FailedSaveException('Failed to save object, SQLite error is ['.self::getLastDatabaseError().'], query ['.$this->BO->getLastQuery().']');
1071 1071
         }
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
         $this->BO->setLastQuery($sqlQuery);
1091 1091
         $stmt = self::getConnection()->prepare($sqlQuery);
1092 1092
 
1093
-        $newVersionNumber = $this->BO->getVersionNumber()->getValue() + 1;
1093
+        $newVersionNumber = $this->BO->getVersionNumber()->getValue()+1;
1094 1094
 
1095 1095
         if ($stmt instanceof SQLite3Stmt) {
1096 1096
             if ($this->BO->getPropObject($attribute) instanceof Integer) {
Please login to merge, or discard this patch.
Alpha/Controller/CacheController.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      *
92 92
      * @param Alpha\Util\Http\Request $request
93 93
      *
94
-     * @return Alpha\Util\Http\Response
94
+     * @return Response
95 95
      *
96 96
      * @since 1.0
97 97
      */
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
      *
116 116
      * @param Alpha\Util\Http\Request $request
117 117
      *
118
-     * @return Alpha\Util\Http\Response
118
+     * @return Response
119 119
      *
120 120
      * @since 1.0
121 121
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@
 block discarded – undo
207 207
 
208 208
             if (isset($params['clearCache']) && $params['clearCache'] == 'true') {
209 209
                 try {
210
-                    FileUtils::deleteDirectoryContents($this->dataDir, array('.htaccess','html','images','pdf','xls'));
210
+                    FileUtils::deleteDirectoryContents($this->dataDir, array('.htaccess', 'html', 'images', 'pdf', 'xls'));
211 211
 
212 212
                     $this->setStatusMessage(View::displayUpdateMessage('Cache contents deleted successfully.'));
213 213
 
Please login to merge, or discard this patch.