From b797991fa6a5b5336f93d97ebc3fac8ba0b2de68 Mon Sep 17 00:00:00 2001 From: Josh Marshall Date: Fri, 28 Nov 2025 14:52:29 +1000 Subject: [PATCH 1/2] Add phpdoc to for options array --- src/Phinx/Db/Table.php | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/Phinx/Db/Table.php b/src/Phinx/Db/Table.php index 6647d8d32..81429f44e 100644 --- a/src/Phinx/Db/Table.php +++ b/src/Phinx/Db/Table.php @@ -295,7 +295,21 @@ public function reset(): void * * @param string|\Phinx\Db\Table\Column $columnName Column Name * @param string|\Phinx\Util\Literal|null $type Column Type - * @param array $options Column Options + * @param array{ + * limit: int, + * length: int, + * default: mixed, + * null: bool, + * after: string, + * comment: string, + * precision: int, + * scale: int, + * signed: bool, + * values: mixed, + * identity: bool, + * update: string, + * timezone: bool, + * } $options Column Options * @throws \InvalidArgumentException * @return $this */ @@ -358,7 +372,21 @@ public function renameColumn(string $oldName, string $newName) * * @param string $columnName Column Name * @param string|\Phinx\Db\Table\Column|\Phinx\Util\Literal $newColumnType New Column Type - * @param array $options Options + * @param array{ + * limit: int, + * length: int, + * default: mixed, + * null: bool, + * after: string, + * comment: string, + * precision: int, + * scale: int, + * signed: bool, + * values: mixed, + * identity: bool, + * update: string, + * timezone: bool, + * } $options Options * @return $this */ public function changeColumn(string $columnName, string|Column|Literal $newColumnType, array $options = []) From f3592967a048f458a9291bccb88615331e10a288 Mon Sep 17 00:00:00 2001 From: Josh Marshall Date: Fri, 28 Nov 2025 15:06:24 +1000 Subject: [PATCH 2/2] Update column options to use optional properties --- src/Phinx/Db/Table.php | 52 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Phinx/Db/Table.php b/src/Phinx/Db/Table.php index 81429f44e..5ece80309 100644 --- a/src/Phinx/Db/Table.php +++ b/src/Phinx/Db/Table.php @@ -296,19 +296,19 @@ public function reset(): void * @param string|\Phinx\Db\Table\Column $columnName Column Name * @param string|\Phinx\Util\Literal|null $type Column Type * @param array{ - * limit: int, - * length: int, - * default: mixed, - * null: bool, - * after: string, - * comment: string, - * precision: int, - * scale: int, - * signed: bool, - * values: mixed, - * identity: bool, - * update: string, - * timezone: bool, + * limit?: int, + * length?: int, + * default?: mixed, + * null?: bool, + * after?: string, + * comment?: string, + * precision?: int, + * scale?: int, + * signed?: bool, + * values?: mixed, + * identity?: bool, + * update?: string, + * timezone?: bool, * } $options Column Options * @throws \InvalidArgumentException * @return $this @@ -373,19 +373,19 @@ public function renameColumn(string $oldName, string $newName) * @param string $columnName Column Name * @param string|\Phinx\Db\Table\Column|\Phinx\Util\Literal $newColumnType New Column Type * @param array{ - * limit: int, - * length: int, - * default: mixed, - * null: bool, - * after: string, - * comment: string, - * precision: int, - * scale: int, - * signed: bool, - * values: mixed, - * identity: bool, - * update: string, - * timezone: bool, + * limit?: int, + * length?: int, + * default?: mixed, + * null?: bool, + * after?: string, + * comment?: string, + * precision?: int, + * scale?: int, + * signed?: bool, + * values?: mixed, + * identity?: bool, + * update?: string, + * timezone?: bool, * } $options Options * @return $this */