Implement php 7.4 type hints

This commit is contained in:
Dennis Eichhorn 2019-08-15 21:55:12 +02:00
parent 55ed95c833
commit ed8567c1bd
8 changed files with 23 additions and 23 deletions

View File

@ -68,7 +68,7 @@ abstract class Controller extends ModuleAbstract implements WebInterface
* @var string[]
* @since 1.0.0
*/
protected static $providing = [];
protected static array $providing = [];
/**
* Dependencies.
@ -76,5 +76,5 @@ abstract class Controller extends ModuleAbstract implements WebInterface
* @var string[]
* @since 1.0.0
*/
protected static $dependencies = [];
protected static array $dependencies = [];
}

View File

@ -35,7 +35,7 @@ final class AccountMapper extends DataMapperAbstract
* @var array<string, array<string, bool|string|array>>
* @since 1.0.0
*/
protected static $columns = [
protected static array $columns = [
'account_id' => ['name' => 'account_id', 'type' => 'int', 'internal' => 'id', 'autocomplete' => true],
'account_status' => ['name' => 'account_status', 'type' => 'int', 'internal' => 'status'],
'account_type' => ['name' => 'account_type', 'type' => 'int', 'internal' => 'type'],
@ -61,7 +61,7 @@ final class AccountMapper extends DataMapperAbstract
* @var array<string, array<string, null|string>>
* @since 1.0.0
*/
protected static $hasMany = [
protected static array $hasMany = [
'groups' => [
'mapper' => GroupMapper::class,
'table' => 'account_group',
@ -76,7 +76,7 @@ final class AccountMapper extends DataMapperAbstract
* @var string
* @since 1.0.0
*/
protected static $table = 'account';
protected static string $table = 'account';
/**
* Primary field name.
@ -84,7 +84,7 @@ final class AccountMapper extends DataMapperAbstract
* @var string
* @since 1.0.0
*/
protected static $primaryField = 'account_id';
protected static string $primaryField = 'account_id';
/**
* Created at column
@ -92,7 +92,7 @@ final class AccountMapper extends DataMapperAbstract
* @var string
* @since 1.0.0
*/
protected static $createdAt = 'account_created_at';
protected static string $createdAt = 'account_created_at';
/**
* Get account with permissions

View File

@ -33,7 +33,7 @@ final class AccountPermissionMapper extends DataMapperAbstract
* @var array<string, array<string, bool|string>>
* @since 1.0.0
*/
protected static $columns = [
protected static array $columns = [
'account_permission_id' => ['name' => 'account_permission_id', 'type' => 'int', 'internal' => 'id'],
'account_permission_account' => ['name' => 'account_permission_account', 'type' => 'int', 'internal' => 'account'],
'account_permission_unit' => ['name' => 'account_permission_unit', 'type' => 'int', 'internal' => 'unit'],
@ -52,7 +52,7 @@ final class AccountPermissionMapper extends DataMapperAbstract
* @var string
* @since 1.0.0
*/
protected static $table = 'account_permission';
protected static string $table = 'account_permission';
/**
* Primary field name.
@ -60,5 +60,5 @@ final class AccountPermissionMapper extends DataMapperAbstract
* @var string
* @since 1.0.0
*/
protected static $primaryField = 'account_permission_id';
protected static string $primaryField = 'account_permission_id';
}

View File

@ -27,7 +27,7 @@ class Group extends \phpOMS\Account\Group
/**
* Created at.
*
* @var \DateTime
* @var null|\DateTime
* @since 1.0.0
*/
protected $createdAt = null;

View File

@ -33,7 +33,7 @@ final class GroupMapper extends DataMapperAbstract
* @var array<string, array<string, bool|string>>
* @since 1.0.0
*/
protected static $columns = [
protected static array $columns = [
'group_id' => ['name' => 'group_id', 'type' => 'int', 'internal' => 'id'],
'group_name' => ['name' => 'group_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true],
'group_status' => ['name' => 'group_status', 'type' => 'int', 'internal' => 'status'],
@ -48,7 +48,7 @@ final class GroupMapper extends DataMapperAbstract
* @var string
* @since 1.0.0
*/
protected static $table = 'group';
protected static string $table = 'group';
/**
* Primary field name.
@ -56,7 +56,7 @@ final class GroupMapper extends DataMapperAbstract
* @var string
* @since 1.0.0
*/
protected static $primaryField = 'group_id';
protected static string $primaryField = 'group_id';
/**
* Created at column
@ -64,7 +64,7 @@ final class GroupMapper extends DataMapperAbstract
* @var string
* @since 1.0.0
*/
protected static $createdAt = 'group_created';
protected static string $createdAt = 'group_created';
/**
* Has many relation.
@ -77,7 +77,7 @@ final class GroupMapper extends DataMapperAbstract
* @var array<string, array<string, null|string>>
* @since 1.0.0
*/
protected static $hasMany = [
protected static array $hasMany = [
'accounts' => [
'mapper' => AccountMapper::class,
'table' => 'account_group',

View File

@ -33,7 +33,7 @@ final class GroupPermissionMapper extends DataMapperAbstract
* @var array<string, array<string, bool|string>>
* @since 1.0.0
*/
protected static $columns = [
protected static array $columns = [
'group_permission_id' => ['name' => 'group_permission_id', 'type' => 'int', 'internal' => 'id'],
'group_permission_group' => ['name' => 'group_permission_group', 'type' => 'int', 'internal' => 'group'],
'group_permission_unit' => ['name' => 'group_permission_unit', 'type' => 'int', 'internal' => 'unit'],
@ -52,7 +52,7 @@ final class GroupPermissionMapper extends DataMapperAbstract
* @var string
* @since 1.0.0
*/
protected static $table = 'group_permission';
protected static string $table = 'group_permission';
/**
* Primary field name.
@ -60,5 +60,5 @@ final class GroupPermissionMapper extends DataMapperAbstract
* @var string
* @since 1.0.0
*/
protected static $primaryField = 'group_permission_id';
protected static string $primaryField = 'group_permission_id';
}

View File

@ -62,7 +62,7 @@ class Module
/**
* Created at.
*
* @var \DateTime
* @var null|\DateTime
* @since 1.0.0
*/
protected $createdAt = null;

View File

@ -33,7 +33,7 @@ final class ModuleMapper extends DataMapperAbstract
* @var array<string, array<string, bool|string>>
* @since 1.0.0
*/
protected static $columns = [
protected static array $columns = [
'module_id' => ['name' => 'module_id', 'type' => 'string', 'internal' => 'id'],
'module_active' => ['name' => 'module_active', 'type' => 'int', 'internal' => 'status'],
];
@ -44,7 +44,7 @@ final class ModuleMapper extends DataMapperAbstract
* @var string
* @since 1.0.0
*/
protected static $table = 'module';
protected static string $table = 'module';
/**
* Primary field name.
@ -52,5 +52,5 @@ final class ModuleMapper extends DataMapperAbstract
* @var string
* @since 1.0.0
*/
protected static $primaryField = 'module_id';
protected static string $primaryField = 'module_id';
}