Implement php 7.4 type hints

This commit is contained in:
Dennis Eichhorn 2019-08-15 21:55:12 +02:00
parent 18647aa1ed
commit bf75752b24
5 changed files with 14 additions and 14 deletions

View File

@ -74,7 +74,7 @@ final class BackendController extends Controller
* @var string[]
* @since 1.0.0
*/
protected static $providing = [];
protected static array $providing = [];
/**
* Dependencies.
@ -82,7 +82,7 @@ final class BackendController extends Controller
* @var string[]
* @since 1.0.0
*/
protected static $dependencies = [];
protected static array $dependencies = [];
/**
* @param RequestAbstract $request Request

View File

@ -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 = [];
}

View File

@ -30,7 +30,7 @@ final class CollectionMapper extends MediaMapper
* @var array<string, array<string, null|string>>
* @since 1.0.0
*/
protected static $hasMany = [
protected static array $hasMany = [
'sources' => [
'mapper' => MediaMapper::class, /* mapper of the related object */
'table' => 'media_relation', /* table of the related object, null if no relation table is used (many->1) */
@ -45,7 +45,7 @@ final class CollectionMapper extends MediaMapper
* @var string
* @since 1.0.0
*/
protected static $table = 'media';
protected static string $table = 'media';
/**
* Created at.
@ -53,7 +53,7 @@ final class CollectionMapper extends MediaMapper
* @var string
* @since 1.0.0
*/
protected static $createdAt = 'media_created_at';
protected static string $createdAt = 'media_created_at';
/**
* Primary field name.
@ -61,5 +61,5 @@ final class CollectionMapper extends MediaMapper
* @var string
* @since 1.0.0
*/
protected static $primaryField = 'media_id';
protected static string $primaryField = 'media_id';
}

View File

@ -68,7 +68,7 @@ class Media implements \JsonSerializable
/**
* Uploaded.
*
* @var \DateTime
* @var null|\DateTime
* @since 1.0.0
*/
protected $createdAt = null;

View File

@ -35,7 +35,7 @@ class MediaMapper extends DataMapperAbstract
* @since 1.0.0
* @todo: maybe add file name for searching by file name (path in media_file should not matter for search)
*/
protected static $columns = [
protected static array $columns = [
'media_id' => ['name' => 'media_id', 'type' => 'int', 'internal' => 'id'],
'media_name' => ['name' => 'media_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true],
'media_description' => ['name' => 'media_description', 'type' => 'string', 'internal' => 'description', 'autocomplete' => true],
@ -56,7 +56,7 @@ class MediaMapper extends DataMapperAbstract
* @var array<string, array<string, string>>
* @since 1.0.0
*/
protected static $belongsTo = [
protected static array $belongsTo = [
'createdBy' => [
'mapper' => AccountMapper::class,
'dest' => 'media_created_by',
@ -69,7 +69,7 @@ class MediaMapper extends DataMapperAbstract
* @var string
* @since 1.0.0
*/
protected static $table = 'media';
protected static string $table = 'media';
/**
* Created at.
@ -77,7 +77,7 @@ class MediaMapper extends DataMapperAbstract
* @var string
* @since 1.0.0
*/
protected static $createdAt = 'media_created_at';
protected static string $createdAt = 'media_created_at';
/**
* Primary field name.
@ -85,7 +85,7 @@ class MediaMapper extends DataMapperAbstract
* @var string
* @since 1.0.0
*/
protected static $primaryField = 'media_id';
protected static string $primaryField = 'media_id';
/**
* Get media based on virtual path.