Passed
Push — master ( 9c82b2...472045 )
by Prateek
07:54 queued 04:44
created
src/Commands/Generate.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,10 +47,11 @@
 block discarded – undo
47 47
                 $itemGenerator = new $generator($module);
48 48
                 $returnedFiles = $itemGenerator->generate();
49 49
                 
50
-                if (!is_array($returnedFiles)) 
51
-                    $generatedFiles[] = $returnedFiles;
52
-                else
53
-                    $generatedFiles = array_merge($generatedFiles, $returnedFiles);
50
+                if (!is_array($returnedFiles)) {
51
+                                    $generatedFiles[] = $returnedFiles;
52
+                } else {
53
+                                    $generatedFiles = array_merge($generatedFiles, $returnedFiles);
54
+                }
54 55
                 
55 56
                 $bar->advance();
56 57
             }
Please login to merge, or discard this patch.
src/Generators/BaseGenerator.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@
 block discarded – undo
39 39
     {
40 40
         $dir = base_path($path);
41 41
 
42
-        if (!is_dir($dir))
43
-            $this->fileSystem->mkdir($dir, 0755);
42
+        if (!is_dir($dir)) {
43
+                    $this->fileSystem->mkdir($dir, 0755);
44
+        }
44 45
 
45 46
         return $dir;
46 47
     }
Please login to merge, or discard this patch.
src/Models/FileSystem.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
 		if (is_dir($src)) {
14 14
 			$this->mirror($src, $dest."/".basename($src));
15
-		}else{
15
+		} else{
16 16
 			$this->copy($src, $dest);
17 17
 		}
18 18
 	}
Please login to merge, or discard this patch.
src/resources/Controllers/Backend/UploadController.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -116,15 +116,16 @@
 block discarded – undo
116 116
             $filename = pathinfo($path, PATHINFO_FILENAME);
117 117
             $filename .= rand(0,9).'.'.pathinfo($path, PATHINFO_EXTENSION);
118 118
             return $this->getWritableFilename($filename, $moduleName, $is_storage); 
119
-        }else{
119
+        } else{
120 120
             return $is_storage ? $filename : $path;
121 121
         }
122 122
     }
123 123
 
124 124
     protected function getPath($path)
125 125
     {
126
-        if (!is_dir($path))
127
-            mkdir($path, 0755, true);
126
+        if (!is_dir($path)) {
127
+                    mkdir($path, 0755, true);
128
+        }
128 129
 
129 130
         return $path;
130 131
     }
Please login to merge, or discard this patch.
src/Generators/Backend/Request.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@
 block discarded – undo
39 39
                 $type = $valid_types[$type];
40 40
             }
41 41
 
42
-            if(in_array($type, DataOption::$fileTypes) || in_array($type, DataOption::$specialTypes)) continue;
42
+            if(in_array($type, DataOption::$fileTypes) || in_array($type, DataOption::$specialTypes)) {
43
+                continue;
44
+            }
43 45
 
44 46
             $uniqueValidation = '\''.$column.'\' => ($this->route()->'.$modelname.') ? ';
45 47
             $uniqueValidation .= '\''.DataOption::COLUMN_UNIQUE.':'.$this->module->getModulename().','.$column.','.'\''.'.$this->route()->'.$modelname.'->id';
Please login to merge, or discard this patch.
src/Generators/Backend/Controller.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,13 +27,15 @@
 block discarded – undo
27 27
     protected function getFileUploads(){
28 28
         $fileUploads = "";
29 29
         $fileFields = $this->module->getFileColumns();
30
-        if(empty($fileFields)) return "";
30
+        if(empty($fileFields)) {
31
+            return "";
32
+        }
31 33
         if(count($fileFields)>1){
32 34
             $fileUploads .= $this->buildTemplate('backend/fragments/upload-process', [
33 35
                 '{{modelNameLowercase}}' => $this->module->getModelNameLowercase(),
34 36
                 '{{fileFields}}'         => implode('", "', $fileFields),
35 37
             ]);
36
-        }else{
38
+        } else{
37 39
             $fileField = $fileFields[0];
38 40
             $fileUploads .= 'if ($request->has("'.$fileField.'")) {'.PHP_EOL;
39 41
             $fileUploads .= $this->getTabs(3).'$this->uploader->process($request->input("'.$fileField.'"), "category");'.PHP_EOL;
Please login to merge, or discard this patch.
src/Models/Module.php 1 patch
Braces   +18 added lines, -13 removed lines patch added patch discarded remove patch
@@ -58,7 +58,9 @@  discard block
 block discarded – undo
58 58
     {
59 59
         $data = [];
60 60
         foreach ($this->data as $column => $optionString) {
61
-            if (is_array($optionString)) continue;
61
+            if (is_array($optionString)) {
62
+                continue;
63
+            }
62 64
             $optionArray = explode('|', $optionString);
63 65
             if (in_array($optionArray[0], DataOption::$types)) {
64 66
                 $data[] = $column;
@@ -99,10 +101,11 @@  discard block
 block discarded – undo
99 101
 
100 102
     public function getFileColumns($type = 'all')
101 103
     {
102
-        if (is_array($type))
103
-            $types = $type;
104
-        else
105
-            $types = ($type == "all") ? DataOption::$fileTypes : [$type];
104
+        if (is_array($type)) {
105
+                    $types = $type;
106
+        } else {
107
+                    $types = ($type == "all") ? DataOption::$fileTypes : [$type];
108
+        }
106 109
         
107 110
         $data = [];
108 111
         foreach ($this->data as $column => $optionString) {
@@ -140,10 +143,11 @@  discard block
 block discarded – undo
140 143
 
141 144
     public function getForeignColumns($type = 'all')
142 145
     {
143
-        if (is_array($type))
144
-            $types = $type;
145
-        else
146
-            $types = ($type == "all") ? DataOption::$specialTypes : [$type];
146
+        if (is_array($type)) {
147
+                    $types = $type;
148
+        } else {
149
+                    $types = ($type == "all") ? DataOption::$specialTypes : [$type];
150
+        }
147 151
         
148 152
         $data = [];
149 153
         foreach ($this->data as $column => $optionString) {
@@ -157,10 +161,11 @@  discard block
 block discarded – undo
157 161
 
158 162
     public function getForeignData($type = 'all')
159 163
     {
160
-        if (is_array($type))
161
-            $types = $type;
162
-        else
163
-            $types = ($type == "all") ? DataOption::$specialTypes : [$type];
164
+        if (is_array($type)) {
165
+                    $types = $type;
166
+        } else {
167
+                    $types = ($type == "all") ? DataOption::$specialTypes : [$type];
168
+        }
164 169
         
165 170
         $data = [];
166 171
         foreach ($this->data as $column => $optionString) {
Please login to merge, or discard this patch.
src/Models/DataOption.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             // dd($column);
91 91
             // $option = ;
92 92
 
93
-        }else{
93
+        } else{
94 94
             $this->optionArray = explode('|', $optionString);
95 95
             $typePieces = array_shift($this->optionArray);
96 96
             $type = explode(':', $typePieces);
@@ -174,8 +174,9 @@  discard block
 block discarded – undo
174 174
 
175 175
 
176 176
     public function getTextRows() {
177
-        if(!$this->size)
178
-            return 4;
177
+        if(!$this->size) {
178
+                    return 4;
179
+        }
179 180
         
180 181
         return floor($this->getsize()/120);
181 182
     }
Please login to merge, or discard this patch.