Code Duplication    Length = 11-12 lines in 2 locations

source/Spiral/Database/Drivers/Postgres/Schemas/PostgresColumn.php 1 location

@@ 177-187 (lines=11) @@
174
    /**
175
     * {@inheritdoc}
176
     */
177
    public function enum($values): AbstractColumn
178
    {
179
        $this->enumValues = array_map('strval', is_array($values) ? $values : func_get_args());
180
181
        $this->type = 'character';
182
        foreach ($this->enumValues as $value) {
183
            $this->size = max((int)$this->size, strlen($value));
184
        }
185
186
        return $this;
187
    }
188
189
    /**
190
     * {@inheritdoc}

source/Spiral/Database/Drivers/SQLServer/Schemas/SQLServerColumn.php 1 location

@@ 164-175 (lines=12) @@
161
    /**
162
     * {@inheritdoc}
163
     */
164
    public function enum($values): AbstractColumn
165
    {
166
        $this->enumValues = array_map('strval', is_array($values) ? $values : func_get_args());
167
        sort($this->enumValues);
168
169
        $this->type = 'varchar';
170
        foreach ($this->enumValues as $value) {
171
            $this->size = max((int)$this->size, strlen($value));
172
        }
173
174
        return $this;
175
    }
176
177
    /**
178
     * {@inheritdoc}