@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $database = $dbal->database($this->option('database')); |
44 | 44 | $schema = $database->table($this->argument('table'))->getSchema(); |
45 | 45 | |
46 | - if (!$schema->exists()) { |
|
46 | + if (!$schema->exists()){ |
|
47 | 47 | throw new DBALException( |
48 | 48 | "Table {$database->getName()}.{$this->argument('table')} does not exists." |
49 | 49 | ); |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | |
58 | 58 | $this->describeColumns($schema); |
59 | 59 | |
60 | - if (!empty($indexes = $schema->getIndexes())) { |
|
60 | + if (!empty($indexes = $schema->getIndexes())){ |
|
61 | 61 | $this->describeIndexes($database, $indexes); |
62 | 62 | } |
63 | 63 | |
64 | - if (!empty($foreignKeys = $schema->getForeignKeys())) { |
|
64 | + if (!empty($foreignKeys = $schema->getForeignKeys())){ |
|
65 | 65 | $this->describeForeignKeys($database, $foreignKeys); |
66 | 66 | } |
67 | 67 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | 'Default Value:' |
82 | 82 | ]); |
83 | 83 | |
84 | - foreach ($schema->getColumns() as $column) { |
|
84 | + foreach ($schema->getColumns() as $column){ |
|
85 | 85 | $name = $column->getName(); |
86 | 86 | |
87 | - if (in_array($column->getName(), $schema->getPrimaryKeys())) { |
|
87 | + if (in_array($column->getName(), $schema->getPrimaryKeys())){ |
|
88 | 88 | $name = "<fg=magenta>{$name}</fg=magenta>"; |
89 | 89 | } |
90 | 90 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | ); |
114 | 114 | |
115 | 115 | $indexesTable = $this->table(['Name:', 'Type:', 'Columns:']); |
116 | - foreach ($indexes as $index) { |
|
116 | + foreach ($indexes as $index){ |
|
117 | 117 | $indexesTable->addRow([ |
118 | 118 | $index->getName(), |
119 | 119 | $index->isUnique() ? 'UNIQUE INDEX' : 'INDEX', |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | 'On Update:' |
145 | 145 | ]); |
146 | 146 | |
147 | - foreach ($foreignKeys as $reference) { |
|
147 | + foreach ($foreignKeys as $reference){ |
|
148 | 148 | $foreignTable->addRow([ |
149 | 149 | $reference->getName(), |
150 | 150 | join(', ', $reference->getColumns()), |
@@ -168,11 +168,11 @@ discard block |
||
168 | 168 | |
169 | 169 | $abstractType = $column->getAbstractType(); |
170 | 170 | |
171 | - if ($column->getSize()) { |
|
171 | + if ($column->getSize()){ |
|
172 | 172 | $type .= " ({$column->getSize()})"; |
173 | 173 | } |
174 | 174 | |
175 | - if ($abstractType == 'decimal') { |
|
175 | + if ($abstractType == 'decimal'){ |
|
176 | 176 | $type .= " ({$column->getPrecision()}, {$column->getScale()})"; |
177 | 177 | } |
178 | 178 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | { |
188 | 188 | $abstractType = $column->getAbstractType(); |
189 | 189 | |
190 | - if (in_array($abstractType, ['primary', 'bigPrimary'])) { |
|
190 | + if (in_array($abstractType, ['primary', 'bigPrimary'])){ |
|
191 | 191 | $abstractType = "<fg=magenta>{$abstractType}</fg=magenta>"; |
192 | 192 | } |
193 | 193 | |
@@ -202,11 +202,11 @@ discard block |
||
202 | 202 | { |
203 | 203 | $defaultValue = $column->getDefaultValue(); |
204 | 204 | |
205 | - if ($defaultValue instanceof FragmentInterface) { |
|
205 | + if ($defaultValue instanceof FragmentInterface){ |
|
206 | 206 | $defaultValue = "<info>{$defaultValue}</info>"; |
207 | 207 | } |
208 | 208 | |
209 | - if ($defaultValue instanceof \DateTimeInterface) { |
|
209 | + if ($defaultValue instanceof \DateTimeInterface){ |
|
210 | 210 | $defaultValue = $defaultValue->format('c'); |
211 | 211 | } |
212 | 212 |
@@ -43,7 +43,8 @@ discard block |
||
43 | 43 | $database = $dbal->database($this->option('database')); |
44 | 44 | $schema = $database->table($this->argument('table'))->getSchema(); |
45 | 45 | |
46 | - if (!$schema->exists()) { |
|
46 | + if (!$schema->exists()) |
|
47 | + { |
|
47 | 48 | throw new DBALException( |
48 | 49 | "Table {$database->getName()}.{$this->argument('table')} does not exists." |
49 | 50 | ); |
@@ -57,11 +58,13 @@ discard block |
||
57 | 58 | |
58 | 59 | $this->describeColumns($schema); |
59 | 60 | |
60 | - if (!empty($indexes = $schema->getIndexes())) { |
|
61 | + if (!empty($indexes = $schema->getIndexes())) |
|
62 | + { |
|
61 | 63 | $this->describeIndexes($database, $indexes); |
62 | 64 | } |
63 | 65 | |
64 | - if (!empty($foreignKeys = $schema->getForeignKeys())) { |
|
66 | + if (!empty($foreignKeys = $schema->getForeignKeys())) |
|
67 | + { |
|
65 | 68 | $this->describeForeignKeys($database, $foreignKeys); |
66 | 69 | } |
67 | 70 | |
@@ -81,10 +84,12 @@ discard block |
||
81 | 84 | 'Default Value:' |
82 | 85 | ]); |
83 | 86 | |
84 | - foreach ($schema->getColumns() as $column) { |
|
87 | + foreach ($schema->getColumns() as $column) |
|
88 | + { |
|
85 | 89 | $name = $column->getName(); |
86 | 90 | |
87 | - if (in_array($column->getName(), $schema->getPrimaryKeys())) { |
|
91 | + if (in_array($column->getName(), $schema->getPrimaryKeys())) |
|
92 | + { |
|
88 | 93 | $name = "<fg=magenta>{$name}</fg=magenta>"; |
89 | 94 | } |
90 | 95 | |
@@ -113,7 +118,8 @@ discard block |
||
113 | 118 | ); |
114 | 119 | |
115 | 120 | $indexesTable = $this->table(['Name:', 'Type:', 'Columns:']); |
116 | - foreach ($indexes as $index) { |
|
121 | + foreach ($indexes as $index) |
|
122 | + { |
|
117 | 123 | $indexesTable->addRow([ |
118 | 124 | $index->getName(), |
119 | 125 | $index->isUnique() ? 'UNIQUE INDEX' : 'INDEX', |
@@ -144,7 +150,8 @@ discard block |
||
144 | 150 | 'On Update:' |
145 | 151 | ]); |
146 | 152 | |
147 | - foreach ($foreignKeys as $reference) { |
|
153 | + foreach ($foreignKeys as $reference) |
|
154 | + { |
|
148 | 155 | $foreignTable->addRow([ |
149 | 156 | $reference->getName(), |
150 | 157 | join(', ', $reference->getColumns()), |
@@ -168,11 +175,13 @@ discard block |
||
168 | 175 | |
169 | 176 | $abstractType = $column->getAbstractType(); |
170 | 177 | |
171 | - if ($column->getSize()) { |
|
178 | + if ($column->getSize()) |
|
179 | + { |
|
172 | 180 | $type .= " ({$column->getSize()})"; |
173 | 181 | } |
174 | 182 | |
175 | - if ($abstractType == 'decimal') { |
|
183 | + if ($abstractType == 'decimal') |
|
184 | + { |
|
176 | 185 | $type .= " ({$column->getPrecision()}, {$column->getScale()})"; |
177 | 186 | } |
178 | 187 | |
@@ -187,7 +196,8 @@ discard block |
||
187 | 196 | { |
188 | 197 | $abstractType = $column->getAbstractType(); |
189 | 198 | |
190 | - if (in_array($abstractType, ['primary', 'bigPrimary'])) { |
|
199 | + if (in_array($abstractType, ['primary', 'bigPrimary'])) |
|
200 | + { |
|
191 | 201 | $abstractType = "<fg=magenta>{$abstractType}</fg=magenta>"; |
192 | 202 | } |
193 | 203 | |
@@ -202,11 +212,13 @@ discard block |
||
202 | 212 | { |
203 | 213 | $defaultValue = $column->getDefaultValue(); |
204 | 214 | |
205 | - if ($defaultValue instanceof FragmentInterface) { |
|
215 | + if ($defaultValue instanceof FragmentInterface) |
|
216 | + { |
|
206 | 217 | $defaultValue = "<info>{$defaultValue}</info>"; |
207 | 218 | } |
208 | 219 | |
209 | - if ($defaultValue instanceof \DateTimeInterface) { |
|
220 | + if ($defaultValue instanceof \DateTimeInterface) |
|
221 | + { |
|
210 | 222 | $defaultValue = $defaultValue->format('c'); |
211 | 223 | } |
212 | 224 |