Passed
Push — master ( f3eaf1...0fde80 )
by Reza
04:06
created
src/Parsers/StubParser.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
         $this->store = $store;
38 38
     }
39 39
 
40
-    public function setAuthType(bool $hasAuth){
40
+    public function setAuthType(bool $hasAuth) {
41 41
         $this->hasAuth = $hasAuth;
42 42
     }
43 43
 
44
-    public function setFields(array $fields){
44
+    public function setFields(array $fields) {
45 45
         $this->fields = $fields;
46 46
     }
47 47
 
48
-    public function setInputs(array $inputs){
48
+    public function setInputs(array $inputs) {
49 49
         $this->inputs = $inputs;
50 50
     }
51 51
 
@@ -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
         }
@@ -181,10 +181,10 @@  discard block
 block discarded – undo
181 181
 
182 182
         foreach ($this->inputs as $key => $field) {
183 183
             $newLine = ($field != end($this->inputs) or $this->hasAuth);
184
-            $str .=  "'$key' => " . '$this' . "->$key,".$this->makeTab(3, $newLine);
184
+            $str .= "'$key' => ".'$this'."->$key,".$this->makeTab(3, $newLine);
185 185
         }
186 186
 
187
-        if($this->hasAuth){
187
+        if ($this->hasAuth) {
188 188
             $str .= "'user_id' => auth()->id(),";
189 189
         }
190 190
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
     /**
195 195
      * Create Blade from stub
196 196
      */
197
-    public function parseBlade($stub){
197
+    public function parseBlade($stub) {
198 198
         $modelName = $this->getModelName($this->parsedModel);
199 199
 
200 200
         $array = [
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
             $str .= $inputObject->setKey($key)->setAction($this->inputName)->render();
269 269
 
270 270
             $this->texts[$inputObject->getTitle()] = $inputObject->getTitle();
271
-            if ($placeholder = $inputObject->getPlaceholder()){
271
+            if ($placeholder = $inputObject->getPlaceholder()) {
272 272
                 $this->texts[$placeholder] = $placeholder;
273 273
             }
274 274
         }
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
     /**
280 280
      * Tab Maker (Each tabs mean 4 space)
281 281
      */
282
-    public function makeTab($count, $newLine = true){
282
+    public function makeTab($count, $newLine = true) {
283 283
         $count = $count * 4;
284 284
         $tabs = str_repeat(' ', $count);
285 285
 
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 
296 296
     private function normalizeField($field)
297 297
     {
298
-        if($field instanceof Field){
298
+        if ($field instanceof Field) {
299 299
             return $field;
300 300
         }
301 301
 
@@ -304,8 +304,8 @@  discard block
 block discarded – undo
304 304
         return Field::title($title);
305 305
     }
306 306
 
307
-    private function normalizeInput($key, $input){
308
-        if ($input instanceof BaseInput){
307
+    private function normalizeInput($key, $input) {
308
+        if ($input instanceof BaseInput) {
309 309
             return $input;
310 310
         }
311 311
 
Please login to merge, or discard this patch.