@@ -12,26 +12,25 @@ discard block |
||
12 | 12 | private $isDirectory; |
13 | 13 | private $mimeType = null; |
14 | 14 | |
15 | - private $columns = []; |
|
16 | - public $attributes = []; |
|
15 | + private $columns = [ ]; |
|
16 | + public $attributes = [ ]; |
|
17 | 17 | |
18 | 18 | public function __construct(LfmPath $lfm, Lfm $helper, $isDirectory = false) |
19 | 19 | { |
20 | 20 | $this->lfm = $lfm->thumb(false); |
21 | 21 | $this->helper = $helper; |
22 | 22 | $this->isDirectory = $isDirectory; |
23 | - $this->columns = $helper->config('item_columns') ?: |
|
24 | - ['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url']; |
|
23 | + $this->columns = $helper->config('item_columns') ?: [ 'name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url' ]; |
|
25 | 24 | } |
26 | 25 | |
27 | 26 | public function __get($var_name) |
28 | 27 | { |
29 | 28 | if (!array_key_exists($var_name, $this->attributes)) { |
30 | 29 | $function_name = Str::camel($var_name); |
31 | - $this->attributes[$var_name] = $this->$function_name(); |
|
30 | + $this->attributes[ $var_name ] = $this->$function_name(); |
|
32 | 31 | } |
33 | 32 | |
34 | - return $this->attributes[$var_name]; |
|
33 | + return $this->attributes[ $var_name ]; |
|
35 | 34 | } |
36 | 35 | |
37 | 36 | public function fill() |
@@ -60,7 +59,7 @@ discard block |
||
60 | 59 | |
61 | 60 | public function isFile() |
62 | 61 | { |
63 | - return ! $this->isDirectory(); |
|
62 | + return !$this->isDirectory(); |
|
64 | 63 | } |
65 | 64 | |
66 | 65 | /** |
@@ -175,7 +174,7 @@ discard block |
||
175 | 174 | return false; |
176 | 175 | } |
177 | 176 | |
178 | - if (in_array($this->mimeType(), ['image/gif', 'image/svg+xml'])) { |
|
177 | + if (in_array($this->mimeType(), [ 'image/gif', 'image/svg+xml' ])) { |
|
179 | 178 | return false; |
180 | 179 | } |
181 | 180 | |
@@ -196,9 +195,9 @@ discard block |
||
196 | 195 | */ |
197 | 196 | public function humanFilesize($bytes, $decimals = 2) |
198 | 197 | { |
199 | - $size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; |
|
198 | + $size = [ 'B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ]; |
|
200 | 199 | $factor = floor((strlen($bytes) - 1) / 3); |
201 | 200 | |
202 | - return sprintf("%.{$decimals}f %s", $bytes / pow(1024, $factor), @$size[$factor]); |
|
201 | + return sprintf("%.{$decimals}f %s", $bytes / pow(1024, $factor), @$size[ $factor ]); |
|
203 | 202 | } |
204 | 203 | } |