@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | if ($filepath === $filePath) { |
277 | 277 | continue; |
278 | 278 | } |
279 | - $this->validSubModels[ camelcase(pathinfo($filepath, PATHINFO_FILENAME)) ] = $filepath; |
|
279 | + $this->validSubModels[camelcase(pathinfo($filepath, PATHINFO_FILENAME))] = $filepath; |
|
280 | 280 | } |
281 | 281 | } |
282 | 282 | } |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | } |
345 | 345 | } |
346 | 346 | |
347 | - if (empty($get[ $property ])) { |
|
347 | + if (empty($get[$property])) { |
|
348 | 348 | if (services()->has($property)) { |
349 | 349 | return services()->get($property); |
350 | 350 | } elseif ($this->hasSubModel($property)) { |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | final protected function hasSubModel($model) |
372 | 372 | { |
373 | 373 | if (array_key_exists($model, $this->validSubModels)) { |
374 | - return (bool)is_file($this->validSubModels[ $model ]); |
|
374 | + return (bool)is_file($this->validSubModels[$model]); |
|
375 | 375 | } |
376 | 376 | |
377 | 377 | return false; |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | */ |
433 | 433 | final public function rebuildRowCallback(\Closure $callback) |
434 | 434 | { |
435 | - if(empty($this->rebuildRowCallback)) { |
|
435 | + if (empty($this->rebuildRowCallback)) { |
|
436 | 436 | $this->rebuildRowCallback = $callback; |
437 | 437 | } |
438 | 438 | } |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | */ |
473 | 473 | public function rebuildRow($row) |
474 | 474 | { |
475 | - if(is_callable($this->rebuildRowCallback)) { |
|
475 | + if (is_callable($this->rebuildRowCallback)) { |
|
476 | 476 | call_user_func($this->rebuildRowCallback, $row); |
477 | 477 | } |
478 | 478 | } |
@@ -338,8 +338,8 @@ discard block |
||
338 | 338 | $conditions = []; |
339 | 339 | |
340 | 340 | foreach ($this->paramsWithRules as $param) { |
341 | - if ($get->offsetExists($param[ 'field' ])) { |
|
342 | - $conditions[ $param[ 'field' ] ] = $get->offsetGet($param[ 'field' ]); |
|
341 | + if ($get->offsetExists($param['field'])) { |
|
342 | + $conditions[$param['field']] = $get->offsetGet($param['field']); |
|
343 | 343 | } |
344 | 344 | } |
345 | 345 | |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | } |
396 | 396 | |
397 | 397 | $hasAction = false; |
398 | - if($request = input()->request()) { |
|
398 | + if ($request = input()->request()) { |
|
399 | 399 | // Start as limit |
400 | 400 | $this->model->qb->limit($request['start']); |
401 | 401 | |
@@ -403,8 +403,8 @@ discard block |
||
403 | 403 | $this->model->qb->offset($request['length']); |
404 | 404 | |
405 | 405 | // Set ordering |
406 | - if( ! empty($request['order'])) { |
|
407 | - foreach($request['order'] as $dt => $order) { |
|
406 | + if ( ! empty($request['order'])) { |
|
407 | + foreach ($request['order'] as $dt => $order) { |
|
408 | 408 | $field = $request['columns'][$order['column']]['data']; |
409 | 409 | $this->model->qb->orderBy($field, strtoupper($order['dir'])); |
410 | 410 | } |
@@ -412,30 +412,30 @@ discard block |
||
412 | 412 | |
413 | 413 | $this->model->visibleColumns = []; |
414 | 414 | |
415 | - foreach($request['columns'] as $dt => $column) { |
|
416 | - if($column['data'] === 'action') { |
|
415 | + foreach ($request['columns'] as $dt => $column) { |
|
416 | + if ($column['data'] === 'action') { |
|
417 | 417 | $this->model->appendColumns[] = 'action'; |
418 | 418 | |
419 | 419 | continue; |
420 | 420 | } |
421 | 421 | |
422 | - if($column['searchable']) { |
|
423 | - if($dt == 0) { |
|
424 | - if( ! empty($column['search']['value']) ) { |
|
422 | + if ($column['searchable']) { |
|
423 | + if ($dt == 0) { |
|
424 | + if ( ! empty($column['search']['value'])) { |
|
425 | 425 | $this->model->qb->like($column['data'], $column['search']['value']); |
426 | 426 | |
427 | - if( ! empty($request['search']['value'])) { |
|
427 | + if ( ! empty($request['search']['value'])) { |
|
428 | 428 | $this->model->qb->orLike($column['data'], $request['search']['value']); |
429 | 429 | } |
430 | - } elseif( ! empty($request['search']['value'])) { |
|
430 | + } elseif ( ! empty($request['search']['value'])) { |
|
431 | 431 | $this->model->qb->like($column['data'], $request['search']['value']); |
432 | 432 | } |
433 | 433 | } else { |
434 | - if( ! empty($column['search']['value']) ) { |
|
435 | - $this->model->qb->orLike($column[ 'data' ], $column[ 'search' ][ 'value' ]); |
|
434 | + if ( ! empty($column['search']['value'])) { |
|
435 | + $this->model->qb->orLike($column['data'], $column['search']['value']); |
|
436 | 436 | } |
437 | 437 | |
438 | - if( ! empty($request['search']['value'])) { |
|
438 | + if ( ! empty($request['search']['value'])) { |
|
439 | 439 | $this->model->qb->orLike($column['data'], $request['search']['value']); |
440 | 440 | } |
441 | 441 | } |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | } |
446 | 446 | } |
447 | 447 | |
448 | - $this->model->rebuildRowCallback(function ($row) { |
|
448 | + $this->model->rebuildRowCallback(function($row) { |
|
449 | 449 | $row->DT_RowId = 'datatable-row-' . $row->id; |
450 | 450 | }); |
451 | 451 | |
@@ -489,14 +489,14 @@ discard block |
||
489 | 489 | |
490 | 490 | if (count($this->fillableColumnsWithRules)) { |
491 | 491 | foreach ($this->fillableColumnsWithRules as $column) { |
492 | - if ($post->offsetExists($column[ 'field' ])) { |
|
493 | - $data[ $column[ 'field' ] ] = $post->offsetGet($column[ 'field' ]); |
|
492 | + if ($post->offsetExists($column['field'])) { |
|
493 | + $data[$column['field']] = $post->offsetGet($column['field']); |
|
494 | 494 | } |
495 | 495 | } |
496 | 496 | } elseif (count($this->fillableColumns)) { |
497 | 497 | foreach ($this->fillableColumns as $column) { |
498 | - if ($post->offsetExists($column[ 'field' ])) { |
|
499 | - $data[ $column[ 'field' ] ] = $post->offsetGet($column[ 'field' ]); |
|
498 | + if ($post->offsetExists($column['field'])) { |
|
499 | + $data[$column['field']] = $post->offsetGet($column['field']); |
|
500 | 500 | } |
501 | 501 | } |
502 | 502 | } else { |
@@ -504,11 +504,11 @@ discard block |
||
504 | 504 | } |
505 | 505 | |
506 | 506 | if (count($data)) { |
507 | - $data[ 'record_create_timestamp' ] = $data[ 'record_update_timestamp' ] = timestamp(); |
|
508 | - $data[ 'record_create_user' ] = $data[ 'record_update_user' ] = globals()->account->id; |
|
507 | + $data['record_create_timestamp'] = $data['record_update_timestamp'] = timestamp(); |
|
508 | + $data['record_create_user'] = $data['record_update_user'] = globals()->account->id; |
|
509 | 509 | |
510 | 510 | if ($this->model->insert($data)) { |
511 | - $data[ 'id' ] = $this->model->db->getLastInsertId(); |
|
511 | + $data['id'] = $this->model->db->getLastInsertId(); |
|
512 | 512 | $this->sendPayload([ |
513 | 513 | 'code' => 201, |
514 | 514 | 'Successful insert request', |
@@ -567,14 +567,14 @@ discard block |
||
567 | 567 | |
568 | 568 | if (count($this->fillableColumnsWithRules)) { |
569 | 569 | foreach ($this->fillableColumnsWithRules as $column) { |
570 | - if ($post->offsetExists($column[ 'field' ])) { |
|
571 | - $data[ $column[ 'field' ] ] = $post->offsetGet($column[ 'field' ]); |
|
570 | + if ($post->offsetExists($column['field'])) { |
|
571 | + $data[$column['field']] = $post->offsetGet($column['field']); |
|
572 | 572 | } |
573 | 573 | } |
574 | 574 | } elseif (count($this->fillableColumns)) { |
575 | 575 | foreach ($this->fillableColumns as $column) { |
576 | - if ($post->offsetExists($column[ 'field' ])) { |
|
577 | - $data[ $column[ 'field' ] ] = $post->offsetGet($column[ 'field' ]); |
|
576 | + if ($post->offsetExists($column['field'])) { |
|
577 | + $data[$column['field']] = $post->offsetGet($column['field']); |
|
578 | 578 | } |
579 | 579 | } |
580 | 580 | } else { |
@@ -582,8 +582,8 @@ discard block |
||
582 | 582 | } |
583 | 583 | |
584 | 584 | if (count($data)) { |
585 | - $data[ 'record_update_timestamp' ] = timestamp(); |
|
586 | - $data[ 'record_update_user' ] = globals()->account->id; |
|
585 | + $data['record_update_timestamp'] = timestamp(); |
|
586 | + $data['record_update_user'] = globals()->account->id; |
|
587 | 587 | |
588 | 588 | |
589 | 589 | if ($this->model->update($data, $conditions)) { |
@@ -743,9 +743,9 @@ discard block |
||
743 | 743 | if (is_numeric(key($code))) { |
744 | 744 | $message = reset($code); |
745 | 745 | $code = key($code); |
746 | - } elseif (isset($code[ 'code' ])) { |
|
747 | - $code = $code[ 'code' ]; |
|
748 | - $message = $code[ 'message' ]; |
|
746 | + } elseif (isset($code['code'])) { |
|
747 | + $code = $code['code']; |
|
748 | + $message = $code['message']; |
|
749 | 749 | } |
750 | 750 | } |
751 | 751 | |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | $longPoolingCacheMetadata = $longPoolingCacheData->getMetadata(); |
814 | 814 | |
815 | 815 | // if no timestamp delivered via ajax or data.txt has been changed SINCE last ajax timestamp |
816 | - if ($lastCallTimestamp == null || $longPoolingCacheMetadata[ 'ctime' ] > $lastCallTimestamp) { |
|
816 | + if ($lastCallTimestamp == null || $longPoolingCacheMetadata['ctime'] > $lastCallTimestamp) { |
|
817 | 817 | output()->send([ |
818 | 818 | 'timestamp' => $longPoolingCacheMetadata, |
819 | 819 | 'data' => $data, |
@@ -73,7 +73,7 @@ |
||
73 | 73 | */ |
74 | 74 | public function offsetSet($offset, $row) |
75 | 75 | { |
76 | - if($model = models($this->model->getClass())) { |
|
76 | + if ($model = models($this->model->getClass())) { |
|
77 | 77 | $row = new Result\Row($row, $model); |
78 | 78 | } |
79 | 79 |
@@ -134,20 +134,20 @@ |
||
134 | 134 | $parseUrl = parse_url($node->childNodes->first()->getAttributeHref()); |
135 | 135 | $parseUrlQuery = []; |
136 | 136 | |
137 | - if (isset($parseUrl[ 'query' ])) { |
|
138 | - parse_str($parseUrl[ 'query' ], $parseUrlQuery); |
|
137 | + if (isset($parseUrl['query'])) { |
|
138 | + parse_str($parseUrl['query'], $parseUrlQuery); |
|
139 | 139 | } |
140 | 140 | |
141 | - if (isset($parseUrlQuery[ 'page' ])) { |
|
142 | - if (input()->get('page') === $parseUrlQuery[ 'page' ]) { |
|
141 | + if (isset($parseUrlQuery['page'])) { |
|
142 | + if (input()->get('page') === $parseUrlQuery['page']) { |
|
143 | 143 | $node->attributes->addAttributeClass('active'); |
144 | 144 | $node->childNodes->first()->attributes->addAttributeClass('active'); |
145 | 145 | } |
146 | 146 | } else { |
147 | 147 | $hrefUriSegments = []; |
148 | 148 | |
149 | - if (isset($parseUrl[ 'path' ])) { |
|
150 | - $hrefUriSegments = (new Uri\Segments($parseUrl[ 'path' ]))->getArrayCopy(); |
|
149 | + if (isset($parseUrl['path'])) { |
|
150 | + $hrefUriSegments = (new Uri\Segments($parseUrl['path']))->getArrayCopy(); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | $currentUriSegments = server_request()->getUri()->segments->getArrayCopy(); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function &__get($property) |
44 | 44 | { |
45 | - $get[ $property ] = false; |
|
45 | + $get[$property] = false; |
|
46 | 46 | |
47 | 47 | // CodeIgniter property aliasing |
48 | 48 | if ($property === 'load') { |
@@ -50,16 +50,16 @@ discard block |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | if (services()->has($property)) { |
53 | - $get[ $property ] = services()->get($property); |
|
53 | + $get[$property] = services()->get($property); |
|
54 | 54 | } elseif (o2system()->__isset($property)) { |
55 | - $get[ $property ] = o2system()->__get($property); |
|
55 | + $get[$property] = o2system()->__get($property); |
|
56 | 56 | } elseif ($property === 'model') { |
57 | - $get[ $property ] = models('controller'); |
|
57 | + $get[$property] = models('controller'); |
|
58 | 58 | } elseif ($property === 'services' || $property === 'libraries') { |
59 | - $get[ $property ] = services(); |
|
59 | + $get[$property] = services(); |
|
60 | 60 | } |
61 | 61 | |
62 | - return $get[ $property ]; |
|
62 | + return $get[$property]; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | // ------------------------------------------------------------------------ |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | 'batch' => $batch, |
331 | 331 | ]; |
332 | 332 | |
333 | - $this->insertOrUpdate($sets, ['filename' => $sets[ 'filename' ]]); |
|
333 | + $this->insertOrUpdate($sets, ['filename' => $sets['filename']]); |
|
334 | 334 | } |
335 | 335 | } |
336 | 336 | |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | $timestamp = filemtime($filename); |
367 | 367 | preg_match('/\d{4}[-]?\d{2}[-]?\d{2}[-]?\d{2}[-]?\d{2}[-]?\d{2}/', $filename, $matches); |
368 | 368 | |
369 | - $timestamp = count($matches) ? strtotime($matches[ 0 ]) : $timestamp; |
|
369 | + $timestamp = count($matches) ? strtotime($matches[0]) : $timestamp; |
|
370 | 370 | |
371 | 371 | return date('Y-m-d H:i:s', $timestamp); |
372 | 372 | } |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | $version = 'v0.0.0'; |
388 | 388 | preg_match('/v\d*[.]?\d*[.]\d*/', $filename, $matches); |
389 | 389 | |
390 | - return count($matches) ? $matches[ 0 ] : $version; |
|
390 | + return count($matches) ? $matches[0] : $version; |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | // ------------------------------------------------------------------------ |
@@ -424,13 +424,13 @@ discard block |
||
424 | 424 | */ |
425 | 425 | public function import() |
426 | 426 | { |
427 | - if( ! empty($this->optionSql)) { |
|
428 | - $filePath = PATH_DATABASE . str_replace(['/','\\'], DIRECTORY_SEPARATOR, $this->optionSql); |
|
427 | + if ( ! empty($this->optionSql)) { |
|
428 | + $filePath = PATH_DATABASE . str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $this->optionSql); |
|
429 | 429 | |
430 | - if(is_file($filePath)) { |
|
430 | + if (is_file($filePath)) { |
|
431 | 431 | $sqlStatement = file_get_contents($filePath); |
432 | 432 | |
433 | - if($this->model->db->query($sqlStatement)) { |
|
433 | + if ($this->model->db->query($sqlStatement)) { |
|
434 | 434 | |
435 | 435 | } else { |
436 | 436 | |
@@ -446,9 +446,9 @@ discard block |
||
446 | 446 | */ |
447 | 447 | public function latest() |
448 | 448 | { |
449 | - if($result = $this->model->findWhere(['batch' => $this->model->getLatestBatch()])) { |
|
450 | - if($result->count()) { |
|
451 | - foreach($result as $row) { |
|
449 | + if ($result = $this->model->findWhere(['batch' => $this->model->getLatestBatch()])) { |
|
450 | + if ($result->count()) { |
|
451 | + foreach ($result as $row) { |
|
452 | 452 | $this->run($row->filename, 'up'); |
453 | 453 | } |
454 | 454 | } |
@@ -466,17 +466,17 @@ discard block |
||
466 | 466 | $requestBatch = ($latestBatch - 1); |
467 | 467 | $requestBatch = $requestBatch < 1 ? 1 : $requestBatch; |
468 | 468 | |
469 | - if( ! empty($this->optionBatch) ) { |
|
469 | + if ( ! empty($this->optionBatch)) { |
|
470 | 470 | $requestBatch = $this->optionBatch; |
471 | 471 | } |
472 | 472 | |
473 | 473 | $batches = range($requestBatch, $latestBatch, 1); |
474 | 474 | $batches = array_reverse($batches); |
475 | 475 | |
476 | - foreach($batches as $batch) { |
|
477 | - if($result = $this->model->findWhere(['batch' => $batch])) { |
|
478 | - if($result->count()) { |
|
479 | - foreach($result as $row) { |
|
476 | + foreach ($batches as $batch) { |
|
477 | + if ($result = $this->model->findWhere(['batch' => $batch])) { |
|
478 | + if ($result->count()) { |
|
479 | + foreach ($result as $row) { |
|
480 | 480 | $this->run($row->filename, 'down'); |
481 | 481 | $this->run($row->filename, 'up'); |
482 | 482 | } |
@@ -496,10 +496,10 @@ discard block |
||
496 | 496 | $batches = range(1, $batch, 1); |
497 | 497 | $batches = array_reverse($batches); |
498 | 498 | |
499 | - foreach($batches as $batch) { |
|
500 | - if($result = $this->model->findWhere(['batch' => $batch])) { |
|
501 | - if($result->count()) { |
|
502 | - foreach($result as $row) { |
|
499 | + foreach ($batches as $batch) { |
|
500 | + if ($result = $this->model->findWhere(['batch' => $batch])) { |
|
501 | + if ($result->count()) { |
|
502 | + foreach ($result as $row) { |
|
503 | 503 | $this->run($row->filename, 'down'); |
504 | 504 | $this->run($row->filename, 'up'); |
505 | 505 | } |
@@ -515,9 +515,9 @@ discard block |
||
515 | 515 | */ |
516 | 516 | public function fresh() |
517 | 517 | { |
518 | - if($result = $this->model->findWhere(['batch' => 1])) { |
|
519 | - if($result->count()) { |
|
520 | - foreach($result as $row) { |
|
518 | + if ($result = $this->model->findWhere(['batch' => 1])) { |
|
519 | + if ($result->count()) { |
|
520 | + foreach ($result as $row) { |
|
521 | 521 | $this->run($row->filename, 'up'); |
522 | 522 | } |
523 | 523 | } |
@@ -538,13 +538,13 @@ discard block |
||
538 | 538 | protected function run($filename, $method = 'up') |
539 | 539 | { |
540 | 540 | $filePaths = [ |
541 | - PATH_DATABASE . 'migrations' . DIRECTORY_SEPARATOR . str_replace(['/','\\'], DIRECTORY_SEPARATOR, $filename), |
|
542 | - PATH_DATABASE . str_replace(['/','\\'], DIRECTORY_SEPARATOR, $filename) |
|
541 | + PATH_DATABASE . 'migrations' . DIRECTORY_SEPARATOR . str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $filename), |
|
542 | + PATH_DATABASE . str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $filename) |
|
543 | 543 | ]; |
544 | 544 | |
545 | - foreach($filePaths as $filePath) { |
|
546 | - if(is_file($filePath)) { |
|
547 | - if(pathinfo($filePath, PATHINFO_EXTENSION) == 'php') { |
|
545 | + foreach ($filePaths as $filePath) { |
|
546 | + if (is_file($filePath)) { |
|
547 | + if (pathinfo($filePath, PATHINFO_EXTENSION) == 'php') { |
|
548 | 548 | require_once($filePath); |
549 | 549 | $filename = pathinfo($filePath, PATHINFO_FILENAME); |
550 | 550 | $filename = explode('_', $filename); |
@@ -560,22 +560,22 @@ discard block |
||
560 | 560 | ->setNewLinesAfter(1) |
561 | 561 | ); |
562 | 562 | |
563 | - if(class_exists($className)) { |
|
563 | + if (class_exists($className)) { |
|
564 | 564 | $migration = new $className(); |
565 | 565 | |
566 | - if(method_exists($migration, $method)) { |
|
566 | + if (method_exists($migration, $method)) { |
|
567 | 567 | call_user_func([$migration, $method]); |
568 | 568 | |
569 | 569 | output()->write( |
570 | 570 | (new Format()) |
571 | 571 | ->setContextualClass(Format::SUCCESS) |
572 | - ->setString(language()->getLine('CLI_MIGRATION_RUN_'.strtoupper($method).'_SUCCESS', [$filename])) |
|
572 | + ->setString(language()->getLine('CLI_MIGRATION_RUN_' . strtoupper($method) . '_SUCCESS', [$filename])) |
|
573 | 573 | ->setNewLinesAfter(1) |
574 | 574 | ); |
575 | 575 | |
576 | - if($method === 'up') { |
|
577 | - if(method_exists($migration, 'seed')) { |
|
578 | - if($this->optionSeed) { |
|
576 | + if ($method === 'up') { |
|
577 | + if (method_exists($migration, 'seed')) { |
|
578 | + if ($this->optionSeed) { |
|
579 | 579 | call_user_func([$migration, 'seed']); |
580 | 580 | |
581 | 581 | output()->write( |
@@ -589,10 +589,10 @@ discard block |
||
589 | 589 | } |
590 | 590 | } |
591 | 591 | } |
592 | - } elseif(pathinfo($filePath, PATHINFO_EXTENSION) == 'sql') { |
|
592 | + } elseif (pathinfo($filePath, PATHINFO_EXTENSION) == 'sql') { |
|
593 | 593 | $sqlStatement = file_get_contents($filePath); |
594 | 594 | |
595 | - if($this->model->db->query($sqlStatement)) { |
|
595 | + if ($this->model->db->query($sqlStatement)) { |
|
596 | 596 | output()->write( |
597 | 597 | (new Format()) |
598 | 598 | ->setContextualClass(Format::SUCCESS) |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | */ |
622 | 622 | public function execute() |
623 | 623 | { |
624 | - if($this->optionFilename) { |
|
624 | + if ($this->optionFilename) { |
|
625 | 625 | $this->run($this->optionFilename); |
626 | 626 | } |
627 | 627 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | ); |
74 | 74 | |
75 | 75 | if ($this->config->offsetExists('extensions')) { |
76 | - $this->setFileExtensions($this->config[ 'extensions' ]); |
|
76 | + $this->setFileExtensions($this->config['extensions']); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | $this->document = new Html\Document(); |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function &__get($property) |
91 | 91 | { |
92 | - $get[ $property ] = false; |
|
92 | + $get[$property] = false; |
|
93 | 93 | |
94 | 94 | if (property_exists($this, $property)) { |
95 | 95 | return $this->{$property}; |
96 | 96 | } |
97 | 97 | |
98 | - return $get[ $property ]; |
|
98 | + return $get[$property]; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | // ------------------------------------------------------------------------ |
@@ -218,8 +218,8 @@ discard block |
||
218 | 218 | $error = new ErrorException( |
219 | 219 | 'E_VIEW_NOT_FOUND', |
220 | 220 | 0, |
221 | - @$backtrace[ 0 ][ 'file' ], |
|
222 | - @$backtrace[ 0 ][ 'line' ], |
|
221 | + @$backtrace[0]['file'], |
|
222 | + @$backtrace[0]['line'], |
|
223 | 223 | [trim($filename)] |
224 | 224 | ); |
225 | 225 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | $viewsDirectories = array_reverse($viewsDirectories); |
308 | 308 | |
309 | 309 | $controllerSubDir = null; |
310 | - if($controller = services('controller')) { |
|
310 | + if ($controller = services('controller')) { |
|
311 | 311 | $controllerSubDir = services('controller')->getParameter() . DIRECTORY_SEPARATOR; |
312 | 312 | } |
313 | 313 | |
@@ -738,12 +738,12 @@ discard block |
||
738 | 738 | $htmlOutput = $this->document->saveHTML(); |
739 | 739 | |
740 | 740 | // Uglify Output |
741 | - if ($this->config->output[ 'uglify' ] === true) { |
|
741 | + if ($this->config->output['uglify'] === true) { |
|
742 | 742 | $htmlOutput = preg_replace( |
743 | 743 | [ |
744 | - '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
745 | - '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
746 | - '/(\s)+/s', // shorten multiple whitespace sequences |
|
744 | + '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
745 | + '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
746 | + '/(\s)+/s', // shorten multiple whitespace sequences |
|
747 | 747 | '/<!--(.|\s)*?-->/', // Remove HTML comments |
748 | 748 | '/<!--(.*)-->/Uis', |
749 | 749 | "/[[:blank:]]+/", |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | } |
761 | 761 | |
762 | 762 | // Beautify Output |
763 | - if ($this->config->output[ 'beautify' ] === true) { |
|
763 | + if ($this->config->output['beautify'] === true) { |
|
764 | 764 | $beautifier = new Html\Dom\Beautifier(); |
765 | 765 | $htmlOutput = $beautifier->format($htmlOutput); |
766 | 766 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $this->handleExtensionRequest(); |
50 | 50 | } else { |
51 | 51 | $uriPath = urldecode( |
52 | - parse_url($_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH) |
|
52 | + parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) |
|
53 | 53 | ); |
54 | 54 | |
55 | 55 | $uriPathParts = explode('public/', $uriPath); |
@@ -304,8 +304,8 @@ discard block |
||
304 | 304 | public function handleAppRequest(FrameworkModuleDataStructure $app) |
305 | 305 | { |
306 | 306 | // Find App module |
307 | - foreach([null,'modules', 'plugins'] as $additionalSegment) { |
|
308 | - if(empty($additionalSegment)) { |
|
307 | + foreach ([null, 'modules', 'plugins'] as $additionalSegment) { |
|
308 | + if (empty($additionalSegment)) { |
|
309 | 309 | $segments = [ |
310 | 310 | $app->getParameter(), |
311 | 311 | $this->uri->segments->first(), |
@@ -344,11 +344,11 @@ discard block |
||
344 | 344 | $uriRoutedSegments = array_diff($uriSegments, |
345 | 345 | array_slice($uriSegments, ($numOfUriSegments - $i))); |
346 | 346 | |
347 | - if(count($uriRoutedSegments)) { |
|
348 | - if($module instanceof FrameworkModuleDataStructure) { |
|
347 | + if (count($uriRoutedSegments)) { |
|
348 | + if ($module instanceof FrameworkModuleDataStructure) { |
|
349 | 349 | $moduleSegments = $module->getSegments(); |
350 | 350 | |
351 | - if(count($moduleSegments)) { |
|
351 | + if (count($moduleSegments)) { |
|
352 | 352 | $uriRoutedSegments = array_merge($moduleSegments, $uriRoutedSegments); |
353 | 353 | } |
354 | 354 | } |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | if (class_exists($controllerClassName)) { |
441 | 441 | $this->addresses->any( |
442 | 442 | '/', |
443 | - function () use ($controllerClassName) { |
|
443 | + function() use ($controllerClassName) { |
|
444 | 444 | return new $controllerClassName(); |
445 | 445 | } |
446 | 446 | ); |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | if (class_exists($controllerClassName)) { |
456 | 456 | $this->addresses->any( |
457 | 457 | '/', |
458 | - function () use ($controllerClassName) { |
|
458 | + function() use ($controllerClassName) { |
|
459 | 459 | return new $controllerClassName(); |
460 | 460 | } |
461 | 461 | ); |
@@ -507,12 +507,12 @@ discard block |
||
507 | 507 | ); |
508 | 508 | } elseif (preg_match("/([a-zA-Z0-9\\\]+)(@)([a-zA-Z0-9\\\]+)/", $closure, $matches)) { |
509 | 509 | $this->setController( |
510 | - (new KernelControllerDataStructure($matches[ 1 ])) |
|
511 | - ->setRequestMethod($matches[ 3 ]), |
|
510 | + (new KernelControllerDataStructure($matches[1])) |
|
511 | + ->setRequestMethod($matches[3]), |
|
512 | 512 | $uriSegments |
513 | 513 | ); |
514 | 514 | } elseif ($theme = presenter()->theme) { |
515 | - if($theme->use === true) { |
|
515 | + if ($theme->use === true) { |
|
516 | 516 | if ( ! presenter()->partials->offsetExists('content') && $closure !== '') { |
517 | 517 | presenter()->partials->offsetSet('content', $closure); |
518 | 518 | } |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function update() |
113 | 113 | { |
114 | - if($this->optionModules) { |
|
114 | + if ($this->optionModules) { |
|
115 | 115 | modules()->updateRegistry(); |
116 | - } elseif($this->optionLanguages) { |
|
116 | + } elseif ($this->optionLanguages) { |
|
117 | 117 | language()->updateRegistry(); |
118 | 118 | } else { |
119 | 119 | modules()->updateRegistry(); |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | */ |
133 | 133 | public function flush() |
134 | 134 | { |
135 | - if($this->optionModules) { |
|
135 | + if ($this->optionModules) { |
|
136 | 136 | modules()->flushRegistry(); |
137 | - } elseif($this->optionLanguages) { |
|
137 | + } elseif ($this->optionLanguages) { |
|
138 | 138 | language()->flushRegistry(); |
139 | 139 | } else { |
140 | 140 | modules()->flushRegistry(); |
@@ -184,13 +184,13 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function metadata() |
186 | 186 | { |
187 | - if($this->optionModules) { |
|
187 | + if ($this->optionModules) { |
|
188 | 188 | $line = PHP_EOL . print_r(modules()->getRegistry(), true); |
189 | - } elseif($this->optionLanguages) { |
|
189 | + } elseif ($this->optionLanguages) { |
|
190 | 190 | $line = PHP_EOL . print_r(language()->getRegistry(), true); |
191 | 191 | } else { |
192 | 192 | $line = PHP_EOL . print_r(modules()->getRegistry(), true); |
193 | - $line.= PHP_EOL . print_r(language()->getRegistry(), true); |
|
193 | + $line .= PHP_EOL . print_r(language()->getRegistry(), true); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | if (isset($line)) { |