Passed
Push — master ( af0465...9c82b2 )
by Prateek
06:01 queued 02:59
created
src/Generators/Common/Seeder.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         file_put_contents($fullFilePath, $factoryTemplate);
24 24
         $generatedFiles[] = $fullFilePath;
25 25
         
26
-        $laragenSeederFile = (self::$initializeFlag++ == 0) ? $this->initializeFile($this->getPath("database/seeds/")."LaragenSeeder.php", 'common/Seeder') :  $this->getPath("database/seeds/")."LaragenSeeder.php";
26
+        $laragenSeederFile = (self::$initializeFlag++ == 0) ? $this->initializeFile($this->getPath("database/seeds/")."LaragenSeeder.php", 'common/Seeder') : $this->getPath("database/seeds/")."LaragenSeeder.php";
27 27
 
28 28
         $this->insertIntoFile(
29 29
             $laragenSeederFile,
@@ -93,23 +93,23 @@  discard block
 block discarded – undo
93 93
 
94 94
         $dataDefinition = "";
95 95
         foreach ($this->module->getNativeData() as $columns) {
96
-            foreach($columns as $column => $type){
96
+            foreach ($columns as $column => $type) {
97 97
                 $specialTypes = array_keys($specialTypesToDefinition);
98
-                if(in_array($column,$specialTypes)){
99
-                    $dataDefinition .= $this->getTabs(2) . "'{$column}'" . " => " . '$faker->' . $specialTypesToDefinition[$column];
100
-                } else{
101
-                    $dataDefinition .= $this->getTabs(2) . "'{$column}'" . " => " . '$faker->' . $typeToDefinition[$type];
98
+                if (in_array($column, $specialTypes)) {
99
+                    $dataDefinition .= $this->getTabs(2)."'{$column}'"." => ".'$faker->'.$specialTypesToDefinition[$column];
100
+                } else {
101
+                    $dataDefinition .= $this->getTabs(2)."'{$column}'"." => ".'$faker->'.$typeToDefinition[$type];
102 102
                 }
103 103
 
104
-                if($column != last($columns)) {
105
-                    $dataDefinition .= "," . PHP_EOL;
104
+                if ($column != last($columns)) {
105
+                    $dataDefinition .= ",".PHP_EOL;
106 106
                 }
107 107
             }
108 108
         }
109 109
         return $dataDefinition;
110 110
     }
111 111
 
112
-    protected function getForeignData(){
112
+    protected function getForeignData() {
113 113
         $columns = $this->module->getForeignColumns('parent');
114 114
 
115 115
         $foreignData = "";
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
                     '{{parentModel}}' => ucfirst(camel_case(str_singular($parent)))
122 122
                 ]);
123 123
                 
124
-                if($column != last($columns)) {
125
-                    $foreignData .= "," . PHP_EOL;
124
+                if ($column != last($columns)) {
125
+                    $foreignData .= ",".PHP_EOL;
126 126
                 }
127 127
             }
128 128
         }
Please login to merge, or discard this patch.
src/Models/DataOption.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $typePieces = array_shift($this->optionArray);
73 73
         $type = explode(':', $typePieces);
74 74
         $this->dataType = is_array($type) ? $type[0] : $type;
75
-        $this->typeOption = is_array($type)&&count($type)>=2 ? $type[1] : false;
75
+        $this->typeOption = is_array($type) && count($type) >= 2 ? $type[1] : false;
76 76
     }
77 77
 
78 78
     public function getSchema()
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     }
145 145
 
146 146
     protected function hasSpecialSchema() {
147
-        if(in_array($this->dataType, self::$specialTypes)){
147
+        if (in_array($this->dataType, self::$specialTypes)) {
148 148
             $this->specialType = $this->dataType;
149 149
             return true;
150 150
         }
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,8 +81,12 @@
 block discarded – undo
81 81
             $schema = $this->processSpecialSchema();
82 82
         } else {
83 83
             foreach ($this->optionArray as $option) {
84
-                if ($option == self::COLUMN_UNIQUE)         $this->hasUnique();
85
-                if (is_numeric($option) && $option <= 2048) $this->hasSize((int) $option);
84
+                if ($option == self::COLUMN_UNIQUE) {
85
+                    $this->hasUnique();
86
+                }
87
+                if (is_numeric($option) && $option <= 2048) {
88
+                    $this->hasSize((int) $option);
89
+                }
86 90
             }
87 91
 
88 92
             $schema = '$table->'.$this->getColumnType()."('{$this->column}'";
Please login to merge, or discard this patch.