From b0d267facda16a3fcefdef5c2c2740c4cd790b63 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 17 Nov 2021 10:04:51 +0100 Subject: [PATCH] Add return types to the factory methods of the PHP DDL API --- .../column/DefaultFalseBooleanDatabaseTableColumn.class.php | 2 +- .../column/DefaultTrueBooleanDatabaseTableColumn.class.php | 2 +- .../table/column/NotNullInt10DatabaseTableColumn.class.php | 5 +---- .../column/NotNullVarchar191DatabaseTableColumn.class.php | 5 +---- .../column/NotNullVarchar255DatabaseTableColumn.class.php | 5 +---- .../table/column/ObjectIdDatabaseTableColumn.class.php | 5 +---- .../database/table/index/DatabaseTablePrimaryIndex.class.php | 2 +- 7 files changed, 7 insertions(+), 19 deletions(-) diff --git a/wcfsetup/install/files/lib/system/database/table/column/DefaultFalseBooleanDatabaseTableColumn.class.php b/wcfsetup/install/files/lib/system/database/table/column/DefaultFalseBooleanDatabaseTableColumn.class.php index 1aed91c838..0d50be9afe 100644 --- a/wcfsetup/install/files/lib/system/database/table/column/DefaultFalseBooleanDatabaseTableColumn.class.php +++ b/wcfsetup/install/files/lib/system/database/table/column/DefaultFalseBooleanDatabaseTableColumn.class.php @@ -14,7 +14,7 @@ namespace wcf\system\database\table\column; */ final class DefaultFalseBooleanDatabaseTableColumn { - public static function create($name) + public static function create($name): IDatabaseTableColumn { return TinyintDatabaseTableColumn::create($name) ->length(1) diff --git a/wcfsetup/install/files/lib/system/database/table/column/DefaultTrueBooleanDatabaseTableColumn.class.php b/wcfsetup/install/files/lib/system/database/table/column/DefaultTrueBooleanDatabaseTableColumn.class.php index fd26976817..ebd694f446 100644 --- a/wcfsetup/install/files/lib/system/database/table/column/DefaultTrueBooleanDatabaseTableColumn.class.php +++ b/wcfsetup/install/files/lib/system/database/table/column/DefaultTrueBooleanDatabaseTableColumn.class.php @@ -14,7 +14,7 @@ namespace wcf\system\database\table\column; */ final class DefaultTrueBooleanDatabaseTableColumn { - public static function create($name) + public static function create($name): IDatabaseTableColumn { return TinyintDatabaseTableColumn::create($name) ->length(1) diff --git a/wcfsetup/install/files/lib/system/database/table/column/NotNullInt10DatabaseTableColumn.class.php b/wcfsetup/install/files/lib/system/database/table/column/NotNullInt10DatabaseTableColumn.class.php index 0fe91517d5..86821290f3 100644 --- a/wcfsetup/install/files/lib/system/database/table/column/NotNullInt10DatabaseTableColumn.class.php +++ b/wcfsetup/install/files/lib/system/database/table/column/NotNullInt10DatabaseTableColumn.class.php @@ -13,10 +13,7 @@ namespace wcf\system\database\table\column; */ final class NotNullInt10DatabaseTableColumn { - /** - * @inheritDoc - */ - public static function create($name) + public static function create($name): IDatabaseTableColumn { return IntDatabaseTableColumn::create($name) ->notNull() diff --git a/wcfsetup/install/files/lib/system/database/table/column/NotNullVarchar191DatabaseTableColumn.class.php b/wcfsetup/install/files/lib/system/database/table/column/NotNullVarchar191DatabaseTableColumn.class.php index 0c9b0a7ee1..4916a3edab 100644 --- a/wcfsetup/install/files/lib/system/database/table/column/NotNullVarchar191DatabaseTableColumn.class.php +++ b/wcfsetup/install/files/lib/system/database/table/column/NotNullVarchar191DatabaseTableColumn.class.php @@ -13,10 +13,7 @@ namespace wcf\system\database\table\column; */ final class NotNullVarchar191DatabaseTableColumn { - /** - * @inheritDoc - */ - public static function create($name) + public static function create($name): IDatabaseTableColumn { return VarcharDatabaseTableColumn::create($name) ->notNull() diff --git a/wcfsetup/install/files/lib/system/database/table/column/NotNullVarchar255DatabaseTableColumn.class.php b/wcfsetup/install/files/lib/system/database/table/column/NotNullVarchar255DatabaseTableColumn.class.php index 874b89994a..9cf4494d8a 100644 --- a/wcfsetup/install/files/lib/system/database/table/column/NotNullVarchar255DatabaseTableColumn.class.php +++ b/wcfsetup/install/files/lib/system/database/table/column/NotNullVarchar255DatabaseTableColumn.class.php @@ -13,10 +13,7 @@ namespace wcf\system\database\table\column; */ final class NotNullVarchar255DatabaseTableColumn { - /** - * @inheritDoc - */ - public static function create($name) + public static function create($name): IDatabaseTableColumn { return VarcharDatabaseTableColumn::create($name) ->notNull() diff --git a/wcfsetup/install/files/lib/system/database/table/column/ObjectIdDatabaseTableColumn.class.php b/wcfsetup/install/files/lib/system/database/table/column/ObjectIdDatabaseTableColumn.class.php index 3f3eb8adb6..2c60a19f4f 100644 --- a/wcfsetup/install/files/lib/system/database/table/column/ObjectIdDatabaseTableColumn.class.php +++ b/wcfsetup/install/files/lib/system/database/table/column/ObjectIdDatabaseTableColumn.class.php @@ -16,10 +16,7 @@ namespace wcf\system\database\table\column; */ final class ObjectIdDatabaseTableColumn { - /** - * @inheritDoc - */ - public static function create($name) + public static function create($name): IDatabaseTableColumn { return NotNullInt10DatabaseTableColumn::create($name) ->autoIncrement(); diff --git a/wcfsetup/install/files/lib/system/database/table/index/DatabaseTablePrimaryIndex.class.php b/wcfsetup/install/files/lib/system/database/table/index/DatabaseTablePrimaryIndex.class.php index 981a8a9af2..adb9558acf 100644 --- a/wcfsetup/install/files/lib/system/database/table/index/DatabaseTablePrimaryIndex.class.php +++ b/wcfsetup/install/files/lib/system/database/table/index/DatabaseTablePrimaryIndex.class.php @@ -19,7 +19,7 @@ final class DatabaseTablePrimaryIndex /** * Returns a `DatabaseTableIndex` object with `PRIMARY` as name and primary as type. */ - public static function create() + public static function create(): DatabaseTableIndex { return DatabaseTableIndex::create('PRIMARY') ->type(DatabaseTableIndex::PRIMARY_TYPE); -- 2.20.1