@@ -85,7 +85,7 @@ discard block |
||
| 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 |
||
| 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'); |
@@ -615,7 +615,7 @@ |
||
| 615 | 615 | } |
| 616 | 616 | } |
| 617 | 617 | |
| 618 | - // route URIs with params missing (will attempt to layer on defaults later on in Request class) |
|
| 618 | + // route URIs with params missing (will attempt to layer on defaults later on in Request class) |
|
| 619 | 619 | foreach ($this->routes as $route => $callback) { |
| 620 | 620 | $pattern = '#^'.$route.'$#s'; |
| 621 | 621 | $pattern = preg_replace('#\/\{\S+\}#', '\/?', $pattern); |
@@ -175,145 +175,145 @@ discard block |
||
| 175 | 175 | throw new BadRequestException('Request character encoding does not match expected UTF-8'); |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - $this->addRoute('/', function ($request) { |
|
| 178 | + $this->addRoute('/', function($request) { |
|
| 179 | 179 | $controller = new IndexController(); |
| 180 | 180 | |
| 181 | 181 | return $controller->process($request); |
| 182 | 182 | }); |
| 183 | 183 | |
| 184 | - $this->addRoute('/a/{title}/{view}', function ($request) { |
|
| 184 | + $this->addRoute('/a/{title}/{view}', function($request) { |
|
| 185 | 185 | $controller = new ArticleController(); |
| 186 | 186 | |
| 187 | 187 | return $controller->process($request); |
| 188 | 188 | })->value('title', null)->value('view', 'detailed'); |
| 189 | 189 | |
| 190 | - $this->addRoute('/articles/{start}/{limit}', function ($request) { |
|
| 190 | + $this->addRoute('/articles/{start}/{limit}', function($request) { |
|
| 191 | 191 | $controller = new ArticleController(); |
| 192 | 192 | |
| 193 | 193 | return $controller->process($request); |
| 194 | 194 | })->value('start', 0)->value('limit', $config->get('app.list.page.amount')); |
| 195 | 195 | |
| 196 | - $this->addRoute('/attach/{articleID}/{filename}', function ($request) { |
|
| 196 | + $this->addRoute('/attach/{articleID}/{filename}', function($request) { |
|
| 197 | 197 | $controller = new AttachmentController(); |
| 198 | 198 | |
| 199 | 199 | return $controller->process($request); |
| 200 | 200 | }); |
| 201 | 201 | |
| 202 | - $this->addRoute('/cache', function ($request) { |
|
| 202 | + $this->addRoute('/cache', function($request) { |
|
| 203 | 203 | $controller = new CacheController(); |
| 204 | 204 | |
| 205 | 205 | return $controller->process($request); |
| 206 | 206 | }); |
| 207 | 207 | |
| 208 | - $this->addRoute('/denum/{denumID}', function ($request) { |
|
| 208 | + $this->addRoute('/denum/{denumID}', function($request) { |
|
| 209 | 209 | $controller = new DEnumController(); |
| 210 | 210 | |
| 211 | 211 | return $controller->process($request); |
| 212 | 212 | })->value('denumID', null); |
| 213 | 213 | |
| 214 | - $this->addRoute('/excel/{ActiveRecordType}/{ActiveRecordID}', function ($request) { |
|
| 214 | + $this->addRoute('/excel/{ActiveRecordType}/{ActiveRecordID}', function($request) { |
|
| 215 | 215 | $controller = new ExcelController(); |
| 216 | 216 | |
| 217 | 217 | return $controller->process($request); |
| 218 | 218 | })->value('ActiveRecordID', null); |
| 219 | 219 | |
| 220 | - $this->addRoute('/feed/{ActiveRecordType}/{type}', function ($request) { |
|
| 220 | + $this->addRoute('/feed/{ActiveRecordType}/{type}', function($request) { |
|
| 221 | 221 | $controller = new FeedController(); |
| 222 | 222 | |
| 223 | 223 | return $controller->process($request); |
| 224 | 224 | })->value('type', 'Atom'); |
| 225 | 225 | |
| 226 | - $this->addRoute('/gensecure', function ($request) { |
|
| 226 | + $this->addRoute('/gensecure', function($request) { |
|
| 227 | 227 | $controller = new GenSecureQueryStringController(); |
| 228 | 228 | |
| 229 | 229 | return $controller->process($request); |
| 230 | 230 | }); |
| 231 | 231 | |
| 232 | - $this->addRoute('/image/{source}/{width}/{height}/{type}/{quality}/{scale}/{secure}/{var1}/{var2}', function ($request) { |
|
| 232 | + $this->addRoute('/image/{source}/{width}/{height}/{type}/{quality}/{scale}/{secure}/{var1}/{var2}', function($request) { |
|
| 233 | 233 | $controller = new ImageController(); |
| 234 | 234 | |
| 235 | 235 | return $controller->process($request); |
| 236 | 236 | })->value('var1', null)->value('var2', null); |
| 237 | 237 | |
| 238 | - $this->addRoute('/listactiverecords', function ($request) { |
|
| 238 | + $this->addRoute('/listactiverecords', function($request) { |
|
| 239 | 239 | $controller = new ListActiveRecordsController(); |
| 240 | 240 | |
| 241 | 241 | return $controller->process($request); |
| 242 | 242 | }); |
| 243 | 243 | |
| 244 | - $this->addRoute('/log/{logPath}', function ($request) { |
|
| 244 | + $this->addRoute('/log/{logPath}', function($request) { |
|
| 245 | 245 | $controller = new LogController(); |
| 246 | 246 | |
| 247 | 247 | return $controller->process($request); |
| 248 | 248 | }); |
| 249 | 249 | |
| 250 | - $this->addRoute('/login', function ($request) { |
|
| 250 | + $this->addRoute('/login', function($request) { |
|
| 251 | 251 | $controller = new LoginController(); |
| 252 | 252 | |
| 253 | 253 | return $controller->process($request); |
| 254 | 254 | }); |
| 255 | 255 | |
| 256 | - $this->addRoute('/logout', function ($request) { |
|
| 256 | + $this->addRoute('/logout', function($request) { |
|
| 257 | 257 | $controller = new LogoutController(); |
| 258 | 258 | |
| 259 | 259 | return $controller->process($request); |
| 260 | 260 | }); |
| 261 | 261 | |
| 262 | - $this->addRoute('/metric', function ($request) { |
|
| 262 | + $this->addRoute('/metric', function($request) { |
|
| 263 | 263 | $controller = new MetricController(); |
| 264 | 264 | |
| 265 | 265 | return $controller->process($request); |
| 266 | 266 | }); |
| 267 | 267 | |
| 268 | - $this->addRoute('/recordselector/12m/{ActiveRecordID}/{field}/{relatedClass}/{relatedClassField}/{relatedClassDisplayField}/{relationType}', function ($request) { |
|
| 268 | + $this->addRoute('/recordselector/12m/{ActiveRecordID}/{field}/{relatedClass}/{relatedClassField}/{relatedClassDisplayField}/{relationType}', function($request) { |
|
| 269 | 269 | $controller = new RecordSelectorController(); |
| 270 | 270 | |
| 271 | 271 | return $controller->process($request); |
| 272 | 272 | })->value('relationType', 'ONE-TO-MANY'); |
| 273 | 273 | |
| 274 | - $this->addRoute('/recordselector/m2m/{ActiveRecordID}/{field}/{relatedClassLeft}/{relatedClassLeftDisplayField}/{relatedClassRight}/{relatedClassRightDisplayField}/{accessingClassName}/{lookupIDs}/{relationType}', function ($request) { |
|
| 274 | + $this->addRoute('/recordselector/m2m/{ActiveRecordID}/{field}/{relatedClassLeft}/{relatedClassLeftDisplayField}/{relatedClassRight}/{relatedClassRightDisplayField}/{accessingClassName}/{lookupIDs}/{relationType}', function($request) { |
|
| 275 | 275 | $controller = new RecordSelectorController(); |
| 276 | 276 | |
| 277 | 277 | return $controller->process($request); |
| 278 | 278 | })->value('relationType', 'MANY-TO-MANY'); |
| 279 | 279 | |
| 280 | - $this->addRoute('/search/{query}/{start}/{limit}', function ($request) { |
|
| 280 | + $this->addRoute('/search/{query}/{start}/{limit}', function($request) { |
|
| 281 | 281 | $controller = new SearchController(); |
| 282 | 282 | |
| 283 | 283 | return $controller->process($request); |
| 284 | 284 | })->value('start', 0)->value('limit', $config->get('app.list.page.amount')); |
| 285 | 285 | |
| 286 | - $this->addRoute('/sequence/{start}/{limit}', function ($request) { |
|
| 286 | + $this->addRoute('/sequence/{start}/{limit}', function($request) { |
|
| 287 | 287 | $controller = new SequenceController(); |
| 288 | 288 | |
| 289 | 289 | return $controller->process($request); |
| 290 | 290 | })->value('start', 0)->value('limit', $config->get('app.list.page.amount')); |
| 291 | 291 | |
| 292 | - $this->addRoute('/tag/{ActiveRecordType}/{ActiveRecordID}', function ($request) { |
|
| 292 | + $this->addRoute('/tag/{ActiveRecordType}/{ActiveRecordID}', function($request) { |
|
| 293 | 293 | $controller = new TagController(); |
| 294 | 294 | |
| 295 | 295 | return $controller->process($request); |
| 296 | 296 | }); |
| 297 | 297 | |
| 298 | - $this->addRoute('/install', function ($request) { |
|
| 298 | + $this->addRoute('/install', function($request) { |
|
| 299 | 299 | $controller = new InstallController(); |
| 300 | 300 | |
| 301 | 301 | return $controller->process($request); |
| 302 | 302 | }); |
| 303 | 303 | |
| 304 | - $this->addRoute('/record/{ActiveRecordType}/{ActiveRecordID}/{view}', function ($request) { |
|
| 304 | + $this->addRoute('/record/{ActiveRecordType}/{ActiveRecordID}/{view}', function($request) { |
|
| 305 | 305 | $controller = new ActiveRecordController(); |
| 306 | 306 | |
| 307 | 307 | return $controller->process($request); |
| 308 | 308 | })->value('ActiveRecordID', null)->value('view', 'detailed'); |
| 309 | 309 | |
| 310 | - $this->addRoute('/records/{ActiveRecordType}/{start}/{limit}', function ($request) { |
|
| 310 | + $this->addRoute('/records/{ActiveRecordType}/{start}/{limit}', function($request) { |
|
| 311 | 311 | $controller = new ActiveRecordController(); |
| 312 | 312 | |
| 313 | 313 | return $controller->process($request); |
| 314 | 314 | })->value('start', 0)->value('limit', $config->get('app.list.page.amount')); |
| 315 | 315 | |
| 316 | - $this->addRoute('/tk/{token}', function ($request) { |
|
| 316 | + $this->addRoute('/tk/{token}', function($request) { |
|
| 317 | 317 | $params = self::getDecodeQueryParams($request->getParam('token')); |
| 318 | 318 | |
| 319 | 319 | if (isset($params['act'])) { |
@@ -340,14 +340,14 @@ discard block |
||
| 340 | 340 | return new Response(404, 'Resource not found'); |
| 341 | 341 | }); |
| 342 | 342 | |
| 343 | - $this->addRoute('/alpha/service', function ($request) { |
|
| 343 | + $this->addRoute('/alpha/service', function($request) { |
|
| 344 | 344 | $controller = new LoginController(); |
| 345 | 345 | $controller->setUnitOfWork(array('Alpha\Controller\LoginController', 'Alpha\Controller\ListActiveRecordsController')); |
| 346 | 346 | |
| 347 | 347 | return $controller->process($request); |
| 348 | 348 | }); |
| 349 | 349 | |
| 350 | - $this->addRoute('/phpinfo', function ($request) { |
|
| 350 | + $this->addRoute('/phpinfo', function($request) { |
|
| 351 | 351 | $controller = new PhpinfoController(); |
| 352 | 352 | |
| 353 | 353 | return $controller->process($request); |
@@ -107,7 +107,7 @@ |
||
| 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) { |
@@ -690,7 +690,7 @@ discard block |
||
| 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 |
||
| 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).'"><<-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).'"><<-Previous</a></li>'; |
|
| 714 | 714 | } else { |
| 715 | - $body .= '<li><a href="/records/'.urlencode($this->request->getParam('ActiveRecordType')).'/'.($this->start - $this->limit).'/'.$this->limit.'"><<-Previous</a></li>'; |
|
| 715 | + $body .= '<li><a href="/records/'.urlencode($this->request->getParam('ActiveRecordType')).'/'.($this->start-$this->limit).'/'.$this->limit.'"><<-Previous</a></li>'; |
|
| 716 | 716 | } |
| 717 | 717 | } elseif ($this->recordCount > $this->limit) { |
| 718 | 718 | $body .= '<li class="disabled"><a href="#"><<-Previous</a></li>'; |
@@ -742,9 +742,9 @@ discard block |
||
| 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->></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->></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->></a></li>'; |
| 749 | 749 | } |
| 750 | 750 | } elseif ($this->recordCount > $this->limit) { |
@@ -302,17 +302,17 @@ |
||
| 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(); |
@@ -167,7 +167,7 @@ discard block |
||
| 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 |
||
| 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'); |
@@ -94,9 +94,9 @@ |
||
| 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); |
@@ -212,7 +212,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -97,7 +97,7 @@ |
||
| 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)) { |