@@ -84,8 +84,8 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function setStatus(int $code) |
| 86 | 86 | { |
| 87 | - $this->header->sendHeaderRaw('HTTP/1.1 '.$code.' '. Status::toText($code)); |
|
| 88 | - $this->header->sendHeader('Status', $code.' '. Status::toText($code)); |
|
| 87 | + $this->header->sendHeaderRaw('HTTP/1.1 '.$code.' '.Status::toText($code)); |
|
| 88 | + $this->header->sendHeader('Status', $code.' '.Status::toText($code)); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -137,12 +137,12 @@ discard block |
||
| 137 | 137 | $value = $runnable->run($request, $this); |
| 138 | 138 | } |
| 139 | 139 | $this->header->send(); |
| 140 | - $wantEcho = strlen($echo) > 0 ; |
|
| 140 | + $wantEcho = strlen($echo) > 0; |
|
| 141 | 141 | $noReturn = $wantEcho && is_null($value); |
| 142 | 142 | if ($noReturn && $wantEcho) { |
| 143 | 143 | $this->send($echo); |
| 144 | 144 | } else { |
| 145 | - if ($allowEcho && $wantEcho) { |
|
| 145 | + if ($allowEcho && $wantEcho) { |
|
| 146 | 146 | echo $echo; |
| 147 | 147 | } |
| 148 | 148 | Content::send($this, $value); |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | |
| 22 | 22 | if ($content->isFile()) { |
| 23 | 23 | $response->setType($content->getExtension()); |
| 24 | - $response->setHeader('Content-Disposition', 'attachment;filename="' . $content->getBasename().'"'); |
|
| 24 | + $response->setHeader('Content-Disposition', 'attachment;filename="'.$content->getBasename().'"'); |
|
| 25 | 25 | $response->setHeader('Cache-Control', 'max-age=0'); |
| 26 | 26 | $response->send(file_get_contents($content->getRealPath())); |
| 27 | 27 | } else { |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | class Content |
| 15 | 15 | { |
| 16 | 16 | protected static $types = [ |
| 17 | - JsonContent::class => ['boolean', 'integer','double', 'string','array','NULL', JsonSerializable::class], |
|
| 17 | + JsonContent::class => ['boolean', 'integer', 'double', 'string', 'array', 'NULL', JsonSerializable::class], |
|
| 18 | 18 | FileContent::class => [SplFileInfo::class], |
| 19 | 19 | ]; |
| 20 | 20 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | public static function isTypeOf($data, $type) : bool |
| 42 | 42 | { |
| 43 | - if (is_object($data) && !\in_array($type, ['boolean', 'integer','double', 'string','array','NULL'])) { |
|
| 43 | + if (is_object($data) && !\in_array($type, ['boolean', 'integer', 'double', 'string', 'array', 'NULL'])) { |
|
| 44 | 44 | $class = new ReflectionClass($data); |
| 45 | 45 | return $class->isSubclassOf($type) || $class->implementsInterface($type); |
| 46 | 46 | } else { |