@@ -839,27 +839,37 @@ public function getColumnsFull(
839839 * @param bool $full whether to return full info or only column names
840840 * @psalm-param ConnectionType $connectionType
841841 *
842- * @return mixed[] flat array description
842+ * @return array{
843+ * Field: string,
844+ * Type: string,
845+ * Collation?: string|null,
846+ * Null:'YES'|'NO',
847+ * Key: string,
848+ * Default: string|null,
849+ * Extra: string,
850+ * Privileges?: string,
851+ * Comment?: string
852+ * }|null
843853 */
844854 public function getColumn (
845855 string $ database ,
846856 string $ table ,
847857 string $ column ,
848858 bool $ full = false ,
849859 int $ connectionType = Connection::TYPE_USER ,
850- ): array {
860+ ): array | null {
851861 $ sql = QueryGenerator::getColumnsSql (
852862 $ database ,
853863 $ table ,
854864 $ this ->escapeString ($ this ->escapeMysqlWildcards ($ column )),
855865 $ full ,
856866 );
857- /** @var array< string, array> $fields */
867+ /** @var ( string|null)[][] $fields */
858868 $ fields = $ this ->fetchResult ($ sql , 'Field ' , null , $ connectionType );
859869
860870 $ columns = $ this ->attachIndexInfoToColumns ($ database , $ table , $ fields );
861871
862- return array_shift ($ columns ) ?? [] ;
872+ return array_shift ($ columns );
863873 }
864874
865875 /**
@@ -870,7 +880,17 @@ public function getColumn(
870880 * @param bool $full whether to return full info or only column names
871881 * @psalm-param ConnectionType $connectionType
872882 *
873- * @return mixed[][] array indexed by column names
883+ * @return array{
884+ * Field: string,
885+ * Type: string,
886+ * Collation?: string|null,
887+ * Null:'YES'|'NO',
888+ * Key: string,
889+ * Default: string|null,
890+ * Extra: string,
891+ * Privileges?: string,
892+ * Comment?: string
893+ * }[] array indexed by column names
874894 */
875895 public function getColumns (
876896 string $ database ,
@@ -879,7 +899,7 @@ public function getColumns(
879899 int $ connectionType = Connection::TYPE_USER ,
880900 ): array {
881901 $ sql = QueryGenerator::getColumnsSql ($ database , $ table , null , $ full );
882- /** @var array [] $fields */
902+ /** @var (string|null)[] [] $fields */
883903 $ fields = $ this ->fetchResult ($ sql , 'Field ' , null , $ connectionType );
884904
885905 return $ this ->attachIndexInfoToColumns ($ database , $ table , $ fields );
@@ -888,11 +908,11 @@ public function getColumns(
888908 /**
889909 * Attach index information to the column definition
890910 *
891- * @param string $database name of database
892- * @param string $table name of table to retrieve columns from
893- * @param mixed [][] $fields column array indexed by their names
911+ * @param string $database name of database
912+ * @param string $table name of table to retrieve columns from
913+ * @param (string|null) [][] $fields column array indexed by their names
894914 *
895- * @return mixed [][] Column defintions with index information
915+ * @return (string|null) [][] Column defintions with index information
896916 */
897917 private function attachIndexInfoToColumns (
898918 string $ database ,
0 commit comments