From 300c0aa640c25eefe48bd1a00ab16e2a30e0efa9 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Mon, 14 Oct 2024 06:57:27 -0700 Subject: [PATCH] Remove handling unuique constraint column names as associative array --- src/Schema/Table.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Schema/Table.php b/src/Schema/Table.php index 2ee553e17a3..43215230afb 100644 --- a/src/Schema/Table.php +++ b/src/Schema/Table.php @@ -18,7 +18,6 @@ use function array_merge; use function array_values; use function in_array; -use function is_string; use function preg_match; use function sprintf; use function strtolower; @@ -757,13 +756,7 @@ private function _createUniqueConstraint( throw IndexNameInvalid::new($indexName); } - foreach ($columns as $index => $value) { - if (is_string($index)) { - $columnName = $index; - } else { - $columnName = $value; - } - + foreach ($columns as $columnName) { if (! $this->hasColumn($columnName)) { throw ColumnDoesNotExist::new($columnName, $this->_name); }