Passed
Push — master ( c4eb08...b99ed2 )
by Reza
04:23
created
src/Commands/Actions/StubParser.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         return str_replace(array_keys($array), array_values($array), $stub);
39 39
     }
40 40
 
41
-    public function parseBlade($stub){
41
+    public function parseBlade($stub) {
42 42
         $modelNamespace = $this->parseModel($this->getConfig('model'));
43 43
         $modelName = $this->getModelName($modelNamespace);
44 44
         $array = [
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
         return $this->qualifyModel($model);
62 62
     }
63 63
 
64
-    public function getConfig($key, $action = null){
64
+    public function getConfig($key, $action = null) {
65 65
         $action = $action ?? $this->getNameInput();
66 66
 
67
-        if(config('easy_panel.crud.'.$action.'.'.$key)){
67
+        if (config('easy_panel.crud.'.$action.'.'.$key)) {
68 68
             return config('easy_panel.crud.'.$action.'.'.$key);
69 69
         }
70 70
 
@@ -117,18 +117,18 @@  discard block
 block discarded – undo
117 117
     {
118 118
         $str = '';
119 119
         foreach ($fields as $key => $field) {
120
-            $str .= $field != end($fields) ? "'$key' => " . '$this' . "->$key,".$this->makeTab(3) : "'$key' => " . '$this' . "->$key,";
120
+            $str .= $field != end($fields) ? "'$key' => ".'$this'."->$key,".$this->makeTab(3) : "'$key' => ".'$this'."->$key,";
121 121
         }
122 122
 
123 123
         $model = $this->getNameInput();
124
-        if(config("easy_panel.crud.$model.extra_values")){
124
+        if (config("easy_panel.crud.$model.extra_values")) {
125 125
             $str .= $this->parseExtraValues();
126 126
         }
127 127
 
128 128
         return $str;
129 129
     }
130 130
 
131
-    public function parseExtraValues(){
131
+    public function parseExtraValues() {
132 132
         $str = '';
133 133
 
134 134
         $values = $this->getConfig('extra_values');
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
             $str .= '<div class="form-group">'.$this->makeTab(4);
173 173
             $str .= '<label for="input'.$key.'" class="col-sm-2 control-label">'.ucfirst($key).'</label>'.$this->makeTab(4);
174 174
             $str = $this->inputsHTML($type, $key, $str).$this->makeTab(4);
175
-            $str .='@error("'.$key.'") <div class="invalid-feedback">{{ $message }}</div> @enderror'.$this->makeTab(3);
175
+            $str .= '@error("'.$key.'") <div class="invalid-feedback">{{ $message }}</div> @enderror'.$this->makeTab(3);
176 176
             $str .= '</div>'.$this->makeTab(3);
177 177
         }
178 178
 
@@ -182,19 +182,19 @@  discard block
 block discarded – undo
182 182
     public function inputsHTML($type, $key, string $str): string
183 183
     {
184 184
         $array = [
185
-            'text' => '<input type="text" wire:model.lazy="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
186
-            'email' => '<input type="email" wire:model.lazy="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
187
-            'number' => '<input type="number" wire:model.lazy="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
188
-            'file' => '<input type="file" wire:model="' . $key . '" class="form-control-file @error(\''.$key.'\')is-invalid @enderror" id="input' . $key . '">',
189
-            'textarea' => '<textarea wire:model="' . $key . '" class="form-control @error(\''.$key.'\')is-invalid @enderror"></textarea>',
190
-            'password' => '<input type="password" wire:model.lazy="' . $key . '" class="form-control  @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
185
+            'text' => '<input type="text" wire:model.lazy="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
186
+            'email' => '<input type="email" wire:model.lazy="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
187
+            'number' => '<input type="number" wire:model.lazy="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
188
+            'file' => '<input type="file" wire:model="'.$key.'" class="form-control-file @error(\''.$key.'\')is-invalid @enderror" id="input'.$key.'">',
189
+            'textarea' => '<textarea wire:model="'.$key.'" class="form-control @error(\''.$key.'\')is-invalid @enderror"></textarea>',
190
+            'password' => '<input type="password" wire:model.lazy="'.$key.'" class="form-control  @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
191 191
         ];
192 192
         $str .= $array[$type];
193 193
 
194 194
         return $str;
195 195
     }
196 196
 
197
-    public function makeTab($count, $newLine = true){
197
+    public function makeTab($count, $newLine = true) {
198 198
         $count = $count * 4;
199 199
         $tabs = str_repeat(' ', $count);
200 200
 
Please login to merge, or discard this patch.