@@ -20,14 +20,14 @@ discard block |
||
| 20 | 20 | public static array $headers_sent = []; |
| 21 | 21 | |
| 22 | 22 | public static function setHeader(string $header): void { |
| 23 | - if(str_contains($header, ':')) { |
|
| 23 | + if (str_contains($header, ':')) { |
|
| 24 | 24 | list($key, $value) = explode(':', $header); |
| 25 | - } else { |
|
| 25 | + }else { |
|
| 26 | 26 | $key = 'Http Status'; |
| 27 | 27 | $value = $header; |
| 28 | 28 | } |
| 29 | 29 | if (!in_array($key, self::$headers_sent)) { |
| 30 | - if(!self::isTest()) { |
|
| 30 | + if (!self::isTest()) { |
|
| 31 | 31 | header($header); |
| 32 | 32 | } |
| 33 | 33 | self::$headers_sent[$key] = $value; |
@@ -99,9 +99,9 @@ discard block |
||
| 99 | 99 | Logger::log('Adding debug headers to render response'); |
| 100 | 100 | $vars["__DEBUG__"]["includes"] = get_included_files(); |
| 101 | 101 | $vars["__DEBUG__"]["trace"] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); |
| 102 | - self::setHeader('X-PSFS-DEBUG-TS: ' . Dispatcher::getInstance()->getTs() . ' s'); |
|
| 103 | - self::setHeader('X-PSFS-DEBUG-MEM: ' . Dispatcher::getInstance()->getMem('MBytes') . ' MBytes'); |
|
| 104 | - self::setHeader('X-PSFS-DEBUG-FILES: ' . count(get_included_files()) . ' files opened'); |
|
| 102 | + self::setHeader('X-PSFS-DEBUG-TS: '.Dispatcher::getInstance()->getTs().' s'); |
|
| 103 | + self::setHeader('X-PSFS-DEBUG-MEM: '.Dispatcher::getInstance()->getMem('MBytes').' MBytes'); |
|
| 104 | + self::setHeader('X-PSFS-DEBUG-FILES: '.count(get_included_files()).' files opened'); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | return $vars; |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * @return int|string |
| 114 | 114 | * @throws GeneratorException |
| 115 | 115 | */ |
| 116 | - public static function httpNotFound(Exception $exception = NULL, bool $isJson = false): int|string |
|
| 116 | + public static function httpNotFound(Exception $exception = NULL, bool $isJson = false): int | string |
|
| 117 | 117 | { |
| 118 | 118 | if (self::isTest()) { |
| 119 | 119 | return 404; |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $notFoundRoute = Config::getParam('route.404'); |
| 133 | 133 | if (null !== $notFoundRoute) { |
| 134 | 134 | Request::getInstance()->redirect(Router::getInstance()->getRoute($notFoundRoute, true)); |
| 135 | - } else { |
|
| 135 | + }else { |
|
| 136 | 136 | return $template->render('error.html.twig', array( |
| 137 | 137 | 'exception' => $exception, |
| 138 | 138 | 'trace' => $exception->getTraceAsString(), |