Code Duplication    Length = 11-13 lines in 2 locations

source/Spiral/Database/Schemas/Prototypes/AbstractTable.php 2 locations

@@ 490-500 (lines=11) @@
487
     *
488
     * @throws SchemaException
489
     */
490
    public function dropColumn(string $column): AbstractTable
491
    {
492
        if (!empty($schema = $this->currentState->findColumn($column))) {
493
            throw new SchemaException("Undefined column '{$column}' in '{$this->getName()}'");
494
        }
495
496
        //Dropping column from current schema
497
        $this->currentState->forgetColumn($schema);
498
499
        return $this;
500
    }
501
502
    /**
503
     * Drop index by it's forming columns.
@@ 534-546 (lines=13) @@
531
     *
532
     * @throws SchemaException
533
     */
534
    public function dropForeign($column): AbstractTable
535
    {
536
        if (!empty($schema = $this->currentState->findForeign($column))) {
537
            throw new SchemaException(
538
                "Undefined FK on '{$column}' in '{$this->getName()}'"
539
            );
540
        }
541
542
        //Dropping foreign from current schema
543
        $this->currentState->forgetForeign($schema);
544
545
        return $this;
546
    }
547
548
    /**
549
     * Reset table state to new form.