Passed
Push — master ( bfaf94...bb8cf7 )
by Reza
04:08
created
src/Commands/Actions/StubParser.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     protected function replaceModel($stub)
22 22
     {
23 23
         $fields = $this->getConfig('fields');
24
-        if(!$fields) {
24
+        if (!$fields) {
25 25
             throw new CommandNotFoundException("There is no `field` in your config file");
26 26
         }
27 27
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         return str_replace(array_keys($array), array_values($array), $stub);
42 42
     }
43 43
 
44
-    protected function parseBlade($stub){
44
+    protected function parseBlade($stub) {
45 45
         $modelNamespace = $this->parseModel($this->getConfig('model'));
46 46
         $modelName = $this->getModelName($modelNamespace);
47 47
         $array = [
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
         return $this->qualifyModel($model);
65 65
     }
66 66
 
67
-    protected function getConfig($key){
67
+    protected function getConfig($key) {
68 68
         $action = $this->getNameInput();
69 69
 
70
-        if(config('easy_panel.actions.'.$action.'.'.$key)){
70
+        if (config('easy_panel.actions.'.$action.'.'.$key)) {
71 71
             return config('easy_panel.actions.'.$action.'.'.$key);
72 72
         }
73 73
 
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
     {
121 121
         $str = '';
122 122
         foreach ($fields as $key => $field) {
123
-            $str .= $field != end($fields) ? "'$key' => " . '$this' . "->$key,".$this->makeTab(3) : "'$key' => " . '$this' . "->$key,";
123
+            $str .= $field != end($fields) ? "'$key' => ".'$this'."->$key,".$this->makeTab(3) : "'$key' => ".'$this'."->$key,";
124 124
         }
125 125
 
126 126
         $model = $this->getNameInput();
127
-        if(config("easy_panel.actions.$model.extra_values")){
127
+        if (config("easy_panel.actions.$model.extra_values")) {
128 128
 
129 129
             $str .= $this->parseExtraValues();
130 130
         }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         return $str;
133 133
     }
134 134
 
135
-    protected function parseExtraValues(){
135
+    protected function parseExtraValues() {
136 136
         $str = '';
137 137
 
138 138
         $values = $this->getConfig('extra_values');
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
             $str .= '<div class="form-group">'.$this->makeTab(4);
177 177
             $str .= '<label for="input'.$key.'" class="col-sm-2 control-label">'.ucfirst($key).'</label>'.$this->makeTab(4);
178 178
             $str = $this->inputsHTML($type, $key, $str).$this->makeTab(4);
179
-            $str .='@error("'.$key.'") <div class="invalid-feedback">{{ $message }}</div> @enderror'.$this->makeTab(3);
179
+            $str .= '@error("'.$key.'") <div class="invalid-feedback">{{ $message }}</div> @enderror'.$this->makeTab(3);
180 180
             $str .= '</div>'.$this->makeTab(3);
181 181
         }
182 182
 
@@ -186,19 +186,19 @@  discard block
 block discarded – undo
186 186
     protected function inputsHTML($type, $key, string $str): string
187 187
     {
188 188
         $array = [
189
-            'text' => '<input type="text" wire:model.lazy="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
190
-            'email' => '<input type="email" wire:model.lazy="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
191
-            'number' => '<input type="number" wire:model.lazy="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
192
-            'file' => '<input type="file" wire:model="' . $key . '" class="form-control-file @error(\''.$key.'\')is-invalid @enderror" id="input' . $key . '">',
193
-            'textarea' => '<textarea wire:model="' . $key . '" class="form-control @error(\''.$key.'\')is-invalid @enderror"></textarea>',
194
-            'password' => '<input type="password" wire:model.lazy="' . $key . '" class="form-control  @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
189
+            'text' => '<input type="text" wire:model.lazy="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
190
+            'email' => '<input type="email" wire:model.lazy="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
191
+            'number' => '<input type="number" wire:model.lazy="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
192
+            'file' => '<input type="file" wire:model="'.$key.'" class="form-control-file @error(\''.$key.'\')is-invalid @enderror" id="input'.$key.'">',
193
+            'textarea' => '<textarea wire:model="'.$key.'" class="form-control @error(\''.$key.'\')is-invalid @enderror"></textarea>',
194
+            'password' => '<input type="password" wire:model.lazy="'.$key.'" class="form-control  @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
195 195
         ];
196 196
         $str .= $array[$type];
197 197
 
198 198
         return $str;
199 199
     }
200 200
 
201
-    private function makeTab($count, $newLine = true){
201
+    private function makeTab($count, $newLine = true) {
202 202
         $count = $count * 4;
203 203
         $tabs = str_repeat(' ', $count);
204 204
 
Please login to merge, or discard this patch.