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