Passed
Pull Request — master (#118)
by
unknown
12:52
created
src/GraphBuilder.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
         } catch (\Throwable $e) {
56 56
         }
57 57
 
58
-        return [];
58
+        return [ ];
59 59
     }
60 60
 
61 61
     protected function getModelLabel(EloquentModel $model, string $label)
62 62
     {
63 63
 
64 64
         $table = '<<table width="100%" height="100%" border="0" margin="0" cellborder="1" cellspacing="0" cellpadding="10">' . PHP_EOL;
65
-        $table .= '<tr width="100%"><td width="100%" bgcolor="'.config('erd-generator.table.header_background_color').'"><font color="'.config('erd-generator.table.header_font_color').'">' . $label . '</font></td></tr>' . PHP_EOL;
65
+        $table .= '<tr width="100%"><td width="100%" bgcolor="' . config('erd-generator.table.header_background_color') . '"><font color="' . config('erd-generator.table.header_font_color') . '">' . $label . '</font></td></tr>' . PHP_EOL;
66 66
 
67 67
         if (config('erd-generator.use_db_schema')) {
68 68
             $columns = $this->getTableColumnsFromModel($model);
@@ -71,14 +71,14 @@  discard block
 block discarded – undo
71 71
                     $name = $column->getName();
72 72
                     $typeName = $column->getType()->getName();
73 73
                 } else { // it's an array!
74
-                    $name = $column['name'];
75
-                    $typeName = $column['type_name'];
74
+                    $name = $column[ 'name' ];
75
+                    $typeName = $column[ 'type_name' ];
76 76
                 }
77 77
                 $label = $name;
78 78
                 if (config('erd-generator.use_column_types')) {
79
-                    $label .= ' ('. $typeName .')';
79
+                    $label .= ' (' . $typeName . ')';
80 80
                 }
81
-                $table .= '<tr width="100%"><td port="' . $name . '" align="left" width="100%"  bgcolor="'.config('erd-generator.table.row_background_color').'"><font color="'.config('erd-generator.table.row_font_color').'" >' . $label . '</font></td></tr>' . PHP_EOL;
81
+                $table .= '<tr width="100%"><td port="' . $name . '" align="left" width="100%"  bgcolor="' . config('erd-generator.table.row_background_color') . '"><font color="' . config('erd-generator.table.row_font_color') . '" >' . $label . '</font></td></tr>' . PHP_EOL;
82 82
             }
83 83
         }
84 84
 
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
     protected function addModelsToGraph(Collection $models)
91 91
     {
92 92
         // Add models to graph
93
-        $models->map(function (Model $model) {
93
+        $models->map(function(Model $model) {
94 94
             $eloquentModel = app($model->getModel());
95 95
             $this->addNodeToGraph($eloquentModel, $model->getNodeName(), $model->getLabel());
96 96
         });
97 97
 
98 98
         // Create relations
99
-        $models->map(function ($model) {
99
+        $models->map(function($model) {
100 100
             $this->addRelationToGraph($model);
101 101
         });
102 102
     }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             $edge->{"set{$key}"}($value);
146 146
         }
147 147
 
148
-        foreach (config('erd-generator.relations.' . $relation->getType(), []) as $key => $value) {
148
+        foreach (config('erd-generator.relations.' . $relation->getType(), [ ]) as $key => $value) {
149 149
             $edge->{"set{$key}"}($value);
150 150
         }
151 151
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
             );
207 207
 
208 208
             $this->connectNodes($pivotModelNode, $relatedModelNode, $relation);
209
-        } catch (\ReflectionException $e){}
209
+        } catch (\ReflectionException $e) {}
210 210
     }
211 211
 
212 212
     /**
Please login to merge, or discard this patch.