@@ -61,8 +61,7 @@ |
||
| 61 | 61 | $info['tmp_name'][$i] |
| 62 | 62 | ); |
| 63 | 63 | } |
| 64 | - } |
|
| 65 | - else { |
|
| 64 | + } else { |
|
| 66 | 65 | $this->files[$name] = new Upload( |
| 67 | 66 | $info['error_code'], |
| 68 | 67 | $info['name'], |
@@ -27,8 +27,7 @@ |
||
| 27 | 27 | if (!isset($_SESSION['_token'])) { |
| 28 | 28 | try { |
| 29 | 29 | $_SESSION['_token'] = bin2hex(random_bytes(8)); |
| 30 | - } |
|
| 31 | - catch (Exception $exception) { |
|
| 30 | + } catch (Exception $exception) { |
|
| 32 | 31 | $_SESSION['_token'] = bin2hex(openssl_random_pseudo_bytes(8)); |
| 33 | 32 | } |
| 34 | 33 | } |
@@ -77,8 +77,7 @@ discard block |
||
| 77 | 77 | $template = __DIR__ . '/error.phtml'; |
| 78 | 78 | if (file_exists("view/{$code}.phtml")) { |
| 79 | 79 | $template = "view/{$code}.phtml"; |
| 80 | - } |
|
| 81 | - elseif (file_exists('view/error.phtml')) { |
|
| 80 | + } elseif (file_exists('view/error.phtml')) { |
|
| 82 | 81 | $template = 'view/error.phtml'; |
| 83 | 82 | } |
| 84 | 83 | return $this->view(new View($template, [ |
@@ -316,8 +315,7 @@ discard block |
||
| 316 | 315 | public function setTimestamp (int $timestamp) { |
| 317 | 316 | if ($timestamp) { |
| 318 | 317 | $this['Last-Modified'] = gmdate('D, d M Y H:i:s T', $timestamp); |
| 319 | - } |
|
| 320 | - else { |
|
| 318 | + } else { |
|
| 321 | 319 | unset($this['Last-Modified']); |
| 322 | 320 | } |
| 323 | 321 | $this->timestamp = $timestamp; |
@@ -122,8 +122,7 @@ discard block |
||
| 122 | 122 | public function onException (Throwable $error): void { |
| 123 | 123 | if (!$error instanceof Error) { |
| 124 | 124 | $this->log(500, "[{$error->getCode()}] {$error}"); |
| 125 | - } |
|
| 126 | - elseif ($error->getCode() >= 500) { |
|
| 125 | + } elseif ($error->getCode() >= 500) { |
|
| 127 | 126 | $this->log($error->getCode(), $error); |
| 128 | 127 | } |
| 129 | 128 | $this->response->error($error); // exits |
@@ -190,8 +189,7 @@ discard block |
||
| 190 | 189 | $match = []; |
| 191 | 190 | if ($path[0] !== '/') { |
| 192 | 191 | preg_match($path, $this->request->getPath(), $match); |
| 193 | - } |
|
| 194 | - elseif ($path === $this->request->getPath()) { |
|
| 192 | + } elseif ($path === $this->request->getPath()) { |
|
| 195 | 193 | $match = [$path]; |
| 196 | 194 | } |
| 197 | 195 | if ($match) { |