@@ -110,7 +110,7 @@ |
||
110 | 110 | 'over_write_on_duplicate' => false, |
111 | 111 | |
112 | 112 | // Item Columns |
113 | - 'item_columns' => ['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url'], |
|
113 | + 'item_columns' => [ 'name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url' ], |
|
114 | 114 | |
115 | 115 | /* |
116 | 116 | |-------------------------------------------------------------------------- |
@@ -12,25 +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')??['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' ]; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | public function __get($var_name) |
27 | 27 | { |
28 | 28 | if (!array_key_exists($var_name, $this->attributes)) { |
29 | 29 | $function_name = Str::camel($var_name); |
30 | - $this->attributes[$var_name] = $this->$function_name(); |
|
30 | + $this->attributes[ $var_name ] = $this->$function_name(); |
|
31 | 31 | } |
32 | 32 | |
33 | - return $this->attributes[$var_name]; |
|
33 | + return $this->attributes[ $var_name ]; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | public function fill() |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | public function isFile() |
61 | 61 | { |
62 | - return ! $this->isDirectory(); |
|
62 | + return !$this->isDirectory(); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | return false; |
175 | 175 | } |
176 | 176 | |
177 | - if (in_array($this->mimeType(), ['image/gif', 'image/svg+xml'])) { |
|
177 | + if (in_array($this->mimeType(), [ 'image/gif', 'image/svg+xml' ])) { |
|
178 | 178 | return false; |
179 | 179 | } |
180 | 180 | |
@@ -195,9 +195,9 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function humanFilesize($bytes, $decimals = 2) |
197 | 197 | { |
198 | - $size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; |
|
198 | + $size = [ 'B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ]; |
|
199 | 199 | $factor = floor((strlen($bytes) - 1) / 3); |
200 | 200 | |
201 | - return sprintf("%.{$decimals}f %s", $bytes / pow(1024, $factor), @$size[$factor]); |
|
201 | + return sprintf("%.{$decimals}f %s", $bytes / pow(1024, $factor), @$size[ $factor ]); |
|
202 | 202 | } |
203 | 203 | } |