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