Completed
Push — master ( 5903e5...08322c )
by Marko
22:48 queued 07:53
created
FS.inc 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,10 +50,11 @@
 block discarded – undo
50 50
         /**
51 51
          * Minimum version of PHP must be atleast 5.5.11
52 52
          */
53
-        if ($PHP_VERSION_ID <= 50511)
54
-            return call_user_func(
53
+        if ($PHP_VERSION_ID <= 50511) {
54
+                    return call_user_func(
55 55
                 function () {
56 56
                     $self = new self();
57
+        }
57 58
                     $self->emergency(100);
58 59
                     return $self;
59 60
                 });
Please login to merge, or discard this patch.
php7/TraitForSharedMethods.inc 1 patch
Braces   +51 added lines, -37 removed lines patch added patch discarded remove patch
@@ -37,13 +37,15 @@  discard block
 block discarded – undo
37 37
      */
38 38
     protected function setCwd($path = false, $validate_dir_name = false)
39 39
     {
40
-        if (empty($path))
41
-            $current_working_directory = $this->getCwd();
42
-        else
43
-            $current_working_directory = $this->makeAbsolute($path);
40
+        if (empty($path)) {
41
+                    $current_working_directory = $this->getCwd();
42
+        } else {
43
+                    $current_working_directory = $this->makeAbsolute($path);
44
+        }
44 45
         
45
-        if (! empty($validate_dir_name) && (basename($current_working_directory) !== $validate_dir_name))
46
-            return false;
46
+        if (! empty($validate_dir_name) && (basename($current_working_directory) !== $validate_dir_name)) {
47
+                    return false;
48
+        }
47 49
         
48 50
         if (! is_dir($current_working_directory) || ! is_readable($current_working_directory) ||
49 51
              ! chdir($current_working_directory)) {
@@ -61,8 +63,9 @@  discard block
 block discarded – undo
61 63
      */
62 64
     public function getCwd()
63 65
     {
64
-        if (empty($this->cwd))
65
-            $this->cwd = getcwd();
66
+        if (empty($this->cwd)) {
67
+                    $this->cwd = getcwd();
68
+        }
66 69
         
67 70
         return $this->cwd;
68 71
     }
@@ -78,8 +81,9 @@  discard block
 block discarded – undo
78 81
         $bytestotal = empty($filename) ? ((method_exists(get_parent_class($this), 'getSize')) ? parent::getSize() : false) : filesize(
79 82
             $filename);
80 83
         
81
-        if (! $this->isDir($filename) && empty($convert))
82
-            return $bytestotal;
84
+        if (! $this->isDir($filename) && empty($convert)) {
85
+                    return $bytestotal;
86
+        }
83 87
         
84 88
         $suffixes = array(
85 89
             'B',
@@ -94,15 +98,17 @@  discard block
 block discarded – undo
94 98
         );
95 99
         if ($this->isDir($filename)) {
96 100
             $path = ((method_exists(get_class($this), 'getPathname')) ? $this->getPathname() : $filename);
97
-            if ($path === '/home/nitrotrigger/tmp/libhowi-filesystem/log/phpunit_test.log')
98
-                die('ss');
101
+            if ($path === '/home/nitrotrigger/tmp/libhowi-filesystem/log/phpunit_test.log') {
102
+                            die('ss');
103
+            }
99 104
             
100 105
             foreach (new RecursiveIteratorIterator(
101 106
                 new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS)) as $object) {
102 107
                 $bytestotal += $object->getSize();
103 108
             }
104
-            if (! $convert)
105
-                return $bytestotal;
109
+            if (! $convert) {
110
+                            return $bytestotal;
111
+            }
106 112
         }
107 113
         $base = log($bytestotal, 1024);
108 114
         
@@ -244,21 +250,24 @@  discard block
 block discarded – undo
244 250
         for ($df = strtok($date_format, ','); $df !== false; $df = strtok(",")) {
245 251
             $lkey = ($df !== 'a') ? strtolower($df) : 'days';
246 252
             
247
-            if ($ommit_zero && $interval->$lkey === 0)
248
-                continue;
253
+            if ($ommit_zero && $interval->$lkey === 0) {
254
+                            continue;
255
+            }
249 256
             
250 257
             $fparam = $df . (empty($sfx) ? $locale[$lkey][0] : ' ' .
251 258
                  (($interval->$lkey === 1) ? $locale[$lkey][1] : $locale[$lkey][2]));
252 259
             
253
-            if (! empty($ago_single) && ! empty($dfs))
254
-                break;
255
-            else
256
-                $dfs = ! empty($dfs) ? $dfs . "%$fparam " : "%$fparam ";
260
+            if (! empty($ago_single) && ! empty($dfs)) {
261
+                            break;
262
+            } else {
263
+                            $dfs = ! empty($dfs) ? $dfs . "%$fparam " : "%$fparam ";
264
+            }
265
+        }
266
+        if (empty($dfs)) {
267
+                    $ret = $locale['now'];
268
+        } else {
269
+                    $ret = $interval->format($dfs) . $locale['ago'];
257 270
         }
258
-        if (empty($dfs))
259
-            $ret = $locale['now'];
260
-        else
261
-            $ret = $interval->format($dfs) . $locale['ago'];
262 271
         return $ret;
263 272
     }
264 273
 
@@ -269,8 +278,9 @@  discard block
 block discarded – undo
269 278
      */
270 279
     public function openFile($open_mode = "r", $use_include_path = false, $context = null)
271 280
     {
272
-        if (! method_exists(get_parent_class($this), 'openFile'))
273
-            return false;
281
+        if (! method_exists(get_parent_class($this), 'openFile')) {
282
+                    return false;
283
+        }
274 284
         
275 285
         return ! $this->isDir() ? (! empty($context) ? parent::openFile($open_mode, $use_include_path, 
276 286
             $context) : parent::openFile($open_mode, $use_include_path)) : false;
@@ -283,8 +293,9 @@  discard block
 block discarded – undo
283 293
      */
284 294
     public function setFileClass($class_name = "\HOWI3\libhowi\Filesystem\php5\Objects\FileObject")
285 295
     {
286
-        if (! method_exists(get_parent_class($this), 'setFileClass'))
287
-            return false;
296
+        if (! method_exists(get_parent_class($this), 'setFileClass')) {
297
+                    return false;
298
+        }
288 299
         
289 300
         if (is_subclass_of($class_name, 'SplFileObject') || $class_name === 'SplFileObject') {
290 301
             parent::setFileClass($class_name);
@@ -300,8 +311,9 @@  discard block
 block discarded – undo
300 311
      */
301 312
     public function setInfoClass($class_name = "\HOWI3\libhowi\Filesystem\php5\Objects\InfoObject")
302 313
     {
303
-        if (! method_exists(get_parent_class($this), 'setInfoClass'))
304
-            return false;
314
+        if (! method_exists(get_parent_class($this), 'setInfoClass')) {
315
+                    return false;
316
+        }
305 317
         
306 318
         if (is_subclass_of($class_name, 'SplFileInfo') || $class_name === 'SplFileInfo') {
307 319
             parent::setInfoClass($class_name);
@@ -556,16 +568,17 @@  discard block
 block discarded – undo
556 568
      */
557 569
     public function makeAbsolute($path = false)
558 570
     {
559
-        if (! empty($path) && $this->isAbsolute($path))
560
-            $absolute_path = $path;
561
-        elseif (! empty($path) && $this->isRelative($path)) {
571
+        if (! empty($path) && $this->isAbsolute($path)) {
572
+                    $absolute_path = $path;
573
+        } elseif (! empty($path) && $this->isRelative($path)) {
562 574
             
563 575
             if (preg_match('/^(~\/)/', $path) === 1) {
564 576
                 $absolute_path = getenv("HOME") . substr($path, 1);
565 577
             } elseif (preg_match('/^(.\/|..\/)/', $path) === 1) {
566 578
                 $absolute_path = realpath($path);
567
-            } else
568
-                $absolute_path = $this->getCwd() . ($path !== '.' ? DIRECTORY_SEPARATOR . $path : '');
579
+            } else {
580
+                            $absolute_path = $this->getCwd() . ($path !== '.' ? DIRECTORY_SEPARATOR . $path : '');
581
+            }
569 582
         } else {
570 583
             $absolute_path = $path;
571 584
         }
@@ -579,8 +592,9 @@  discard block
 block discarded – undo
579 592
      */
580 593
     public function exists($pathname = false)
581 594
     {
582
-        if (empty($pathname))
583
-            return false;
595
+        if (empty($pathname)) {
596
+                    return false;
597
+        }
584 598
         
585 599
         $pathname = $this->makeAbsolute($pathname);
586 600
         
Please login to merge, or discard this patch.
php7/Filesystem.inc 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -129,8 +129,9 @@  discard block
 block discarded – undo
129 129
     public function file($filename = false, $dirname = false, $data = '', $flags = FILE_APPEND, $context = null)
130 130
     {
131 131
         if (! empty($filename) && array_key_exists($filename, $this->files) &&
132
-             is_object($this->files[$filename]))
133
-            return $this->files[$filename];
132
+             is_object($this->files[$filename])) {
133
+                    return $this->files[$filename];
134
+        }
134 135
         
135 136
         $this->debug(808);
136 137
         if (empty($filename)) {
@@ -169,8 +170,9 @@  discard block
 block discarded – undo
169 170
     public function infoObject($basename = false, $directory = false)
170 171
     {
171 172
         if (! empty($basename) && array_key_exists($basename, $this->infos) && is_object(
172
-            $this->infos[$basename]))
173
-            return $this->infos[$basename];
173
+            $this->infos[$basename])) {
174
+                    return $this->infos[$basename];
175
+        }
174 176
         
175 177
         $this->debug(809);
176 178
         if (empty($basename)) {
Please login to merge, or discard this patch.
php7/TraitForFileSystem.inc 1 patch
Braces   +77 added lines, -58 removed lines patch added patch discarded remove patch
@@ -103,11 +103,13 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public function getDiskTotalSpace($partition_location = false, $convert = false)
105 105
     {
106
-        if (empty($partition_location))
107
-            $partition_location = $this->getCwd();
106
+        if (empty($partition_location)) {
107
+                    $partition_location = $this->getCwd();
108
+        }
108 109
         
109
-        if (empty($convert))
110
-            return disk_total_space($partition_location);
110
+        if (empty($convert)) {
111
+                    return disk_total_space($partition_location);
112
+        }
111 113
         
112 114
         $bytestotal = 0;
113 115
         $suffixes = array(
@@ -137,11 +139,13 @@  discard block
 block discarded – undo
137 139
      */
138 140
     public function getDiskFreeSpace($partition_location = false, $convert = false)
139 141
     {
140
-        if (empty($partition_location))
141
-            $partition_location = $this->getCwd();
142
+        if (empty($partition_location)) {
143
+                    $partition_location = $this->getCwd();
144
+        }
142 145
         
143
-        if (empty($convert))
144
-            return disk_free_space($partition_location);
146
+        if (empty($convert)) {
147
+                    return disk_free_space($partition_location);
148
+        }
145 149
         
146 150
         $result = [
147 151
             0,
@@ -191,10 +195,11 @@  discard block
 block discarded – undo
191 195
     public function chmod($filename = false, $mode = false)
192 196
     {
193 197
         $filename = $this->makeAbsolute($filename);
194
-        if (file_exists($filename) && ! empty($mode) && is_int($mode))
195
-            return chmod($filename, octdec(str_pad($mode, 4, 0, STR_PAD_LEFT)));
196
-        else
197
-            return false;
198
+        if (file_exists($filename) && ! empty($mode) && is_int($mode)) {
199
+                    return chmod($filename, octdec(str_pad($mode, 4, 0, STR_PAD_LEFT)));
200
+        } else {
201
+                    return false;
202
+        }
198 203
     }
199 204
 
200 205
     /**
@@ -205,10 +210,11 @@  discard block
 block discarded – undo
205 210
     public function chown($filename = false, $user = false)
206 211
     {
207 212
         $filename = $this->makeAbsolute($filename);
208
-        if (file_exists($filename) && ! empty($user))
209
-            return chown($filename, $user);
210
-        else
211
-            return false;
213
+        if (file_exists($filename) && ! empty($user)) {
214
+                    return chown($filename, $user);
215
+        } else {
216
+                    return false;
217
+        }
212 218
     }
213 219
 
214 220
     /**
@@ -218,10 +224,11 @@  discard block
 block discarded – undo
218 224
      */
219 225
     public function clearstatcache($clear_realpath_cache = false, $filename = false)
220 226
     {
221
-        if (! empty($filename) && ! empty($clear_realpath_cache))
222
-            clearstatcache($clear_realpath_cache, $this->makeAbsolute($filename));
223
-        else
224
-            clearstatcache();
227
+        if (! empty($filename) && ! empty($clear_realpath_cache)) {
228
+                    clearstatcache($clear_realpath_cache, $this->makeAbsolute($filename));
229
+        } else {
230
+                    clearstatcache();
231
+        }
225 232
     }
226 233
 
227 234
     /**
@@ -236,10 +243,11 @@  discard block
 block discarded – undo
236 243
         
237 244
         if (! empty($source) && ! empty($dest) && ! is_dir($source)) {
238 245
             
239
-            if (empty($context))
240
-                return copy($source, $dest);
241
-            else
242
-                return copy($source, $dest, $context);
246
+            if (empty($context)) {
247
+                            return copy($source, $dest);
248
+            } else {
249
+                            return copy($source, $dest, $context);
250
+            }
243 251
         } elseif ((! empty($source) && ! empty($dest)) && is_dir($source) && ! file_exists($dest)) {
244 252
             
245 253
             $tmp_key = basename($source);
@@ -257,23 +265,24 @@  discard block
 block discarded – undo
257 265
                     if (empty($context)) {
258 266
                         mkdir($dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName(), 
259 267
                             octdec(str_pad($iterator->getPerms(), 4, 0, STR_PAD_LEFT)));
260
-                    } 
261
-
262
-                    else
263
-                        mkdir($dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName(), 
268
+                    } else {
269
+                                            mkdir($dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName(), 
264 270
                             octdec(str_pad($iterator->getPerms(), 4, 0, STR_PAD_LEFT)), false, $context);
271
+                    }
265 272
                 } else {
266
-                    if (empty($context))
267
-                        $this->copy($item, $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
268
-                    else
269
-                        $this->copy($item, $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName(), 
273
+                    if (empty($context)) {
274
+                                            $this->copy($item, $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
275
+                    } else {
276
+                                            $this->copy($item, $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName(), 
270 277
                             $context);
278
+                    }
271 279
                 }
272 280
             }
273 281
             
274 282
             return true;
275
-        } else
276
-            return false;
283
+        } else {
284
+                    return false;
285
+        }
277 286
     }
278 287
 
279 288
     /**
@@ -283,14 +292,16 @@  discard block
 block discarded – undo
283 292
      */
284 293
     public function mv($oldname = false, $newname = false, $context = false)
285 294
     {
286
-        if (empty($oldname) || empty($newname))
287
-            return false;
295
+        if (empty($oldname) || empty($newname)) {
296
+                    return false;
297
+        }
288 298
         
289 299
         $oldname = $this->makeAbsolute($oldname);
290 300
         $newname = $this->makeAbsolute($newname);
291 301
         
292
-        if (! empty($context))
293
-            return rename($oldname, $newname, $context);
302
+        if (! empty($context)) {
303
+                    return rename($oldname, $newname, $context);
304
+        }
294 305
         
295 306
         return rename($oldname, $newname);
296 307
     }
@@ -302,13 +313,15 @@  discard block
 block discarded – undo
302 313
      */
303 314
     public function namePatternMatch($pattern = false, $string = false, $flags = false)
304 315
     {
305
-        if (empty($pattern))
306
-            return false;
316
+        if (empty($pattern)) {
317
+                    return false;
318
+        }
307 319
         
308
-        if (! empty($flags))
309
-            return fnmatch($pattern, $string, $flags);
310
-        else
311
-            return fnmatch($pattern, $string);
320
+        if (! empty($flags)) {
321
+                    return fnmatch($pattern, $string, $flags);
322
+        } else {
323
+                    return fnmatch($pattern, $string);
324
+        }
312 325
     }
313 326
 
314 327
     /**
@@ -380,8 +393,9 @@  discard block
 block discarded – undo
380 393
      */
381 394
     public function touch($filename = false, $time = false, $atime = false)
382 395
     {
383
-        if (empty($filename))
384
-            return false;
396
+        if (empty($filename)) {
397
+                    return false;
398
+        }
385 399
         
386 400
         $filename = $this->makeAbsolute($filename);
387 401
         
@@ -419,23 +433,28 @@  discard block
 block discarded – undo
419 433
     public function createStructure($rootpath, $data_array, $skip_debug = false)
420 434
     {
421 435
         $absolute_path = $this->makeAbsolute($rootpath);
422
-        if (empty($skip_debug))
423
-            $this->debug(810);
436
+        if (empty($skip_debug)) {
437
+                    $this->debug(810);
438
+        }
424 439
         if (empty($rootpath) || ! is_array($data_array) ||
425
-             (! $this->isWritable($absolute_path) && ! $this->isWritable(dirname($absolute_path))))
426
-            return $this->warning(506) && false;
440
+             (! $this->isWritable($absolute_path) && ! $this->isWritable(dirname($absolute_path)))) {
441
+                    return $this->warning(506) && false;
442
+        }
427 443
         
428
-        if (! $this->isDir($absolute_path))
429
-            mkdir($absolute_path, 0755, true);
444
+        if (! $this->isDir($absolute_path)) {
445
+                    mkdir($absolute_path, 0755, true);
446
+        }
430 447
         
431 448
         foreach ($data_array as $key => $val) {
432
-            if (is_array($val))
433
-                ! $this->createStructure($absolute_path . DIRECTORY_SEPARATOR . $key, $val, true);
434
-            else
435
-                touch($absolute_path . DIRECTORY_SEPARATOR . $val);
449
+            if (is_array($val)) {
450
+                            ! $this->createStructure($absolute_path . DIRECTORY_SEPARATOR . $key, $val, true);
451
+            } else {
452
+                            touch($absolute_path . DIRECTORY_SEPARATOR . $val);
453
+            }
454
+        }
455
+        if (empty($skip_debug)) {
456
+                    $this->info(704, $rootpath);
436 457
         }
437
-        if (empty($skip_debug))
438
-            $this->info(704, $rootpath);
439 458
         return true;
440 459
     }
441 460
 }
Please login to merge, or discard this patch.
php7/Objects/FileObject.inc 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,9 @@
 block discarded – undo
87 87
      */
88 88
     public function dummyScale($size)
89 89
     {
90
-        if(!is_int($size) || $this->getSize() > $size) return false;
90
+        if(!is_int($size) || $this->getSize() > $size) {
91
+            return false;
92
+        }
91 93
         
92 94
         $this->fseek($size ,SEEK_SET);
93 95
         $this->fwrite(' ');
Please login to merge, or discard this patch.
php7/Objects/DirectoryTreeObject.inc 1 patch
Braces   +24 added lines, -27 removed lines patch added patch discarded remove patch
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function c($basename = false)
49 49
     {
50
-        if (! empty($basename) && array_key_exists($basename, $this->dirkeys))
51
-            $c = $this->dirkeys[$basename];
52
-        elseif (! empty($basename) && is_dir($this->getPath() . DIRECTORY_SEPARATOR . $basename)) {
50
+        if (! empty($basename) && array_key_exists($basename, $this->dirkeys)) {
51
+                    $c = $this->dirkeys[$basename];
52
+        } elseif (! empty($basename) && is_dir($this->getPath() . DIRECTORY_SEPARATOR . $basename)) {
53 53
             $c = new DirectoryTreeObject($this->getPath() . DIRECTORY_SEPARATOR . $basename, 
54 54
                 DirectoryTreeObject::SKIP_DOTS);
55 55
             $c->setFileClass('\HOWI3\libhowi\Filesystem\php5\Objects\FileObject');
@@ -58,10 +58,9 @@  discard block
 block discarded – undo
58 58
             $c->setLogLevel($this->getLogLevel());
59 59
             $c->setUID($this->getUID());
60 60
             $c->setUsername($this->getUsername());
61
-        } 
62
-
63
-        else
64
-            $c = false;
61
+        } else {
62
+                    $c = false;
63
+        }
65 64
         
66 65
         return $this->dirkeys[$basename] = $c;
67 66
     }
@@ -94,16 +93,15 @@  discard block
 block discarded – undo
94 93
         
95 94
         while ($this->valid()) {
96 95
             if (! $this->isDot()) {
97
-                if ($this->isDir() && ! $this->isLink() && ! empty($sort))
98
-                    $ls['dir'][$this->getFilename()] = $this->getType();
99
-                
100
-                elseif ($this->isLink() && ! empty($sort))
101
-                    $ls['link'][$this->getFilename()] = $this->getType();
102
-                
103
-                elseif ($this->isFile() && ! empty($sort))
104
-                    $ls['file'][$this->getFilename()] = $this->getType();
105
-                else
106
-                    $display[$this->getFilename()] = $this->getType();
96
+                if ($this->isDir() && ! $this->isLink() && ! empty($sort)) {
97
+                                    $ls['dir'][$this->getFilename()] = $this->getType();
98
+                } elseif ($this->isLink() && ! empty($sort)) {
99
+                                    $ls['link'][$this->getFilename()] = $this->getType();
100
+                } elseif ($this->isFile() && ! empty($sort)) {
101
+                                    $ls['file'][$this->getFilename()] = $this->getType();
102
+                } else {
103
+                                    $display[$this->getFilename()] = $this->getType();
104
+                }
107 105
                 
108 106
                 if ($this->isDir() || $this->isLink()) {
109 107
                     $this->dirkeys[$this->getFilename()] = $this->getChildren();
@@ -153,16 +151,15 @@  discard block
 block discarded – undo
153 151
                 $lsinfo[$cname]->tchange = $this->getCTime($timeformat);
154 152
                 $lsinfo[$cname]->tmodify = $this->getMTime($timeformat);
155 153
                 
156
-                if ($this->isDir() && ! $this->isLink() && ! empty($sort))
157
-                    $ls['dir'][$cname] = $lsinfo[$cname]->type;
158
-                
159
-                elseif ($this->isLink() && ! empty($sort))
160
-                    $ls['link'][$cname] = $lsinfo[$cname]->type;
161
-                
162
-                elseif ($this->isFile() && ! empty($sort))
163
-                    $ls['file'][$cname] = $lsinfo[$cname]->type;
164
-                else
165
-                    $display[$cname] = $lsinfo[$cname]->type;
154
+                if ($this->isDir() && ! $this->isLink() && ! empty($sort)) {
155
+                                    $ls['dir'][$cname] = $lsinfo[$cname]->type;
156
+                } elseif ($this->isLink() && ! empty($sort)) {
157
+                                    $ls['link'][$cname] = $lsinfo[$cname]->type;
158
+                } elseif ($this->isFile() && ! empty($sort)) {
159
+                                    $ls['file'][$cname] = $lsinfo[$cname]->type;
160
+                } else {
161
+                                    $display[$cname] = $lsinfo[$cname]->type;
162
+                }
166 163
             }
167 164
             $this->next();
168 165
         }
Please login to merge, or discard this patch.
php7/Objects/TmpObject.inc 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,8 +66,9 @@
 block discarded – undo
66 66
      */
67 67
     public function getTmp()
68 68
     {
69
-        if (empty($this->tmp_path))
70
-            $this->tmp_path = $this->setTmp();
69
+        if (empty($this->tmp_path)) {
70
+                    $this->tmp_path = $this->setTmp();
71
+        }
71 72
         
72 73
         $this->debug(805, $this->tmp_path);
73 74
         $this->response()->setStatus(true);
Please login to merge, or discard this patch.
php7/Objects/DirectoryPlaceholderObject.inc 1 patch
Braces   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -137,9 +137,7 @@
 block discarded – undo
137 137
         if (! empty($HID) && is_resource($context)) {
138 138
             $this->context = $context;
139 139
             return true;
140
-        } 
141
-
142
-        else {
140
+        } else {
143 141
             $this->debug(802, 'DirectoryTrait->dirsetContext');
144 142
             return false;
145 143
         }
Please login to merge, or discard this patch.
php7/Objects/LinkObject.inc 1 patch
Braces   +30 added lines, -20 removed lines patch added patch discarded remove patch
@@ -38,14 +38,16 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function symlink($target = false, $link = false)
40 40
     {
41
-        if (empty($target) || empty($link))
42
-            return false;
41
+        if (empty($target) || empty($link)) {
42
+                    return false;
43
+        }
43 44
         
44 45
         $target = $this->makeAbsolute($target);
45 46
         $link = $this->makeAbsolute($link);
46 47
         
47
-        if (! file_exists($target) || file_exists($link))
48
-            return false;
48
+        if (! file_exists($target) || file_exists($link)) {
49
+                    return false;
50
+        }
49 51
         
50 52
         return symlink($target, $link);
51 53
     }
@@ -57,14 +59,16 @@  discard block
 block discarded – undo
57 59
      */
58 60
     public function hardlink($target = false, $link = false)
59 61
     {
60
-        if (empty($target) || empty($link))
61
-            return false;
62
+        if (empty($target) || empty($link)) {
63
+                    return false;
64
+        }
62 65
         
63 66
         $target = $this->makeAbsolute($target);
64 67
         $link = $this->makeAbsolute($link);
65 68
         
66
-        if (! file_exists($target) || is_dir($target) || file_exists($link))
67
-            return false;
69
+        if (! file_exists($target) || is_dir($target) || file_exists($link)) {
70
+                    return false;
71
+        }
68 72
         
69 73
         return link($target, $link);
70 74
     }
@@ -76,8 +80,9 @@  discard block
 block discarded – undo
76 80
      */
77 81
     public function lstat($link = false)
78 82
     {
79
-        if (empty($link))
80
-            return false;
83
+        if (empty($link)) {
84
+                    return false;
85
+        }
81 86
         $link = $this->makeAbsolute($link);
82 87
         return @lstat($link);
83 88
     }
@@ -89,8 +94,9 @@  discard block
 block discarded – undo
89 94
      */
90 95
     public function lstatDiff($link = false)
91 96
     {
92
-        if (empty($link))
93
-            return false;
97
+        if (empty($link)) {
98
+                    return false;
99
+        }
94 100
         $link = $this->makeAbsolute($link);
95 101
         return array_diff(stat($link), lstat($link));
96 102
     }
@@ -102,8 +108,9 @@  discard block
 block discarded – undo
102 108
      */
103 109
     public function readlink($link = false)
104 110
     {
105
-        if (empty($link))
106
-            return false;
111
+        if (empty($link)) {
112
+                    return false;
113
+        }
107 114
         
108 115
         $link = $this->makeAbsolute($link);
109 116
         return readlink($link);
@@ -116,8 +123,9 @@  discard block
 block discarded – undo
116 123
      */
117 124
     public function lchgrp($link = false, $group = false)
118 125
     {
119
-        if (empty($link))
120
-            return false;
126
+        if (empty($link)) {
127
+                    return false;
128
+        }
121 129
         
122 130
         $link = $this->makeAbsolute($link);
123 131
         return @lchgrp($link, $group);
@@ -130,8 +138,9 @@  discard block
 block discarded – undo
130 138
      */
131 139
     public function lchown($link = false, $group = false)
132 140
     {
133
-        if (empty($link))
134
-            return false;
141
+        if (empty($link)) {
142
+                    return false;
143
+        }
135 144
         
136 145
         $link = $this->makeAbsolute($link);
137 146
         return @lchown($link, $group);
@@ -144,8 +153,9 @@  discard block
 block discarded – undo
144 153
      */
145 154
     public function linkinfo($link = false)
146 155
     {
147
-        if (empty($link))
148
-            return false;
156
+        if (empty($link)) {
157
+                    return false;
158
+        }
149 159
         
150 160
         $link = $this->makeAbsolute($link);
151 161
         return linkinfo($link);
Please login to merge, or discard this patch.