From ea8a4bf20349f539469a6e7caeea55b117927923 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 24 Feb 2023 09:06:58 -0800 Subject: [PATCH 1/2] [ticket/17105] Fix order of arguments for schema changes on indexes PHPBB3-17105 --- phpBB/phpbb/db/tools/doctrine.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/phpBB/phpbb/db/tools/doctrine.php b/phpBB/phpbb/db/tools/doctrine.php index e956bcff4b..093f78b367 100644 --- a/phpBB/phpbb/db/tools/doctrine.php +++ b/phpBB/phpbb/db/tools/doctrine.php @@ -267,7 +267,7 @@ class doctrine implements tools_interface { foreach ($column_indexes as $index) { - $this->schema_create_index($index->getColumns(), $schema, $table_name, $index->getName()); + $this->schema_create_index($schema, $table_name, $index->getName(), $index->getColumns()); } } } @@ -319,7 +319,7 @@ class doctrine implements tools_interface return $this->alter_schema( function (Schema $schema) use ($table_name, $index_name, $column): void { - $this->schema_create_index($column, $schema, $table_name, $index_name); + $this->schema_create_index($schema, $table_name, $index_name, $column); } ); } @@ -345,7 +345,7 @@ class doctrine implements tools_interface return $this->alter_schema( function (Schema $schema) use ($table_name, $index_name, $column): void { - $this->schema_create_unique_index($column, $schema, $table_name, $index_name); + $this->schema_create_unique_index($schema, $table_name, $index_name, $column); } ); } @@ -797,15 +797,15 @@ class doctrine implements tools_interface } /** - * @param $column * @param Schema $schema * @param string $table_name * @param string $index_name + * @param $column * @param bool $safe_check * * @throws SchemaException */ - protected function schema_create_index($column, Schema $schema, string $table_name, string $index_name, bool $safe_check = false): void + protected function schema_create_index(Schema $schema, string $table_name, string $index_name, $column, bool $safe_check = false): void { $columns = (is_array($column)) ? $column : [$column]; $table = $schema->getTable($table_name); @@ -819,15 +819,15 @@ class doctrine implements tools_interface } /** - * @param $column * @param Schema $schema * @param string $table_name * @param string $index_name + * @param $column * @param bool $safe_check * * @throws SchemaException */ - protected function schema_create_unique_index($column, Schema $schema, string $table_name, string $index_name, bool $safe_check = false): void + protected function schema_create_unique_index(Schema $schema, string $table_name, string $index_name, $column, bool $safe_check = false): void { $columns = (is_array($column)) ? $column : [$column]; $table = $schema->getTable($table_name); From 4daf350d218052ea350622ada46e9e851179fc53 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 28 Feb 2023 20:41:08 +0100 Subject: [PATCH 2/2] [ticket/17105] Add type specifier to docblock for column PHPBB3-17105 --- phpBB/phpbb/db/tools/doctrine.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/phpbb/db/tools/doctrine.php b/phpBB/phpbb/db/tools/doctrine.php index 093f78b367..1196ac08be 100644 --- a/phpBB/phpbb/db/tools/doctrine.php +++ b/phpBB/phpbb/db/tools/doctrine.php @@ -800,7 +800,7 @@ class doctrine implements tools_interface * @param Schema $schema * @param string $table_name * @param string $index_name - * @param $column + * @param string|array $column * @param bool $safe_check * * @throws SchemaException @@ -822,7 +822,7 @@ class doctrine implements tools_interface * @param Schema $schema * @param string $table_name * @param string $index_name - * @param $column + * @param string|array $column * @param bool $safe_check * * @throws SchemaException