@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | } |
| 78 | 78 | } else { |
| 79 | 79 | $uriPath = urldecode( |
| 80 | - parse_url($_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH) |
|
| 80 | + parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) |
|
| 81 | 81 | ); |
| 82 | 82 | |
| 83 | 83 | $uriPathParts = explode('public/', $uriPath); |
@@ -120,20 +120,20 @@ discard block |
||
| 120 | 120 | // Module routing |
| 121 | 121 | if ($numOfUriSegments = count($uriSegments)) { |
| 122 | 122 | if (empty($app)) { |
| 123 | - if (false !== ($module = modules()->getModule( reset($uriSegments) ))) { |
|
| 123 | + if (false !== ($module = modules()->getModule(reset($uriSegments)))) { |
|
| 124 | 124 | //array_shift($uriSegments); |
| 125 | 125 | $this->uri = $this->uri->withSegments(new KernelMessageUriSegments($uriSegments)); |
| 126 | 126 | $uriString = $this->uri->getSegments()->getString(); |
| 127 | 127 | |
| 128 | 128 | $this->registerModule($module); |
| 129 | 129 | } |
| 130 | - } elseif (false !== ($module = modules()->getModule( [$app->getParameter(), 'modules', reset($uriSegments) ] ))) { |
|
| 130 | + } elseif (false !== ($module = modules()->getModule([$app->getParameter(), 'modules', reset($uriSegments)]))) { |
|
| 131 | 131 | array_shift($uriSegments); |
| 132 | 132 | $this->uri = $this->uri->withSegments(new KernelMessageUriSegments($uriSegments)); |
| 133 | 133 | $uriString = $this->uri->getSegments()->getString(); |
| 134 | 134 | |
| 135 | 135 | $this->registerModule($module); |
| 136 | - } elseif (false !== ($module = modules()->getModule( [$app->getParameter(), 'plugins', reset($uriSegments) ] ))) { |
|
| 136 | + } elseif (false !== ($module = modules()->getModule([$app->getParameter(), 'plugins', reset($uriSegments)]))) { |
|
| 137 | 137 | array_shift($uriSegments); |
| 138 | 138 | $this->uri = $this->uri->withSegments(new KernelMessageUriSegments($uriSegments)); |
| 139 | 139 | $uriString = $this->uri->getSegments()->getString(); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $this->registerModule($module); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - if($numOfUriSegments = count($uriSegments)) { |
|
| 144 | + if ($numOfUriSegments = count($uriSegments)) { |
|
| 145 | 145 | for ($i = 0; $i <= $numOfUriSegments; $i++) { |
| 146 | 146 | $uriRoutedSegments = array_diff($uriSegments, |
| 147 | 147 | array_slice($uriSegments, ($numOfUriSegments - $i))); |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | if (class_exists($controllerClassName = $controllerNamespace . implode('\\', |
| 233 | 233 | array_map('studlycase', $uriRoutedSegments)))) { |
| 234 | 234 | |
| 235 | - if($controllerClassName::$inherited) { |
|
| 235 | + if ($controllerClassName::$inherited) { |
|
| 236 | 236 | $uriSegments = array_diff($uriSegments, $uriRoutedSegments); |
| 237 | 237 | $this->setController(new KernelControllerDataStructure($controllerClassName), |
| 238 | 238 | $uriSegments); |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | * Try to find requested page |
| 250 | 250 | */ |
| 251 | 251 | if (false !== ($pagesDir = $module->getResourcesDir('pages', true))) { |
| 252 | - if($controllerClassName = $this->getPagesControllerClassName()) { |
|
| 252 | + if ($controllerClassName = $this->getPagesControllerClassName()) { |
|
| 253 | 253 | |
| 254 | 254 | /** |
| 255 | 255 | * Try to find from database |
@@ -284,12 +284,12 @@ discard block |
||
| 284 | 284 | presenter()->page->setFile($pageFilePath); |
| 285 | 285 | } else { |
| 286 | 286 | $pageFilePath = str_replace('.phtml', DIRECTORY_SEPARATOR . 'index.phtml', $pageFilePath); |
| 287 | - if(is_file($pageFilePath)) { |
|
| 287 | + if (is_file($pageFilePath)) { |
|
| 288 | 288 | presenter()->page->setFile($pageFilePath); |
| 289 | 289 | } |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | - if(presenter()->page->file instanceof SplFileInfo) { |
|
| 292 | + if (presenter()->page->file instanceof SplFileInfo) { |
|
| 293 | 293 | $this->setController( |
| 294 | 294 | (new KernelControllerDataStructure($controllerClassName)) |
| 295 | 295 | ->setRequestMethod('index') |
@@ -332,19 +332,19 @@ discard block |
||
| 332 | 332 | { |
| 333 | 333 | $modules = modules()->getArrayCopy(); |
| 334 | 334 | |
| 335 | - foreach($modules as $module) { |
|
| 335 | + foreach ($modules as $module) { |
|
| 336 | 336 | $controllerClassName = $module->getNamespace() . 'Controllers\Pages'; |
| 337 | 337 | if ($module->getNamespace() === 'O2System\Framework\\') { |
| 338 | 338 | $controllerClassName = 'O2System\Framework\Http\Controllers\Pages'; |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | - if(class_exists($controllerClassName)) { |
|
| 341 | + if (class_exists($controllerClassName)) { |
|
| 342 | 342 | return $controllerClassName; |
| 343 | 343 | break; |
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | - if(class_exists('O2System\Framework\Http\Controllers\Pages')) { |
|
| 347 | + if (class_exists('O2System\Framework\Http\Controllers\Pages')) { |
|
| 348 | 348 | return 'O2System\Framework\Http\Controllers\Pages'; |
| 349 | 349 | } |
| 350 | 350 | |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | if (class_exists($controllerClassName)) { |
| 396 | 396 | $this->addresses->any( |
| 397 | 397 | '/', |
| 398 | - function () use ($controllerClassName) { |
|
| 398 | + function() use ($controllerClassName) { |
|
| 399 | 399 | return new $controllerClassName(); |
| 400 | 400 | } |
| 401 | 401 | ); |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | if (class_exists($controllerClassName)) { |
| 411 | 411 | $this->addresses->any( |
| 412 | 412 | '/', |
| 413 | - function () use ($controllerClassName) { |
|
| 413 | + function() use ($controllerClassName) { |
|
| 414 | 414 | return new $controllerClassName(); |
| 415 | 415 | } |
| 416 | 416 | ); |
@@ -462,8 +462,8 @@ discard block |
||
| 462 | 462 | ); |
| 463 | 463 | } elseif (preg_match("/([a-zA-Z0-9\\\]+)(@)([a-zA-Z0-9\\\]+)/", $closure, $matches)) { |
| 464 | 464 | $this->setController( |
| 465 | - (new KernelControllerDataStructure($matches[ 1 ])) |
|
| 466 | - ->setRequestMethod($matches[ 3 ]), |
|
| 465 | + (new KernelControllerDataStructure($matches[1])) |
|
| 466 | + ->setRequestMethod($matches[3]), |
|
| 467 | 467 | $uriSegments |
| 468 | 468 | ); |
| 469 | 469 | } elseif (presenter()->theme->use === true) { |