| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 120 | public function execute(CapsuleInterface $capsule): void |
|
| 18 | { |
||
| 19 | 120 | $schema = $capsule->getSchema($this->getTable()); |
|
| 20 | 120 | $database = $this->database ?? '[default]'; |
|
|
|
|||
| 21 | |||
| 22 | 120 | if (!$schema->exists()) { |
|
| 23 | 8 | throw new TableException( |
|
| 24 | 8 | "Unable to update table '{$database}'.'{$this->getTable()}', no table exists" |
|
| 25 | ); |
||
| 26 | } |
||
| 27 | |||
| 28 | 112 | $schema->save(HandlerInterface::DO_ALL); |
|
| 29 | } |
||
| 31 |