Implement php 7.4 type hints

This commit is contained in:
Dennis Eichhorn 2019-08-15 21:55:12 +02:00
parent 2b4c9a59e1
commit 9d12233d21
7 changed files with 22 additions and 22 deletions

View File

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

View File

@ -54,7 +54,7 @@ class Calendar
/** /**
* Created at. * Created at.
* *
* @var \DateTime * @var null|\DateTime
* @since 1.0.0 * @since 1.0.0
*/ */
private $createdAt = null; private $createdAt = null;
@ -62,7 +62,7 @@ class Calendar
/** /**
* Current date of the calendar. * Current date of the calendar.
* *
* @var \DateTime * @var null|\DateTime
* @since 1.0.0 * @since 1.0.0
*/ */
private $date = null; private $date = null;

View File

@ -41,7 +41,7 @@ final class CalendarMapper extends DataMapperAbstract
* @var array<string, array<string, bool|string>> * @var array<string, array<string, bool|string>>
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $columns = [ protected static array $columns = [
'calendar_id' => ['name' => 'calendar_id', 'type' => 'int', 'internal' => 'id'], 'calendar_id' => ['name' => 'calendar_id', 'type' => 'int', 'internal' => 'id'],
'calendar_name' => ['name' => 'calendar_name', 'type' => 'string', 'internal' => 'name'], 'calendar_name' => ['name' => 'calendar_name', 'type' => 'string', 'internal' => 'name'],
'calendar_description' => ['name' => 'calendar_description', 'type' => 'string', 'internal' => 'description'], 'calendar_description' => ['name' => 'calendar_description', 'type' => 'string', 'internal' => 'description'],
@ -54,7 +54,7 @@ final class CalendarMapper extends DataMapperAbstract
* @var array<string, array<string, null|string>> * @var array<string, array<string, null|string>>
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $hasMany = [ protected static array $hasMany = [
'events' => [ 'events' => [
'mapper' => EventMapper::class, 'mapper' => EventMapper::class,
'table' => 'calendar_event', 'table' => 'calendar_event',
@ -69,7 +69,7 @@ final class CalendarMapper extends DataMapperAbstract
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $table = 'calendar'; protected static string $table = 'calendar';
/** /**
* Created at. * Created at.
@ -77,7 +77,7 @@ final class CalendarMapper extends DataMapperAbstract
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $createdAt = 'calendar_created_at'; protected static string $createdAt = 'calendar_created_at';
/** /**
* Primary field name. * Primary field name.
@ -85,5 +85,5 @@ final class CalendarMapper extends DataMapperAbstract
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $primaryField = 'calendar_id'; protected static string $primaryField = 'calendar_id';
} }

View File

@ -56,7 +56,7 @@ class Event
/** /**
* Created. * Created.
* *
* @var \DateTime * @var null|\DateTime
* @since 1.0.0 * @since 1.0.0
*/ */
private $createdAt = null; private $createdAt = null;

View File

@ -33,7 +33,7 @@ final class EventMapper extends DataMapperAbstract
* @var array<string, array<string, bool|string>> * @var array<string, array<string, bool|string>>
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $columns = [ protected static array $columns = [
'calendar_event_id' => ['name' => 'calendar_event_id', 'type' => 'int', 'internal' => 'id'], 'calendar_event_id' => ['name' => 'calendar_event_id', 'type' => 'int', 'internal' => 'id'],
'calendar_event_name' => ['name' => 'calendar_event_name', 'type' => 'string', 'internal' => 'name'], 'calendar_event_name' => ['name' => 'calendar_event_name', 'type' => 'string', 'internal' => 'name'],
'calendar_event_description' => ['name' => 'calendar_event_description', 'type' => 'string', 'internal' => 'description'], 'calendar_event_description' => ['name' => 'calendar_event_description', 'type' => 'string', 'internal' => 'description'],
@ -52,7 +52,7 @@ final class EventMapper extends DataMapperAbstract
* @var array<string, array<string, string>> * @var array<string, array<string, string>>
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $ownsOne = [ protected static array $ownsOne = [
'schedule' => [ 'schedule' => [
'mapper' => ScheduleMapper::class, 'mapper' => ScheduleMapper::class,
'src' => 'calendar_event_schedule', 'src' => 'calendar_event_schedule',
@ -65,7 +65,7 @@ final class EventMapper extends DataMapperAbstract
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $table = 'calendar_event'; protected static string $table = 'calendar_event';
/** /**
* Created at. * Created at.
@ -73,7 +73,7 @@ final class EventMapper extends DataMapperAbstract
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $createdAt = 'calendar_event_created_at'; protected static string $createdAt = 'calendar_event_created_at';
/** /**
* Primary field name. * Primary field name.
@ -81,5 +81,5 @@ final class EventMapper extends DataMapperAbstract
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $primaryField = 'calendar_event_id'; protected static string $primaryField = 'calendar_event_id';
} }

View File

@ -93,7 +93,7 @@ class Schedule
/** /**
* Start. * Start.
* *
* @var \DateTime * @var null|\DateTime
* @since 1.0.0 * @since 1.0.0
*/ */
private $start = null; private $start = null;
@ -109,7 +109,7 @@ class Schedule
/** /**
* End. * End.
* *
* @var \DateTime * @var null|\DateTime
* @since 1.0.0 * @since 1.0.0
*/ */
private $end = null; private $end = null;
@ -117,7 +117,7 @@ class Schedule
/** /**
* Created at. * Created at.
* *
* @var \DateTime * @var null|\DateTime
* @since 1.0.0 * @since 1.0.0
*/ */
private $createdAt = null; private $createdAt = null;

View File

@ -33,7 +33,7 @@ final class ScheduleMapper extends DataMapperAbstract
* @var array<string, array<string, bool|string>> * @var array<string, array<string, bool|string>>
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $columns = [ protected static array $columns = [
'schedule_id' => ['name' => 'schedule_id', 'type' => 'int', 'internal' => 'id'], 'schedule_id' => ['name' => 'schedule_id', 'type' => 'int', 'internal' => 'id'],
'schedule_uid' => ['name' => 'schedule_uid', 'type' => 'string', 'internal' => 'uid'], 'schedule_uid' => ['name' => 'schedule_uid', 'type' => 'string', 'internal' => 'uid'],
'schedule_status' => ['name' => 'schedule_status', 'type' => 'int', 'internal' => 'status'], 'schedule_status' => ['name' => 'schedule_status', 'type' => 'int', 'internal' => 'status'],
@ -55,7 +55,7 @@ final class ScheduleMapper extends DataMapperAbstract
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $table = 'schedule'; protected static string $table = 'schedule';
/** /**
* Created at. * Created at.
@ -63,7 +63,7 @@ final class ScheduleMapper extends DataMapperAbstract
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $createdAt = 'schedule_created_at'; protected static string $createdAt = 'schedule_created_at';
/** /**
* Primary field name. * Primary field name.
@ -71,5 +71,5 @@ final class ScheduleMapper extends DataMapperAbstract
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $primaryField = 'schedule_id'; protected static string $primaryField = 'schedule_id';
} }