Completed
Push — master ( b6f152...201fcc )
by claudio
05:38
created
app/Console/Commands/Optimise/Path.php 1 patch
Braces   +13 added lines, -8 removed lines patch added patch discarded remove patch
@@ -48,8 +48,9 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function __destruct()
50 50
     {
51
-        if ($this->path && is_dir($this->path) && !self::delTree($this->path))
52
-            throw new OptimiseException('problems during removing of path directory');
51
+        if ($this->path && is_dir($this->path) && !self::delTree($this->path)) {
52
+                    throw new OptimiseException('problems during removing of path directory');
53
+        }
53 54
     }
54 55
 
55 56
     /**
@@ -76,12 +77,16 @@  discard block
 block discarded – undo
76 77
     {
77 78
         $path = new Path(tempnam(sys_get_temp_dir(), 'OPT')); //TODO check the return in case of errors this return false on failure
78 79
         unlink($path->getPath()); //remove file to create a dir
79
-        if(file_exists($path->getPath()))
80
-            throw new OptimiseException('problem during creation of tmp dir (the directory already exists)');
81
-        if(!@mkdir($path->getPath()))
82
-            throw new OptimiseException('problem during creation of tmp dir (mkdir problem)');;
83
-        if(! is_dir($path->getPath()))
84
-            throw new OptimiseException('problem during creation of tmp dir (it is not possible to create directory)');
80
+        if(file_exists($path->getPath())) {
81
+                    throw new OptimiseException('problem during creation of tmp dir (the directory already exists)');
82
+        }
83
+        if(!@mkdir($path->getPath())) {
84
+                    throw new OptimiseException('problem during creation of tmp dir (mkdir problem)');
85
+        }
86
+        ;
87
+        if(! is_dir($path->getPath())) {
88
+                    throw new OptimiseException('problem during creation of tmp dir (it is not possible to create directory)');
89
+        }
85 90
         return $path;
86 91
     }
87 92
 
Please login to merge, or discard this patch.