Passed
Push — master ( b06026...71569d )
by Reza
03:12
created
src/Parsers/StubParser.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -48,15 +48,15 @@  discard block
 block discarded – undo
48 48
         $this->store = $store;
49 49
     }
50 50
 
51
-    public function setAuthType(bool $hasAuth){
51
+    public function setAuthType(bool $hasAuth) {
52 52
         $this->hasAuth = $hasAuth;
53 53
     }
54 54
 
55
-    public function setFields(array $fields){
55
+    public function setFields(array $fields) {
56 56
         $this->fields = $fields;
57 57
     }
58 58
 
59
-    public function setInputs(array $inputs){
59
+    public function setInputs(array $inputs) {
60 60
         $this->inputs = $inputs;
61 61
     }
62 62
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             $decodedFile = json_decode(File::get($file), 1);
93 93
             $texts = $this->texts;
94 94
             foreach ($texts as $key => $text) {
95
-                if (array_key_exists($key, $decodedFile)){
95
+                if (array_key_exists($key, $decodedFile)) {
96 96
                     unset($texts[$text]);
97 97
                 }
98 98
             }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         $fields = array_keys($this->inputs);
120 120
         $str = '';
121 121
 
122
-        if(in_array($this->inputName, $fields)){
122
+        if (in_array($this->inputName, $fields)) {
123 123
             $this->error("Model name must not equal to column names, fix it and rerun command with -f flag");
124 124
             die;
125 125
         }
@@ -190,10 +190,10 @@  discard block
 block discarded – undo
190 190
 
191 191
         foreach ($this->inputs as $key => $field) {
192 192
             $newLine = ($field != end($this->inputs) or $this->hasAuth);
193
-            $str .=  "'$key' => " . '$this' . "->$key,".$this->makeTab(3, $newLine);
193
+            $str .= "'$key' => ".'$this'."->$key,".$this->makeTab(3, $newLine);
194 194
         }
195 195
 
196
-        if($this->hasAuth){
196
+        if ($this->hasAuth) {
197 197
             $str .= "'user_id' => auth()->id(),";
198 198
         }
199 199
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     /**
204 204
      * Create Blade from stub
205 205
      */
206
-    public function parseBlade($stub){
206
+    public function parseBlade($stub) {
207 207
         $modelName = $this->getModelName($this->parsedModel);
208 208
 
209 209
         $array = [
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
             $normalizedField = $this->normalizeField($field);
233 233
             $str .= $normalizedField->setModel($modelName)->setKey($key)->renderData();
234 234
 
235
-            if (array_key_first($fields) != $key){
235
+            if (array_key_first($fields) != $key) {
236 236
                 $str .= $this->makeTab(1, array_key_last($fields) != $key);
237 237
             }
238 238
         }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
             $normalizedField = $this->normalizeField($field);
255 255
             $str .= $normalizedField->setModel($modelName)->setKey($key)->renderTitle();
256 256
 
257
-            if (array_key_first($fields) != $key){
257
+            if (array_key_first($fields) != $key) {
258 258
                 $str .= $this->makeTab(6, array_key_last($fields) != $key);
259 259
             }
260 260
 
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
     /**
284 284
      * Tab Maker (Each tabs mean 4 space)
285 285
      */
286
-    public function makeTab($count, $newLine = true){
286
+    public function makeTab($count, $newLine = true) {
287 287
         $count = $count * 4;
288 288
         $tabs = str_repeat(' ', $count);
289 289
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 
300 300
     private function normalizeField($field)
301 301
     {
302
-        if($field instanceof Field){
302
+        if ($field instanceof Field) {
303 303
             return $field;
304 304
         }
305 305
 
Please login to merge, or discard this patch.