| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | 40 | public function execute(CapsuleInterface $capsule): void |
|
| 16 | { |
||
| 17 | 40 | $schema = $capsule->getSchema($this->getTable()); |
|
| 18 | |||
| 19 | 40 | if (!$schema->hasIndex($this->columns)) { |
|
| 20 | 8 | $columns = implode(',', $this->columns); |
|
| 21 | 8 | throw new IndexException( |
|
| 22 | 8 | "Unable to drop index '{$schema->getName()}'.({$columns}), index does not exists" |
|
| 23 | ); |
||
| 24 | } |
||
| 25 | |||
| 26 | 32 | $schema->dropIndex($this->columns); |
|
| 27 | } |
||
| 29 |