Passed
Push — master ( df1d09...3d81b9 )
by Reza
03:24
created
src/Parsers/StubParser.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -35,15 +35,15 @@  discard block
 block discarded – undo
35 35
         $this->store = $store;
36 36
     }
37 37
 
38
-    public function setAuthType(bool $hasAuth){
38
+    public function setAuthType(bool $hasAuth) {
39 39
         $this->hasAuth = $hasAuth;
40 40
     }
41 41
 
42
-    public function setFields(array $fields){
42
+    public function setFields(array $fields) {
43 43
         $this->fields = $fields;
44 44
     }
45 45
 
46
-    public function setInputs(array $inputs){
46
+    public function setInputs(array $inputs) {
47 47
         $this->inputs = $inputs;
48 48
     }
49 49
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             $decodedFile = json_decode(File::get($file), 1);
82 82
             $texts = $this->texts;
83 83
             foreach ($texts as $key => $text) {
84
-                if (array_key_exists($key, $decodedFile)){
84
+                if (array_key_exists($key, $decodedFile)) {
85 85
                     unset($texts[$text]);
86 86
                 }
87 87
             }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         $fields = array_keys($this->inputs);
109 109
         $str = '';
110 110
 
111
-        if(in_array($this->inputName, $fields)){
111
+        if (in_array($this->inputName, $fields)) {
112 112
             $this->error("Model name must not equal to column names, fix it and rerun command with -f flag");
113 113
             die;
114 114
         }
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
 
180 180
         foreach ($this->inputs as $key => $field) {
181 181
             $newLine = ($field != end($this->inputs) or $this->hasAuth);
182
-            $str .=  "'$key' => " . '$this' . "->$key,".$this->makeTab(3, $newLine);
182
+            $str .= "'$key' => ".'$this'."->$key,".$this->makeTab(3, $newLine);
183 183
         }
184 184
 
185
-        if($this->hasAuth){
185
+        if ($this->hasAuth) {
186 186
             $str .= "'user_id' => auth()->id(),";
187 187
         }
188 188
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
     /**
193 193
      * Create Blade from stub
194 194
      */
195
-    public function parseBlade($stub){
195
+    public function parseBlade($stub) {
196 196
         $modelName = $this->getModelName($this->parsedModel);
197 197
 
198 198
         $array = [
@@ -218,14 +218,14 @@  discard block
 block discarded – undo
218 218
         $modelName = strtolower($this->getModelName($this->parsedModel));
219 219
         foreach ($fields as $value) {
220 220
             if (!is_array($value)) {
221
-                if(!in_array($value, ['image', 'photo', 'profile', 'banner'])) {
222
-                    $str .= '<td> {{ $' . $modelName . '->' . $value . " }} </td>" . $this->makeTab(1, end($fields) != $value);
221
+                if (!in_array($value, ['image', 'photo', 'profile', 'banner'])) {
222
+                    $str .= '<td> {{ $'.$modelName.'->'.$value." }} </td>".$this->makeTab(1, end($fields) != $value);
223 223
                 } else {
224
-                    $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.'"></a></td>' . $this->makeTab(1, end($fields) != $value);
224
+                    $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.'"></a></td>'.$this->makeTab(1, end($fields) != $value);
225 225
                 }
226 226
            } else {
227 227
                 $relationName = array_key_first($value);
228
-                $str .= '<td> {{ $' . $modelName . '->' . $relationName . '->'. $value[array_key_first($value)] .' }} </td>' . $this->makeTab(1, end($fields) != $value);
228
+                $str .= '<td> {{ $'.$modelName.'->'.$relationName.'->'.$value[array_key_first($value)].' }} </td>'.$this->makeTab(1, end($fields) != $value);
229 229
             }
230 230
         }
231 231
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
                 $str .= "<td style='cursor: pointer' wire:click=\"sort('$sortName')\"> <i class='fa @if(".'$sortType'." == 'desc' and ".'$sortColumn'." == '$sortName') fa-sort-amount-down ml-2 @elseif(".'$sortType == '."'asc' and ".'$sortColumn'." == '$sortName') fa-sort-amount-up ml-2 @endif'></i> {{ __('$field') }} </td>".$this->makeTab(6, end($fields) != $field);
247 247
             } else {
248 248
                 $relationName = array_key_first($field);
249
-                $field = ucfirst($relationName). ' ' . ucfirst($field[array_key_first($field)]);
249
+                $field = ucfirst($relationName).' '.ucfirst($field[array_key_first($field)]);
250 250
                 $str .= "<td> {{ __('$field') }} </td>".$this->makeTab(6, end($fields) != $field);
251 251
             }
252 252
             $this->texts[$field] = $field;
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
     /**
274 274
      * Tab Maker (Each tabs mean 4 space)
275 275
      */
276
-    public function makeTab($count, $newLine = true){
276
+    public function makeTab($count, $newLine = true) {
277 277
         $count = $count * 4;
278 278
         $tabs = str_repeat(' ', $count);
279 279
 
Please login to merge, or discard this patch.
src/Commands/CRUDActions/CommandBase.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
         $path = $this->viewPath("livewire".DIRECTORY_SEPARATOR."admin".DIRECTORY_SEPARATOR."{$this->getNameInput()}".DIRECTORY_SEPARATOR."{$this->file}.blade.php");
53 53
 
54
-        if (! $this->files->isDirectory(dirname($path))) {
54
+        if (!$this->files->isDirectory(dirname($path))) {
55 55
             $this->files->makeDirectory(dirname($path), 0755, true);
56 56
         }
57 57
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
     private function setDataToParser(): void
129 129
     {
130
-        $config = config("easy_panel.crud." . $this->getNameInput());
130
+        $config = config("easy_panel.crud.".$this->getNameInput());
131 131
         $this->stubParser->setAuthType($config['with_auth']);
132 132
         $this->stubParser->setInputs($config['fields']);
133 133
         $this->stubParser->setFields($config['show']);
Please login to merge, or discard this patch.
src/Support/User/UserProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
         $user = $this->findUser($id);
13 13
         $modelInstance = app()->make(config('easy_panel.user_model'));
14 14
         $column = config('easy_panel.column');
15
-        if(in_array($column, $modelInstance->getFillable()) or !in_array($column, $modelInstance->getGuarded()))  {
15
+        if (in_array($column, $modelInstance->getFillable()) or !in_array($column, $modelInstance->getGuarded())) {
16 16
             $user->update([
17 17
                 config('easy_panel.column') => 1
18 18
             ]);
Please login to merge, or discard this patch.