@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\response; |
14 | 14 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | protected function output($data) |
42 | 42 | { |
43 | 43 | if (!$this->isContent && !is_file($data)) { |
44 | - throw new Exception('file not exists:' . $data); |
|
44 | + throw new Exception('file not exists:'.$data); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | ob_end_clean(); |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | |
63 | 63 | $this->header['Pragma'] = 'public'; |
64 | 64 | $this->header['Content-Type'] = $mimeType ?: 'application/octet-stream'; |
65 | - $this->header['Cache-control'] = 'max-age=' . $this->expire; |
|
66 | - $this->header['Content-Disposition'] = ($this->force ? 'attachment; ' : '') . 'filename="' . $name . '"'; |
|
65 | + $this->header['Cache-control'] = 'max-age='.$this->expire; |
|
66 | + $this->header['Content-Disposition'] = ($this->force ? 'attachment; ' : '').'filename="'.$name.'"'; |
|
67 | 67 | $this->header['Content-Length'] = $size; |
68 | 68 | $this->header['Content-Transfer-Encoding'] = 'binary'; |
69 | - $this->header['Expires'] = gmdate("D, d M Y H:i:s", time() + $this->expire) . ' GMT'; |
|
69 | + $this->header['Expires'] = gmdate("D, d M Y H:i:s", time() + $this->expire).' GMT'; |
|
70 | 70 | |
71 | - $this->lastModified(gmdate('D, d M Y H:i:s', time()) . ' GMT'); |
|
71 | + $this->lastModified(gmdate('D, d M Y H:i:s', time()).' GMT'); |
|
72 | 72 | |
73 | 73 | return $this->isContent ? $data : file_get_contents($data); |
74 | 74 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $this->name = $filename; |
150 | 150 | |
151 | 151 | if ($extension && false === strpos($filename, '.')) { |
152 | - $this->name .= '.' . pathinfo($this->data, PATHINFO_EXTENSION); |
|
152 | + $this->name .= '.'.pathinfo($this->data, PATHINFO_EXTENSION); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | return $this; |