Passed
Push — master ( 519050...63ccc3 )
by Reza
03:32
created
src/Commands/Actions/StubParser.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         return str_replace(array_keys($array), array_values($array), $stub);
40 40
     }
41 41
 
42
-    public function parseBlade($stub){
42
+    public function parseBlade($stub) {
43 43
         $modelNamespace = $this->parseModel($this->getConfig('model'));
44 44
         $modelName = $this->getModelName($modelNamespace);
45 45
         $array = [
@@ -62,10 +62,10 @@  discard block
 block discarded – undo
62 62
         return $this->qualifyModel($model);
63 63
     }
64 64
 
65
-    public function getConfig($key, $action = null){
65
+    public function getConfig($key, $action = null) {
66 66
         $action = $action ?? $this->getNameInput();
67 67
 
68
-        if(config('easy_panel.crud.'.$action.'.'.$key)){
68
+        if (config('easy_panel.crud.'.$action.'.'.$key)) {
69 69
             return config('easy_panel.crud.'.$action.'.'.$key);
70 70
         }
71 71
 
@@ -118,18 +118,18 @@  discard block
 block discarded – undo
118 118
     {
119 119
         $str = '';
120 120
         foreach ($fields as $key => $field) {
121
-            $str .= $field != end($fields) ? "'$key' => " . '$this' . "->$key,".$this->makeTab(3) : "'$key' => " . '$this' . "->$key,";
121
+            $str .= $field != end($fields) ? "'$key' => ".'$this'."->$key,".$this->makeTab(3) : "'$key' => ".'$this'."->$key,";
122 122
         }
123 123
 
124 124
         $model = $this->getNameInput();
125
-        if(config("easy_panel.crud.$model.extra_values")){
125
+        if (config("easy_panel.crud.$model.extra_values")) {
126 126
             $str .= $this->parseExtraValues();
127 127
         }
128 128
 
129 129
         return $str;
130 130
     }
131 131
 
132
-    public function parseExtraValues(){
132
+    public function parseExtraValues() {
133 133
         $str = '';
134 134
 
135 135
         $values = $this->getConfig('extra_values');
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
         $modelName = strtolower($modelName);
148 148
         foreach ($fields as $value) {
149 149
             if (!is_array($value)) {
150
-                $str .= '<td> {{ $' . $modelName . '->' . $value . " }} </td>" . $this->makeTab(1, end($fields) != $value);
150
+                $str .= '<td> {{ $'.$modelName.'->'.$value." }} </td>".$this->makeTab(1, end($fields) != $value);
151 151
             } else {
152 152
                 $relationName = array_key_first($value);
153
-                $str .= '<td> {{ $' . $modelName . '->' . $relationName . '->'. $value[array_key_first($value)] .' }} </td>' . $this->makeTab(1, end($fields) != $value);
153
+                $str .= '<td> {{ $'.$modelName.'->'.$relationName.'->'.$value[array_key_first($value)].' }} </td>'.$this->makeTab(1, end($fields) != $value);
154 154
             }
155 155
         }
156 156
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
                 $field = ucfirst($field);
167 167
             } else {
168 168
                 $relationName = array_key_first($field);
169
-                $field = ucfirst($relationName). ' ' . ucfirst($field[array_key_first($field)]);
169
+                $field = ucfirst($relationName).' '.ucfirst($field[array_key_first($field)]);
170 170
             }
171 171
             $str .= "<td> $field </td>".$this->makeTab(6, end($fields) != $field);
172 172
         }
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
             $str .= '<div class="form-group">'.$this->makeTab(4);
184 184
             $str .= '<label for="input'.$key.'" class="col-sm-2 control-label">'.ucfirst($key).'</label>'.$this->makeTab(4);
185 185
             $str = $this->inputsHTML($type, $key, $str).$this->makeTab(4);
186
-            $str .='@error("'.$key.'") <div class="invalid-feedback">{{ $message }}</div> @enderror'.$this->makeTab(3);
186
+            $str .= '@error("'.$key.'") <div class="invalid-feedback">{{ $message }}</div> @enderror'.$this->makeTab(3);
187 187
             $str .= '</div>'.$this->makeTab(3);
188 188
         }
189 189
 
@@ -194,19 +194,19 @@  discard block
 block discarded – undo
194 194
     {
195 195
         $mode = config('easy_panel.lazy_mode') ? 'wire:model.lazy' : 'wire:model';
196 196
         $array = [
197
-            'text' => '<input type="text" '. $mode .'="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
198
-            'email' => '<input type="email" '. $mode .'="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
199
-            'number' => '<input type="number" '. $mode .'="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
200
-            'file' => '<input type="file" wire:model="' . $key . '" class="form-control-file @error(\''.$key.'\')is-invalid @enderror" id="input' . $key . '">',
201
-            'textarea' => '<textarea '.$mode.'="' . $key . '" class="form-control @error(\''.$key.'\')is-invalid @enderror"></textarea>',
202
-            'password' => '<input type="password" '. $mode .'="' . $key . '" class="form-control  @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
197
+            'text' => '<input type="text" '.$mode.'="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
198
+            'email' => '<input type="email" '.$mode.'="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
199
+            'number' => '<input type="number" '.$mode.'="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
200
+            'file' => '<input type="file" wire:model="'.$key.'" class="form-control-file @error(\''.$key.'\')is-invalid @enderror" id="input'.$key.'">',
201
+            'textarea' => '<textarea '.$mode.'="'.$key.'" class="form-control @error(\''.$key.'\')is-invalid @enderror"></textarea>',
202
+            'password' => '<input type="password" '.$mode.'="'.$key.'" class="form-control  @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
203 203
         ];
204 204
         $str .= $array[$type];
205 205
 
206 206
         return $str;
207 207
     }
208 208
 
209
-    public function makeTab($count, $newLine = true){
209
+    public function makeTab($count, $newLine = true) {
210 210
         $count = $count * 4;
211 211
         $tabs = str_repeat(' ', $count);
212 212
 
Please login to merge, or discard this patch.