Test Setup Failed
Pull Request — master (#799)
by Eldar
05:56
created
src/LfmItem.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
10 10
 
11 11
     private $helper;
12 12
 
13
-    private $columns    = ['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url'];
13
+    private $columns = [ 'name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url' ];
14 14
 
15
-    public $attributes = [];
15
+    public $attributes = [ ];
16 16
 
17 17
     public function __construct(LfmPath $lfm, Lfm $helper)
18 18
     {
@@ -22,12 +22,12 @@  discard block
 block discarded – undo
22 22
 
23 23
     public function __get($var_name)
24 24
     {
25
-        if (! array_key_exists($var_name, $this->attributes)) {
25
+        if (!array_key_exists($var_name, $this->attributes)) {
26 26
             $function_name               = camel_case($var_name);
27
-            $this->attributes[$var_name] = $this->$function_name();
27
+            $this->attributes[ $var_name ] = $this->$function_name();
28 28
         }
29 29
 
30
-        return $this->attributes[$var_name];
30
+        return $this->attributes[ $var_name ];
31 31
     }
32 32
 
33 33
     public function fill()
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function isFile()
68 68
     {
69
-        return ! $this->isDirectory();
69
+        return !$this->isDirectory();
70 70
     }
71 71
 
72 72
     /**
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function isImage()
78 78
     {
79
-        if (! $this->isDirectory()) {
79
+        if (!$this->isDirectory()) {
80 80
             return starts_with($this->mimeType(), 'image');
81 81
         }
82 82
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     public function time()
130 130
     {
131
-        if (! $this->isDirectory()) {
131
+        if (!$this->isDirectory()) {
132 132
             return $this->lfm->lastModified();
133 133
         }
134 134
 
@@ -176,11 +176,11 @@  discard block
 block discarded – undo
176 176
 
177 177
     public function hasThumb()
178 178
     {
179
-        if (! $this->isImage()) {
179
+        if (!$this->isImage()) {
180 180
             return false;
181 181
         }
182 182
 
183
-        if (! $this->lfm->thumb()->exists()) {
183
+        if (!$this->lfm->thumb()->exists()) {
184 184
             return false;
185 185
         }
186 186
 
@@ -189,15 +189,15 @@  discard block
 block discarded – undo
189 189
 
190 190
     public function shouldCreateThumb()
191 191
     {
192
-        if (! $this->helper->config('should_create_thumbnails')) {
192
+        if (!$this->helper->config('should_create_thumbnails')) {
193 193
             return false;
194 194
         }
195 195
 
196
-        if (! $this->isImage()) {
196
+        if (!$this->isImage()) {
197 197
             return false;
198 198
         }
199 199
 
200
-        if (in_array($this->mimeType(), ['image/gif', 'image/svg+xml'])) {
200
+        if (in_array($this->mimeType(), [ 'image/gif', 'image/svg+xml' ])) {
201 201
             return false;
202 202
         }
203 203
 
@@ -219,9 +219,9 @@  discard block
 block discarded – undo
219 219
      */
220 220
     public function humanFilesize($bytes, $decimals = 2)
221 221
     {
222
-        $size   = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
222
+        $size   = [ 'B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ];
223 223
         $factor = floor((strlen($bytes) - 1) / 3);
224 224
 
225
-        return sprintf("%.{$decimals}f %s", $bytes / pow(1024, $factor), @$size[$factor]);
225
+        return sprintf("%.{$decimals}f %s", $bytes / pow(1024, $factor), @$size[ $factor ]);
226 226
     }
227 227
 }
Please login to merge, or discard this patch.