@@ -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 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | protected function output($data) |
41 | 41 | { |
42 | 42 | if (!$this->isContent && !is_file($data)) { |
43 | - throw new Exception('file not exists:' . $data); |
|
43 | + throw new Exception('file not exists:'.$data); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | @ob_end_clean(); |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | |
62 | 62 | $this->header['Pragma'] = 'public'; |
63 | 63 | $this->header['Content-Type'] = $mimeType ?: 'application/octet-stream'; |
64 | - $this->header['Cache-control'] = 'max-age=' . $this->expire; |
|
65 | - $this->header['Content-Disposition'] = 'attachment; filename="' . $name . '"'; |
|
64 | + $this->header['Cache-control'] = 'max-age='.$this->expire; |
|
65 | + $this->header['Content-Disposition'] = 'attachment; filename="'.$name.'"'; |
|
66 | 66 | $this->header['Content-Length'] = $size; |
67 | 67 | $this->header['Content-Transfer-Encoding'] = 'binary'; |
68 | - $this->header['Expires'] = gmdate("D, d M Y H:i:s", time() + $this->expire) . ' GMT'; |
|
68 | + $this->header['Expires'] = gmdate("D, d M Y H:i:s", time() + $this->expire).' GMT'; |
|
69 | 69 | |
70 | - $this->lastModified(gmdate('D, d M Y H:i:s', time()) . ' GMT'); |
|
70 | + $this->lastModified(gmdate('D, d M Y H:i:s', time()).' GMT'); |
|
71 | 71 | |
72 | 72 | return $this->isContent ? $data : file_get_contents($data); |
73 | 73 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $this->name = $filename; |
138 | 138 | |
139 | 139 | if ($extension && false === strpos($filename, '.')) { |
140 | - $this->name .= '.' . pathinfo($this->data, PATHINFO_EXTENSION); |
|
140 | + $this->name .= '.'.pathinfo($this->data, PATHINFO_EXTENSION); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | return $this; |