Passed
Push — master ( 845edf...37cc7a )
by Reza
03:10
created
src/Commands/Actions/StubParser.php 1 patch
Spacing   +13 added lines, -13 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,7 +120,7 @@  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
         return $str;
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
             $str .= '<div class="form-group">'.$this->makeTab(4);
160 160
             $str .= '<label for="input'.$key.'" class="col-sm-2 control-label">'.ucfirst($key).'</label>'.$this->makeTab(4);
161 161
             $str = $this->inputsHTML($type, $key, $str).$this->makeTab(4);
162
-            $str .='@error("'.$key.'") <div class="invalid-feedback">{{ $message }}</div> @enderror'.$this->makeTab(3);
162
+            $str .= '@error("'.$key.'") <div class="invalid-feedback">{{ $message }}</div> @enderror'.$this->makeTab(3);
163 163
             $str .= '</div>'.$this->makeTab(3);
164 164
         }
165 165
 
@@ -169,19 +169,19 @@  discard block
 block discarded – undo
169 169
     protected function inputsHTML($type, $key, string $str): string
170 170
     {
171 171
         $array = [
172
-            'text' => '<input type="text" wire:model.lazy="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
173
-            'email' => '<input type="email" wire:model.lazy="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
174
-            'number' => '<input type="number" wire:model.lazy="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
175
-            'file' => '<input type="file" wire:model="' . $key . '" class="form-control-file @error(\''.$key.'\')is-invalid @enderror" id="input' . $key . '">',
176
-            'textarea' => '<textarea wire:model="' . $key . '" class="form-control @error(\''.$key.'\')is-invalid @enderror"></textarea>',
177
-            'password' => '<input type="password" wire:model.lazy="' . $key . '" class="form-control  @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
172
+            'text' => '<input type="text" wire:model.lazy="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
173
+            'email' => '<input type="email" wire:model.lazy="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
174
+            'number' => '<input type="number" wire:model.lazy="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
175
+            'file' => '<input type="file" wire:model="'.$key.'" class="form-control-file @error(\''.$key.'\')is-invalid @enderror" id="input'.$key.'">',
176
+            'textarea' => '<textarea wire:model="'.$key.'" class="form-control @error(\''.$key.'\')is-invalid @enderror"></textarea>',
177
+            'password' => '<input type="password" wire:model.lazy="'.$key.'" class="form-control  @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
178 178
         ];
179 179
         $str .= $array[$type];
180 180
 
181 181
         return $str;
182 182
     }
183 183
 
184
-    private function makeTab($count){
184
+    private function makeTab($count) {
185 185
         $count = $count * 4;
186 186
         $tabs = str_repeat(' ', $count);
187 187
 
Please login to merge, or discard this patch.