Code Duplication    Length = 11-12 lines in 2 locations

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

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

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

@@ 154-165 (lines=12) @@
151
    /**
152
     * {@inheritdoc}
153
     */
154
    public function enum($values): AbstractColumn
155
    {
156
        $this->enumValues = array_map('strval', is_array($values) ? $values : func_get_args());
157
        sort($this->enumValues);
158
159
        $this->type = 'varchar';
160
        foreach ($this->enumValues as $value) {
161
            $this->size = max((int)$this->size, strlen($value));
162
        }
163
164
        return $this;
165
    }
166
167
    /**
168
     * {@inheritdoc}