| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 6 | public function getSetPresetValues(string $table, string $columnName): ?string |
|
| 31 | { |
||
| 32 | /** @var MigrationsGeneratorSetting $setting */ |
||
| 33 | 6 | $setting = app(MigrationsGeneratorSetting::class); |
|
| 34 | |||
| 35 | 6 | $column = $setting->getConnection()->select("SHOW COLUMNS FROM `${table}` where Field = '${columnName}' AND Type LIKE 'set(%'"); |
|
| 36 | 6 | if (count($column) > 0) { |
|
| 37 | 3 | return substr( |
|
| 38 | 3 | str_replace('set(', '[', $this->spaceAfterComma($column[0]->Type)), |
|
| 39 | 3 | 0, |
|
| 40 | 3 | -1 |
|
| 41 | 3 | ).']'; |
|
| 42 | } |
||
| 43 | |||
| 44 | 3 | return null; |
|
| 45 | } |
||
| 52 |