@@ -50,7 +50,7 @@ class Forge
5050 /**
5151 * List of unique keys.
5252 *
53- * @var array
53+ * @var list<int>
5454 */
5555 protected $ uniqueKeys = [];
5656
@@ -64,7 +64,7 @@ class Forge
6464 /**
6565 * List of foreign keys.
6666 *
67- * @var array
67+ * @var list< array{field: list<string>, referenceTable: string, referenceField: list<string>, onDelete: string, onUpdate: string, fkName: string}>
6868 */
6969 protected $ foreignKeys = [];
7070
@@ -146,7 +146,7 @@ class Forge
146146 /**
147147 * UNSIGNED support
148148 *
149- * @var array|bool
149+ * @var array<array-key, string> |bool
150150 */
151151 protected $ unsigned = true ;
152152
@@ -183,7 +183,7 @@ class Forge
183183 /**
184184 * Foreign Key Allowed Actions
185185 *
186- * @var array
186+ * @var list<string>
187187 */
188188 protected $ fkAllowActions = ['CASCADE ' , 'SET NULL ' , 'NO ACTION ' , 'RESTRICT ' , 'SET DEFAULT ' ];
189189
@@ -324,7 +324,7 @@ public function dropDatabase(string $dbName): bool
324324 /**
325325 * Add Key
326326 *
327- * @param array |string $key
327+ * @param list<string> |string $key
328328 *
329329 * @return Forge
330330 */
@@ -346,7 +346,7 @@ public function addKey($key, bool $primary = false, bool $unique = false, string
346346 /**
347347 * Add Primary Key
348348 *
349- * @param array |string $key
349+ * @param list<string> |string $key
350350 *
351351 * @return Forge
352352 */
@@ -358,7 +358,7 @@ public function addPrimaryKey($key, string $keyName = '')
358358 /**
359359 * Add Unique Key
360360 *
361- * @param array |string $key
361+ * @param list<string> |string $key
362362 *
363363 * @return Forge
364364 */
@@ -370,7 +370,7 @@ public function addUniqueKey($key, string $keyName = '')
370370 /**
371371 * Add Field
372372 *
373- * @param array<string , array|string>|string $fields Field array or Field string
373+ * @param array<array-key , array<string, mixed> |string>|string $fields Field array or Field string
374374 *
375375 * @return Forge
376376 */
@@ -544,7 +544,7 @@ public function dropForeignKey(string $table, string $foreignName)
544544 }
545545
546546 /**
547- * @param array $attributes Table attributes
547+ * @param array<string, mixed> $attributes Table attributes
548548 *
549549 * @return bool
550550 *
@@ -590,7 +590,7 @@ public function createTable(string $table, bool $ifNotExists = false, array $att
590590 }
591591
592592 /**
593- * @param array $attributes Table attributes
593+ * @param array<string, mixed> $attributes Table attributes
594594 *
595595 * @return string SQL string
596596 *
@@ -626,6 +626,9 @@ protected function _createTable(string $table, bool $ifNotExists, array $attribu
626626 );
627627 }
628628
629+ /**
630+ * @param array<string, mixed> $attributes
631+ */
629632 protected function _createTableAttributes (array $ attributes ): string
630633 {
631634 $ sql = '' ;
@@ -746,7 +749,7 @@ public function renameTable(string $tableName, string $newTableName)
746749 }
747750
748751 /**
749- * @param array<string , array|string>|string $fields Field array or Field string
752+ * @param array<array-key , array<string, mixed> |string>|string $fields Field array or Field string
750753 *
751754 * @throws DatabaseException
752755 */
@@ -804,7 +807,7 @@ public function dropColumn(string $table, $columnNames)
804807 }
805808
806809 /**
807- * @param array<string , array|string>|string $fields Field array or Field string
810+ * @param array<array-key , array<string, mixed> |string>|string $fields Field array or Field string
808811 *
809812 * @throws DatabaseException
810813 */
@@ -846,9 +849,9 @@ public function modifyColumn(string $table, $fields): bool
846849 }
847850
848851 /**
849- * @param 'ADD'|'CHANGE'|'DROP' $alterType
850- * @param array| string $processedFields Processed column definitions
851- * or column names to DROP
852+ * @param 'ADD'|'CHANGE'|'DROP' $alterType
853+ * @param list< array< string, mixed>>|list<string>|string $processedFields Processed column definitions
854+ * or column names to DROP
852855 *
853856 * @return ($alterType is 'DROP' ? string : false|list<string>|null)
854857 */
@@ -884,6 +887,8 @@ protected function _alterTable(string $alterType, string $table, $processedField
884887
885888 /**
886889 * Returns $processedFields array from $this->fields data.
890+ *
891+ * @return list<array<string, mixed>>
887892 */
888893 protected function _processFields (bool $ createTable = false ): array
889894 {
@@ -973,6 +978,8 @@ protected function _processFields(bool $createTable = false): array
973978
974979 /**
975980 * Converts $processedField array to field definition string.
981+ *
982+ * @param array<string, mixed> $processedField
976983 */
977984 protected function _processColumn (array $ processedField ): string
978985 {
@@ -988,6 +995,8 @@ protected function _processColumn(array $processedField): string
988995 /**
989996 * Performs a data type mapping between different databases.
990997 *
998+ * @param array<string, mixed> $attributes
999+ *
9911000 * @return void
9921001 */
9931002 protected function _attributeType (array &$ attributes )
@@ -1005,6 +1014,9 @@ protected function _attributeType(array &$attributes)
10051014 * - array(TYPE => UTYPE) will change $field['type'],
10061015 * from TYPE to UTYPE in case of a match
10071016 *
1017+ * @param array<string, mixed> $attributes
1018+ * @param array<string, mixed> $field
1019+ *
10081020 * @return void
10091021 */
10101022 protected function _attributeUnsigned (array &$ attributes , array &$ field )
@@ -1038,6 +1050,9 @@ protected function _attributeUnsigned(array &$attributes, array &$field)
10381050 }
10391051
10401052 /**
1053+ * @param array<string, mixed> $attributes
1054+ * @param array<string, mixed> $field
1055+ *
10411056 * @return void
10421057 */
10431058 protected function _attributeDefault (array &$ attributes , array &$ field )
@@ -1062,6 +1077,9 @@ protected function _attributeDefault(array &$attributes, array &$field)
10621077 }
10631078
10641079 /**
1080+ * @param array<string, mixed> $attributes
1081+ * @param array<string, mixed> $field
1082+ *
10651083 * @return void
10661084 */
10671085 protected function _attributeUnique (array &$ attributes , array &$ field )
@@ -1072,6 +1090,9 @@ protected function _attributeUnique(array &$attributes, array &$field)
10721090 }
10731091
10741092 /**
1093+ * @param array<string, mixed> $attributes
1094+ * @param array<string, mixed> $field
1095+ *
10751096 * @return void
10761097 */
10771098 protected function _attributeAutoIncrement (array &$ attributes , array &$ field )
@@ -1164,6 +1185,8 @@ public function processIndexes(string $table): bool
11641185 * Generates SQL to add indexes
11651186 *
11661187 * @param bool $asQuery When true returns stand alone SQL, else partial SQL used with CREATE TABLE
1188+ *
1189+ * @return list<string>
11671190 */
11681191 protected function _processIndexes (string $ table , bool $ asQuery = false ): array
11691192 {
@@ -1210,6 +1233,8 @@ protected function _processIndexes(string $table, bool $asQuery = false): array
12101233 * Generates SQL to add foreign keys
12111234 *
12121235 * @param bool $asQuery When true returns stand alone SQL, else partial SQL used with CREATE TABLE
1236+ *
1237+ * @return list<string>
12131238 */
12141239 protected function _processForeignKeys (string $ table , bool $ asQuery = false ): array
12151240 {
0 commit comments