From 5746dd3c6ed72365858392eebfc5b19f1cd046f8 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 15 Aug 2019 21:55:12 +0200 Subject: [PATCH] Implement php 7.4 type hints --- Controller/Controller.php | 4 ++-- Models/AddressMapper.php | 6 +++--- Models/ContactElementMapper.php | 6 +++--- Models/Profile.php | 2 +- Models/ProfileMapper.php | 10 +++++----- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Controller/Controller.php b/Controller/Controller.php index ac4b939..f7139fe 100644 --- a/Controller/Controller.php +++ b/Controller/Controller.php @@ -66,7 +66,7 @@ class Controller extends ModuleAbstract implements WebInterface * @var string[] * @since 1.0.0 */ - protected static $providing = []; + protected static array $providing = []; /** * Dependencies. @@ -74,5 +74,5 @@ class Controller extends ModuleAbstract implements WebInterface * @var string[] * @since 1.0.0 */ - protected static $dependencies = []; + protected static array $dependencies = []; } diff --git a/Models/AddressMapper.php b/Models/AddressMapper.php index 8a7ad27..97461ad 100644 --- a/Models/AddressMapper.php +++ b/Models/AddressMapper.php @@ -32,7 +32,7 @@ final class AddressMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $columns = [ + protected static array $columns = [ 'profile_address_id' => ['name' => 'profile_address_id', 'type' => 'int', 'internal' => 'id'], 'profile_address_type' => ['name' => 'profile_address_type', 'type' => 'int', 'internal' => 'type'], 'profile_address_address' => ['name' => 'profile_address_address', 'type' => 'string', 'internal' => 'address'], @@ -48,7 +48,7 @@ final class AddressMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $table = 'profile_address'; + protected static string $table = 'profile_address'; /** * Primary field name. @@ -56,5 +56,5 @@ final class AddressMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $primaryField = 'profile_address_id'; + protected static string $primaryField = 'profile_address_id'; } diff --git a/Models/ContactElementMapper.php b/Models/ContactElementMapper.php index be896ce..dbec9d4 100644 --- a/Models/ContactElementMapper.php +++ b/Models/ContactElementMapper.php @@ -24,7 +24,7 @@ final class ContactElementMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $columns = [ + protected static array $columns = [ 'profile_contact_id' => ['name' => 'profile_contact_id', 'type' => 'int', 'internal' => 'id'], ]; @@ -34,7 +34,7 @@ final class ContactElementMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $table = 'profile_contact'; + protected static string $table = 'profile_contact'; /** * Primary field name. @@ -42,5 +42,5 @@ final class ContactElementMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $primaryField = 'profile_contact_id'; + protected static string $primaryField = 'profile_contact_id'; } diff --git a/Models/Profile.php b/Models/Profile.php index 548f45f..8169e44 100644 --- a/Models/Profile.php +++ b/Models/Profile.php @@ -50,7 +50,7 @@ class Profile implements \JsonSerializable /** * Birthday. * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ private $birthday = null; diff --git a/Models/ProfileMapper.php b/Models/ProfileMapper.php index f164683..2c6d0c1 100644 --- a/Models/ProfileMapper.php +++ b/Models/ProfileMapper.php @@ -34,7 +34,7 @@ final class ProfileMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $columns = [ + protected static array $columns = [ 'profile_account_id' => ['name' => 'profile_account_id', 'type' => 'int', 'internal' => 'id'], 'profile_account_image' => ['name' => 'profile_account_image', 'type' => 'int', 'internal' => 'image', 'annotations' => ['gdpr' => true]], 'profile_account_birthday' => ['name' => 'profile_account_birthday', 'type' => 'DateTime', 'internal' => 'birthday', 'annotations' => ['gdpr' => true]], @@ -47,7 +47,7 @@ final class ProfileMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $ownsOne = [ + protected static array $ownsOne = [ 'account' => [ 'mapper' => AccountMapper::class, 'src' => 'profile_account_account', @@ -64,7 +64,7 @@ final class ProfileMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $hasMany = [ + protected static array $hasMany = [ 'location' => [ 'mapper' => AddressMapper::class, 'table' => 'profile_address', @@ -79,7 +79,7 @@ final class ProfileMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $table = 'profile_account'; + protected static string $table = 'profile_account'; /** * Primary field name. @@ -87,5 +87,5 @@ final class ProfileMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $primaryField = 'profile_account_id'; + protected static string $primaryField = 'profile_account_id'; }