Passed
Branch master (76e748)
by Reza
03:46
created
src/Commands/Actions/StubParser.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@
 block discarded – undo
159 159
                 } else {
160 160
                     $str .= '<td><a target="_blank" href="{{ asset($' . $modelName . '->' . $value . ') }}"><img class="rounded-circle img-fluid" width="50" height="50" src="{{ asset($' . $modelName . '->' . $value . ') }}" alt="'.$value.'"></td></a>' . $this->makeTab(1, end($fields) != $value);
161 161
                 }
162
-           } else {
162
+            } else {
163 163
                 $relationName = array_key_first($value);
164 164
                 $str .= '<td> {{ $' . $modelName . '->' . $relationName . '->'. $value[array_key_first($value)] .' }} </td>' . $this->makeTab(1, end($fields) != $value);
165 165
             }
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         return str_replace(array_keys($array), array_values($array), $stub);
37 37
     }
38 38
 
39
-    public function parseBlade($stub){
39
+    public function parseBlade($stub) {
40 40
         $modelNamespace = $this->parseModel($this->getConfig('model'));
41 41
         $modelName = $this->getModelName($modelNamespace);
42 42
         $array = [
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         return $this->qualifyModel($model);
60 60
     }
61 61
 
62
-    public function getConfig($key, $action = null){
62
+    public function getConfig($key, $action = null) {
63 63
         $action = $action ?? $this->getNameInput();
64 64
 
65 65
         return config("easy_panel.crud.$action.$key") ?: [];
@@ -125,18 +125,18 @@  discard block
 block discarded – undo
125 125
     {
126 126
         $str = '';
127 127
         foreach ($fields as $key => $field) {
128
-            $str .= $field != end($fields) ? "'$key' => " . '$this' . "->$key,".$this->makeTab(3) : "'$key' => " . '$this' . "->$key,";
128
+            $str .= $field != end($fields) ? "'$key' => ".'$this'."->$key,".$this->makeTab(3) : "'$key' => ".'$this'."->$key,";
129 129
         }
130 130
 
131 131
         $model = $this->getNameInput();
132
-        if(config("easy_panel.crud.$model.extra_values")){
132
+        if (config("easy_panel.crud.$model.extra_values")) {
133 133
             $str .= $this->parseExtraValues();
134 134
         }
135 135
 
136 136
         return $str;
137 137
     }
138 138
 
139
-    public function parseExtraValues(){
139
+    public function parseExtraValues() {
140 140
         $str = '';
141 141
 
142 142
         $values = $this->getConfig('extra_values');
@@ -154,14 +154,14 @@  discard block
 block discarded – undo
154 154
         $modelName = strtolower($modelName);
155 155
         foreach ($fields as $value) {
156 156
             if (!is_array($value)) {
157
-                if(!in_array($value, ['image', 'photo', 'profile', 'banner'])) {
158
-                    $str .= '<td> {{ $' . $modelName . '->' . $value . " }} </td>" . $this->makeTab(1, end($fields) != $value);
157
+                if (!in_array($value, ['image', 'photo', 'profile', 'banner'])) {
158
+                    $str .= '<td> {{ $'.$modelName.'->'.$value." }} </td>".$this->makeTab(1, end($fields) != $value);
159 159
                 } else {
160
-                    $str .= '<td><a target="_blank" href="{{ asset($' . $modelName . '->' . $value . ') }}"><img class="rounded-circle img-fluid" width="50" height="50" src="{{ asset($' . $modelName . '->' . $value . ') }}" alt="'.$value.'"></td></a>' . $this->makeTab(1, end($fields) != $value);
160
+                    $str .= '<td><a target="_blank" href="{{ asset($'.$modelName.'->'.$value.') }}"><img class="rounded-circle img-fluid" width="50" height="50" src="{{ asset($'.$modelName.'->'.$value.') }}" alt="'.$value.'"></td></a>'.$this->makeTab(1, end($fields) != $value);
161 161
                 }
162 162
            } else {
163 163
                 $relationName = array_key_first($value);
164
-                $str .= '<td> {{ $' . $modelName . '->' . $relationName . '->'. $value[array_key_first($value)] .' }} </td>' . $this->makeTab(1, end($fields) != $value);
164
+                $str .= '<td> {{ $'.$modelName.'->'.$relationName.'->'.$value[array_key_first($value)].' }} </td>'.$this->makeTab(1, end($fields) != $value);
165 165
             }
166 166
         }
167 167
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                 $field = ucfirst($field);
178 178
             } else {
179 179
                 $relationName = array_key_first($field);
180
-                $field = ucfirst($relationName). ' ' . ucfirst($field[array_key_first($field)]);
180
+                $field = ucfirst($relationName).' '.ucfirst($field[array_key_first($field)]);
181 181
             }
182 182
             $str .= "<td> $field </td>".$this->makeTab(6, end($fields) != $field);
183 183
         }
@@ -205,19 +205,19 @@  discard block
 block discarded – undo
205 205
     {
206 206
         $mode = config('easy_panel.lazy_mode') ? 'wire:model.lazy' : 'wire:model';
207 207
         $array = [
208
-            'text' => '<input type="text" '. $mode .'="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
209
-            'email' => '<input type="email" '. $mode .'="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
210
-            'number' => '<input type="number" '. $mode .'="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
211
-            'file' => '<input type="file" wire:model="' . $key . '" class="form-control-file @error(\''.$key.'\')is-invalid @enderror" id="input' . $key . '">',
212
-            'textarea' => '<textarea '.$mode.'="' . $key . '" class="form-control @error(\''.$key.'\')is-invalid @enderror"></textarea>',
213
-            'password' => '<input type="password" '. $mode .'="' . $key . '" class="form-control  @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
208
+            'text' => '<input type="text" '.$mode.'="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
209
+            'email' => '<input type="email" '.$mode.'="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
210
+            'number' => '<input type="number" '.$mode.'="'.$key.'" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
211
+            'file' => '<input type="file" wire:model="'.$key.'" class="form-control-file @error(\''.$key.'\')is-invalid @enderror" id="input'.$key.'">',
212
+            'textarea' => '<textarea '.$mode.'="'.$key.'" class="form-control @error(\''.$key.'\')is-invalid @enderror"></textarea>',
213
+            'password' => '<input type="password" '.$mode.'="'.$key.'" class="form-control  @error(\''.$key.'\') is-invalid @enderror" id="input'.$key.'">',
214 214
         ];
215 215
         $str .= $array[$type];
216 216
 
217 217
         return $str;
218 218
     }
219 219
 
220
-    public function makeTab($count, $newLine = true){
220
+    public function makeTab($count, $newLine = true) {
221 221
         $count = $count * 4;
222 222
         $tabs = str_repeat(' ', $count);
223 223
 
Please login to merge, or discard this patch.