Passed
Branch master (166945)
by Jeferson
01:58
created
Examples/remove-dir.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
12 12
 $resultTwo = $url -> RemoveDir($dirTwo);
13 13
 
14 14
 //Print
15
-if($resultOne && $resultTwo){
15
+if ($resultOne && $resultTwo) {
16 16
     echo "success";
17
-}else{
17
+}else {
18 18
     echo "Oops... Error";
19 19
 }
20 20
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,6 +14,6 @@
 block discarded – undo
14 14
 //Print
15 15
 if($resultOne && $resultTwo){
16 16
     echo "success";
17
-}else{
17
+} else{
18 18
     echo "Oops... Error";
19 19
 }
20 20
\ No newline at end of file
Please login to merge, or discard this patch.
Examples/remove-file.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@
 block discarded – undo
7 7
 $result = $url -> RemoveFile($dir, $file);
8 8
 
9 9
 //Print
10
-if($result){
10
+if ($result) {
11 11
     echo "success";
12
-}else{
12
+}else {
13 13
     echo "Oops... Error";
14 14
 }
15 15
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,6 +9,6 @@
 block discarded – undo
9 9
 //Print
10 10
 if($result){
11 11
     echo "success";
12
-}else{
12
+} else{
13 13
     echo "Oops... Error";
14 14
 }
15 15
\ No newline at end of file
Please login to merge, or discard this patch.
Examples/create-folder-file.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@
 block discarded – undo
17 17
 $result = $url -> CreateFileDir($dir, $folder, $new, $text);
18 18
 
19 19
 //Print
20
-if($result){
20
+if ($result) {
21 21
     echo "Success!";
22
-}else{
22
+}else {
23 23
     echo "Oops, error";
24 24
 }
25 25
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,6 +19,6 @@
 block discarded – undo
19 19
 //Print
20 20
 if($result){
21 21
     echo "Success!";
22
-}else{
22
+} else{
23 23
     echo "Oops, error";
24 24
 }
25 25
\ No newline at end of file
Please login to merge, or discard this patch.
Examples/create-file.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@
 block discarded – undo
10 10
 $result = $url -> FileWrite($file, $text);
11 11
 
12 12
 //Print
13
-if($result){
13
+if ($result) {
14 14
     echo "Success!";
15
-}else{
15
+}else {
16 16
     echo "Oops, error";
17 17
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,6 +12,6 @@
 block discarded – undo
12 12
 //Print
13 13
 if($result){
14 14
     echo "Success!";
15
-}else{
15
+} else{
16 16
     echo "Oops, error";
17 17
 }
Please login to merge, or discard this patch.
Examples/write-file.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@
 block discarded – undo
10 10
 $result = $url -> FileReadWrite($dirFile, $text);
11 11
 
12 12
 //Print
13
-if($result){
13
+if ($result) {
14 14
     echo "success";
15
-}else{
15
+}else {
16 16
     echo "Oops... Error";
17 17
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,6 +12,6 @@
 block discarded – undo
12 12
 //Print
13 13
 if($result){
14 14
     echo "success";
15
-}else{
15
+} else{
16 16
     echo "Oops... Error";
17 17
 }
Please login to merge, or discard this patch.
Examples/remove-files.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@
 block discarded – undo
5 5
 $dir = __DIR__ . "/vendor/myFolder/";
6 6
 
7 7
 //Files
8
-$file = array("myFile1.txt", "myFile2.txt","myFile3.txt");
8
+$file = array("myFile1.txt", "myFile2.txt", "myFile3.txt");
9 9
 $url = new \Developers\Dir();
10 10
 $result = $url -> RemoveFileMultiple($dir, $file);
11 11
 
12 12
 //Print
13
-if($result){
13
+if ($result) {
14 14
     echo "success";
15
-}else{
15
+}else {
16 16
     echo "Oops... Error";
17 17
 }
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,6 +12,6 @@
 block discarded – undo
12 12
 //Print
13 13
 if($result){
14 14
     echo "success";
15
-}else{
15
+} else{
16 16
     echo "Oops... Error";
17 17
 }
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
Examples/remove-folder.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@
 block discarded – undo
7 7
 $result = $url -> RemoveDir($folder);
8 8
 
9 9
 //Print
10
-if($result){
10
+if ($result) {
11 11
     echo "success";
12
-}else{
12
+}else {
13 13
     echo "Oops... Error";
14 14
 }
15 15
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,6 +9,6 @@
 block discarded – undo
9 9
 //Print
10 10
 if($result){
11 11
     echo "success";
12
-}else{
12
+} else{
13 13
     echo "Oops... Error";
14 14
 }
15 15
\ No newline at end of file
Please login to merge, or discard this patch.
Developers/Dir.php 2 patches
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
      * Método Para Leitura de Arquivos - Apresentando as Informações do Documento na Tela.
25 25
      * @param $file
26 26
      */
27
-    public function FileRead($file){
27
+    public function FileRead($file) {
28 28
         $fopen = fopen($file, "r");
29
-        while($showData = fgets($fopen)){
30
-            echo $showData ."<br>";
29
+        while ($showData = fgets($fopen)) {
30
+            echo $showData . "<br>";
31 31
         }
32 32
         fclose($fopen);
33 33
     }
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      * @param $text
40 40
      * @return bool
41 41
      */
42
-    public function FileWrite($file, $text){
42
+    public function FileWrite($file, $text) {
43 43
         $fopen = fopen($file, "w");
44 44
         fwrite($fopen, $text);
45 45
         fclose($fopen);
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
      * @param $text
55 55
      * @return bool
56 56
      */
57
-    public function FileReadWrite($file, $text){
57
+    public function FileReadWrite($file, $text) {
58 58
         $fopen = fopen($file, "a+");
59
-        fwrite($fopen, $text.PHP_EOL);
59
+        fwrite($fopen, $text . PHP_EOL);
60 60
         fclose($fopen);
61 61
 
62 62
         return true;
@@ -68,13 +68,13 @@  discard block
 block discarded – undo
68 68
      * @param $dir
69 69
      * @return bool
70 70
      */
71
-    public function CreateDir ($dir) {
71
+    public function CreateDir($dir) {
72 72
         $dirVerify = str_replace("\\", "/", $dir);
73 73
 
74
-        if(!is_dir($dirVerify) && !file_exists($dirVerify)){
74
+        if (!is_dir($dirVerify) && !file_exists($dirVerify)) {
75 75
             mkdir($dirVerify, "0755");
76 76
             return true;
77
-        }else{
77
+        }else {
78 78
             return false;
79 79
         }
80 80
     }
@@ -88,32 +88,32 @@  discard block
 block discarded – undo
88 88
      * @param string $text
89 89
      * @return bool|null
90 90
      */
91
-    public function CreateFileDir ($dir, $folder, $file = "", $text = ""){
91
+    public function CreateFileDir($dir, $folder, $file = "", $text = "") {
92 92
         $dirVerify = str_replace("\\", "/", $dir);
93 93
 
94 94
         //Create the folder
95 95
         //Criar a pasta
96
-        if(!is_dir($dirVerify) && !file_exists($dirVerify)) {
96
+        if (!is_dir($dirVerify) && !file_exists($dirVerify)) {
97 97
             mkdir($dirVerify, "0755");
98 98
         }
99 99
 
100 100
         //Create the subfolder
101 101
         //Criar a subpasta
102
-        if(!is_dir($dirVerify . $folder) && !file_exists($dirVerify . $folder)){
102
+        if (!is_dir($dirVerify . $folder) && !file_exists($dirVerify . $folder)) {
103 103
             mkdir($dirVerify . $folder, "0755");
104 104
         }
105 105
 
106 106
         //Create the file with the text
107 107
         //Criar o arquivo com o texto
108
-        if($file != '' || $file != null) {
108
+        if ($file != '' || $file != null) {
109 109
             $fopen = file_put_contents($dirVerify . $folder . $file, $text . "\n", FILE_APPEND);
110 110
         }
111 111
 
112 112
         //Checks whether the folder, subfolder and file exist
113 113
         //Verifica se a pasta, subpasta e arquivo existem
114
-        if(file_exists($dirVerify . $folder . $file)){
114
+        if (file_exists($dirVerify . $folder . $file)) {
115 115
             return true;
116
-        }else{
116
+        }else {
117 117
             return false;
118 118
         }
119 119
     }
@@ -124,13 +124,13 @@  discard block
 block discarded – undo
124 124
      * @param $dir
125 125
      * @return bool|null
126 126
      */
127
-    public function RemoveFile ($dir){
127
+    public function RemoveFile($dir) {
128 128
         $dirVerify = str_replace("\\", "/", $dir);
129 129
 
130
-        if(file_exists($dirVerify)){
130
+        if (file_exists($dirVerify)) {
131 131
             unlink($dirVerify);
132 132
             return true;
133
-        }else{
133
+        }else {
134 134
             return false;
135 135
         }
136 136
     }
@@ -142,25 +142,25 @@  discard block
 block discarded – undo
142 142
      * @param array $files
143 143
      * @return string
144 144
      */
145
-    public function RemoveFileMultiple (string $dir, array $files){
145
+    public function RemoveFileMultiple(string $dir, array $files) {
146 146
         $dirVerify = str_replace("\\", "/", $dir);
147 147
 
148
-        if(is_dir($dirVerify) && file_exists($dirVerify)){
148
+        if (is_dir($dirVerify) && file_exists($dirVerify)) {
149 149
 
150
-            for($a = 0; $a < count($files); $a++){
151
-                if(is_dir("{$dirVerify}/{$files[$a]}") && !file_exists("{$dirVerify}/{$files[$a]}")){
150
+            for ($a = 0; $a < count($files); $a++) {
151
+                if (is_dir("{$dirVerify}/{$files[$a]}") && !file_exists("{$dirVerify}/{$files[$a]}")) {
152 152
 
153
-                }else{
154
-                    if(file_exists($dirVerify . $files[$a])) {
153
+                }else {
154
+                    if (file_exists($dirVerify . $files[$a])) {
155 155
                         unlink("{$dirVerify}/{$files[$a]}");
156
-                    }else{
156
+                    }else {
157 157
                         echo "Não foi possível remover um ou mais arquivo(s)!";
158 158
                         return;
159 159
                     }
160 160
                 }
161 161
             }
162 162
             echo "Arquivo(s) removido(s) com sucesso!";
163
-        }else{
163
+        }else {
164 164
             echo "Erro: Não foi possível localizar o(s) arquivo(s)!";
165 165
         }
166 166
     }
@@ -170,22 +170,22 @@  discard block
 block discarded – undo
170 170
      * @param $dir
171 171
      * @return bool
172 172
      */
173
-    public function RemoveDir ($dir){
173
+    public function RemoveDir($dir) {
174 174
         $dirVerify = str_replace("\\", "/", $dir);
175 175
         //Lista os arquivos e remove os pontos da listagem do scandir com array_diff
176 176
         $files = array_diff(scandir($dirVerify), array(".", ".."));
177 177
 
178
-        if(is_dir($dirVerify) && file_exists($dirVerify)){
179
-            foreach($files as $file){
180
-                if(is_dir("{$dirVerify}/{$file}")){
178
+        if (is_dir($dirVerify) && file_exists($dirVerify)) {
179
+            foreach ($files as $file) {
180
+                if (is_dir("{$dirVerify}/{$file}")) {
181 181
                     delTree("{$dirVerify}/{$file}");
182
-                }else{
182
+                }else {
183 183
                     unlink("{$dirVerify}/{$file}");
184 184
                 }
185 185
             }
186 186
             rmdir($dir);
187 187
             return true;
188
-        }else{
188
+        }else {
189 189
             return false;
190 190
         }
191 191
     }
Please login to merge, or discard this patch.
Braces   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         if(!is_dir($dirVerify) && !file_exists($dirVerify)){
75 75
             mkdir($dirVerify, "0755");
76 76
             return true;
77
-        }else{
77
+        } else{
78 78
             return false;
79 79
         }
80 80
     }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         //Verifica se a pasta, subpasta e arquivo existem
114 114
         if(file_exists($dirVerify . $folder . $file)){
115 115
             return true;
116
-        }else{
116
+        } else{
117 117
             return false;
118 118
         }
119 119
     }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         if(file_exists($dirVerify)){
131 131
             unlink($dirVerify);
132 132
             return true;
133
-        }else{
133
+        } else{
134 134
             return false;
135 135
         }
136 136
     }
@@ -150,17 +150,17 @@  discard block
 block discarded – undo
150 150
             for($a = 0; $a < count($files); $a++){
151 151
                 if(is_dir("{$dirVerify}/{$files[$a]}") && !file_exists("{$dirVerify}/{$files[$a]}")){
152 152
 
153
-                }else{
153
+                } else{
154 154
                     if(file_exists($dirVerify . $files[$a])) {
155 155
                         unlink("{$dirVerify}/{$files[$a]}");
156
-                    }else{
156
+                    } else{
157 157
                         echo "Não foi possível remover um ou mais arquivo(s)!";
158 158
                         return;
159 159
                     }
160 160
                 }
161 161
             }
162 162
             echo "Arquivo(s) removido(s) com sucesso!";
163
-        }else{
163
+        } else{
164 164
             echo "Erro: Não foi possível localizar o(s) arquivo(s)!";
165 165
         }
166 166
     }
@@ -179,13 +179,13 @@  discard block
 block discarded – undo
179 179
             foreach($files as $file){
180 180
                 if(is_dir("{$dirVerify}/{$file}")){
181 181
                     delTree("{$dirVerify}/{$file}");
182
-                }else{
182
+                } else{
183 183
                     unlink("{$dirVerify}/{$file}");
184 184
                 }
185 185
             }
186 186
             rmdir($dir);
187 187
             return true;
188
-        }else{
188
+        } else{
189 189
             return false;
190 190
         }
191 191
     }
Please login to merge, or discard this patch.