From b4084913def601f8773dc564f1bc170460e6b306 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 15 Aug 2019 21:54:59 +0200 Subject: [PATCH] Implement php 7.4 type hints --- Account/Account.php | 4 +- Asset/AssetManager.php | 2 +- Business/Marketing/NetPromoterScore.php | 2 +- Config/OptionsTrait.php | 2 +- Config/SettingsAbstract.php | 18 ++++---- DataStorage/Cache/CachePool.php | 2 +- .../Cache/Connection/ConnectionAbstract.php | 10 ++--- DataStorage/Cache/Connection/FileCache.php | 2 +- DataStorage/Cache/Connection/MemCached.php | 4 +- DataStorage/Cache/Connection/RedisCache.php | 2 +- DataStorage/Cookie/CookieJar.php | 4 +- DataStorage/Database/BuilderAbstract.php | 14 +++---- .../Connection/ConnectionAbstract.php | 20 ++++----- DataStorage/Database/DataMapperAbstract.php | 32 +++++++------- DataStorage/Database/DatabasePool.php | 2 +- DataStorage/Database/GrammarAbstract.php | 14 +++---- DataStorage/Database/Query/Builder.php | 42 +++++++++---------- DataStorage/Database/Query/Column.php | 2 +- .../Database/Query/Grammar/Grammar.php | 10 ++--- .../Database/Query/Grammar/MysqlGrammar.php | 2 +- .../Database/Query/Grammar/SQLiteGrammar.php | 2 +- DataStorage/Database/Schema/Builder.php | 14 +++---- .../Database/Schema/Grammar/Grammar.php | 10 ++--- .../Database/Schema/Grammar/MysqlGrammar.php | 2 +- .../Database/Schema/Grammar/SQLiteGrammar.php | 2 +- DataStorage/Database/SchemaMapper.php | 4 +- DataStorage/Session/HttpSession.php | 6 +-- Dispatcher/Dispatcher.php | 4 +- Event/EventManager.php | 6 +-- Localization/Defaults/CityMapper.php | 6 +-- Localization/Defaults/CountryMapper.php | 6 +-- Localization/Defaults/CurrencyMapper.php | 6 +-- Localization/Defaults/IbanMapper.php | 6 +-- Localization/Defaults/LanguageMapper.php | 6 +-- Localization/L11nManager.php | 4 +- Localization/Localization.php | 28 ++++++------- Localization/Money.php | 10 ++--- Log/FileLogger.php | 12 +++--- Math/Geometry/Shape/D2/Polygon.php | 2 +- Math/Geometry/Shape/D3/Sphere.php | 2 +- Math/Matrix/CholeskyDecomposition.php | 6 +-- Math/Matrix/EigenvalueDecomposition.php | 20 ++++----- Math/Matrix/LUDecomposition.php | 10 ++--- Math/Matrix/Matrix.php | 8 ++-- Math/Matrix/QRDecomposition.php | 8 ++-- Math/Matrix/SingularValueDecomposition.php | 10 ++--- Message/Console/Header.php | 2 +- Message/Console/Request.php | 4 +- Message/Console/Response.php | 2 +- Message/HeaderAbstract.php | 10 ++--- Message/Http/Header.php | 2 +- Message/Http/Request.php | 12 +++--- Message/Http/Response.php | 2 +- Message/Mail/Mail.php | 2 +- Message/RequestAbstract.php | 24 +++++------ Message/ResponseAbstract.php | 6 +-- Model/Html/Head.php | 16 +++---- Model/Html/Meta.php | 14 +++---- Model/Message/Dom.php | 8 ++-- Model/Message/FormValidation.php | 2 +- Model/Message/Notify.php | 10 ++--- Model/Message/Redirect.php | 6 +-- Model/Message/Reload.php | 2 +- Module/InfoManager.php | 4 +- Module/ModuleAbstract.php | 16 ++++--- Module/ModuleManager.php | 20 ++++----- Module/PackageManager.php | 10 ++--- Router/Router.php | 2 +- Security/PhpCode.php | 4 +- Stdlib/Base/Address.php | 6 +-- Stdlib/Base/EnumArray.php | 2 +- Stdlib/Base/Iban.php | 2 +- Stdlib/Base/Location.php | 16 +++---- Stdlib/Map/MultiMap.php | 8 ++-- Stdlib/Queue/PriorityQueue.php | 4 +- System/File/Ftp/Directory.php | 2 +- System/File/Ftp/File.php | 4 +- System/File/Ftp/FileAbstract.php | 20 ++++----- System/File/Ftp/FtpStorage.php | 2 +- System/File/Local/Directory.php | 4 +- System/File/Local/FileAbstract.php | 20 ++++----- System/File/Local/LocalStorage.php | 2 +- System/File/Storage.php | 2 +- System/File/StorageAbstract.php | 2 +- Uri/Argument.php | 28 ++++++------- Uri/Http.php | 28 ++++++------- Uri/UriFactory.php | 2 +- Utils/Barcode/C128Abstract.php | 22 +++++----- Utils/Barcode/C128a.php | 6 +-- Utils/Barcode/C128b.php | 6 +-- Utils/Barcode/C128c.php | 6 +-- Utils/Barcode/C25.php | 8 ++-- Utils/Barcode/C39.php | 6 +-- Utils/Barcode/Codebar.php | 8 ++-- Utils/Converter/Currency.php | 2 +- Utils/Encoding/Huffman/Dictionary.php | 6 +-- Utils/Encoding/Huffman/Huffman.php | 4 +- Utils/Git/Author.php | 10 ++--- Utils/Git/Branch.php | 2 +- Utils/Git/Commit.php | 26 ++++++------ Utils/Git/Git.php | 2 +- Utils/Git/Repository.php | 10 ++--- Utils/Git/Tag.php | 4 +- Utils/JsonBuilder.php | 2 +- Utils/StringCompare.php | 2 +- Utils/TaskSchedule/Interval.php | 4 +- Utils/TaskSchedule/SchedulerAbstract.php | 2 +- Utils/TaskSchedule/TaskAbstract.php | 21 ++++------ Validation/ValidatorAbstract.php | 4 +- Views/PaginationView.php | 8 ++-- Views/View.php | 16 +++---- Views/ViewAbstract.php | 4 +- .../Database/TestModel/BaseModelMapper.php | 14 +++---- .../TestModel/BelongsToModelMapper.php | 6 +-- .../TestModel/ManyToManyDirectModelMapper.php | 6 +-- .../TestModel/ManyToManyRelModelMapper.php | 6 +-- .../Database/TestModel/OwnsOneModelMapper.php | 6 +-- tests/Module/ModuleAbstractTest.php | 2 +- 118 files changed, 479 insertions(+), 476 deletions(-) diff --git a/Account/Account.php b/Account/Account.php index 7950ecfa8..09d0a7f4d 100644 --- a/Account/Account.php +++ b/Account/Account.php @@ -94,7 +94,7 @@ class Account implements ArrayableInterface, \JsonSerializable /** * Last activity. * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ protected ?\DateTime $lastActive = null; @@ -102,7 +102,7 @@ class Account implements ArrayableInterface, \JsonSerializable /** * Last activity. * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ protected ?\DateTime $createdAt = null; diff --git a/Asset/AssetManager.php b/Asset/AssetManager.php index 4511fc2a2..ad4473a51 100644 --- a/Asset/AssetManager.php +++ b/Asset/AssetManager.php @@ -31,7 +31,7 @@ final class AssetManager implements \Countable * @var array * @since 1.0.0 */ - private $assets = []; + private array $assets = []; /** * Add asset. diff --git a/Business/Marketing/NetPromoterScore.php b/Business/Marketing/NetPromoterScore.php index 615e29466..90821949d 100644 --- a/Business/Marketing/NetPromoterScore.php +++ b/Business/Marketing/NetPromoterScore.php @@ -33,7 +33,7 @@ final class NetPromoterScore * @var int[] * @since 1.0.0 */ - private $scores = []; + private array $scores = []; /** * Add score. diff --git a/Config/OptionsTrait.php b/Config/OptionsTrait.php index a5c5ddfc5..1228d9263 100644 --- a/Config/OptionsTrait.php +++ b/Config/OptionsTrait.php @@ -33,7 +33,7 @@ trait OptionsTrait * @var array * @since 1.0.0 */ - private $options = []; + private array $options = []; /** * {@inheritdoc} diff --git a/Config/SettingsAbstract.php b/Config/SettingsAbstract.php index 8ecfd90d2..6c13329bd 100644 --- a/Config/SettingsAbstract.php +++ b/Config/SettingsAbstract.php @@ -16,6 +16,8 @@ namespace phpOMS\Config; use phpOMS\DataStorage\Database\DatabaseExceptionFactory; use phpOMS\DataStorage\Database\Query\Builder; +use phpOMS\DataStorage\Cache\CachePool; +use phpOMS\DataStorage\Database\Connection\ConnectionAbstract; /** * Settings class. @@ -34,26 +36,26 @@ abstract class SettingsAbstract implements OptionsInterface /** * Cache manager (pool). * - * @var \phpOMS\DataStorage\Cache\CachePool + * @var null|CachePool * @since 1.0.0 */ - protected $cache = null; + protected ?CachePool $cache = null; /** * Database connection instance. * - * @var \phpOMS\DataStorage\Database\Connection\ConnectionAbstract + * @var null|ConnectionAbstract * @since 1.0.0 */ - protected $connection = null; + protected ?ConnectionAbstract $connection = null; /** * Settings table. * - * @var string + * @var null|string * @since 1.0.0 */ - protected static $table = null; + protected static ?string $table = null; /** * Columns to identify the value. @@ -61,7 +63,7 @@ abstract class SettingsAbstract implements OptionsInterface * @var string[] * @since 1.0.0 */ - protected static $columns = [ + protected static array $columns = [ 'id', ]; @@ -71,7 +73,7 @@ abstract class SettingsAbstract implements OptionsInterface * @var string * @since 1.0.0 */ - protected $valueField = 'option'; + protected string $valueField = 'option'; /** * Get option by key. diff --git a/DataStorage/Cache/CachePool.php b/DataStorage/Cache/CachePool.php index 98a1f89c1..edcd6c5a3 100644 --- a/DataStorage/Cache/CachePool.php +++ b/DataStorage/Cache/CachePool.php @@ -37,7 +37,7 @@ final class CachePool implements DataStoragePoolInterface * @var DataStorageConnectionInterface[] * @since 1.0.0 */ - private $pool = null; + private ?array $pool = null; /** * Add database. diff --git a/DataStorage/Cache/Connection/ConnectionAbstract.php b/DataStorage/Cache/Connection/ConnectionAbstract.php index 49819ddeb..d8c2f507e 100644 --- a/DataStorage/Cache/Connection/ConnectionAbstract.php +++ b/DataStorage/Cache/Connection/ConnectionAbstract.php @@ -49,15 +49,15 @@ abstract class ConnectionAbstract implements ConnectionInterface * @var string * @since 1.0.0 */ - public $prefix = ''; + public string string $prefix = ''; /** * Database data. * - * @var string[] + * @var null|string[] * @since 1.0.0 */ - protected $dbdata = null; + protected ?array $dbdata = null; /** * Database type. @@ -65,7 +65,7 @@ abstract class ConnectionAbstract implements ConnectionInterface * @var string * @since 1.0.0 */ - protected $type = CacheType::UNDEFINED; + protected string $type = CacheType::UNDEFINED; /** * Database status. @@ -73,7 +73,7 @@ abstract class ConnectionAbstract implements ConnectionInterface * @var int * @since 1.0.0 */ - protected $status = CacheStatus::CLOSED; + protected int $status = CacheStatus::CLOSED; /** * {@inheritdoc} diff --git a/DataStorage/Cache/Connection/FileCache.php b/DataStorage/Cache/Connection/FileCache.php index 1c29b11e0..1cffdd718 100644 --- a/DataStorage/Cache/Connection/FileCache.php +++ b/DataStorage/Cache/Connection/FileCache.php @@ -69,7 +69,7 @@ class FileCache extends ConnectionAbstract * @var int * @since 1.0.0 */ - private $threshold = 50; + private int $threshold = 50; /** * Constructor diff --git a/DataStorage/Cache/Connection/MemCached.php b/DataStorage/Cache/Connection/MemCached.php index a0d06074c..b0b902c33 100644 --- a/DataStorage/Cache/Connection/MemCached.php +++ b/DataStorage/Cache/Connection/MemCached.php @@ -31,7 +31,7 @@ class MemCached extends ConnectionAbstract /** * {@inheritdoc} */ - protected $type = CacheType::MEMCACHED; + protected string $type = CacheType::MEMCACHED; /** * Only cache if data is larger than threshold (0-100). @@ -39,7 +39,7 @@ class MemCached extends ConnectionAbstract * @var int * @since 1.0.0 */ - private $threshold = 0; + private int $threshold = 0; /** * Constructor. diff --git a/DataStorage/Cache/Connection/RedisCache.php b/DataStorage/Cache/Connection/RedisCache.php index eb77e2e17..63686e6e0 100644 --- a/DataStorage/Cache/Connection/RedisCache.php +++ b/DataStorage/Cache/Connection/RedisCache.php @@ -31,7 +31,7 @@ class RedisCache extends ConnectionAbstract /** * {@inheritdoc} */ - protected $type = CacheType::REDIS; + protected string $type = CacheType::REDIS; /** * Constructor diff --git a/DataStorage/Cookie/CookieJar.php b/DataStorage/Cookie/CookieJar.php index 295810015..6b5ef11b0 100644 --- a/DataStorage/Cookie/CookieJar.php +++ b/DataStorage/Cookie/CookieJar.php @@ -32,14 +32,14 @@ final class CookieJar * @var bool * @since 1.0.0 */ - private static $isLocked = false; + private static bool $isLocked = false; /** * Cookie values. * * @var array * @since 1.0.0 */ - private $cookies = []; + private array $cookies = []; /** * Constructor. diff --git a/DataStorage/Database/BuilderAbstract.php b/DataStorage/Database/BuilderAbstract.php index c8ffe405e..ea05dafa3 100644 --- a/DataStorage/Database/BuilderAbstract.php +++ b/DataStorage/Database/BuilderAbstract.php @@ -30,18 +30,18 @@ abstract class BuilderAbstract /** * Grammar. * - * @var GrammarAbstract + * @var null|GrammarAbstract * @since 1.0.0 */ - protected $grammar = null; + protected ?GrammarAbstract $grammar = null; /** * Database connection. * - * @var DataStorageConnectionInterface + * @var null|DataStorageConnectionInterface * @since 1.0.0 */ - protected $connection = null; + protected ?DataStorageConnectionInterface $connection = null; /** * Query type. @@ -49,7 +49,7 @@ abstract class BuilderAbstract * @var int * @since 1.0.0 */ - protected $type = QueryType::NONE; + protected int $type = QueryType::NONE; /** * Prefix. @@ -57,7 +57,7 @@ abstract class BuilderAbstract * @var string * @since 1.0.0 */ - protected $prefix = ''; + protected string $prefix = ''; /** * Raw. @@ -65,7 +65,7 @@ abstract class BuilderAbstract * @var string * @since 1.0.0 */ - public $raw = ''; + public string $raw = ''; /** * Get connection diff --git a/DataStorage/Database/Connection/ConnectionAbstract.php b/DataStorage/Database/Connection/ConnectionAbstract.php index 982fd3cbb..9d6527d72 100644 --- a/DataStorage/Database/Connection/ConnectionAbstract.php +++ b/DataStorage/Database/Connection/ConnectionAbstract.php @@ -41,7 +41,7 @@ abstract class ConnectionAbstract implements ConnectionInterface * @var null|\PDO * @since 1.0.0 */ - public $con = null; + public ?\PDO $con = null; /** * Database prefix. @@ -51,15 +51,15 @@ abstract class ConnectionAbstract implements ConnectionInterface * @var string * @since 1.0.0 */ - public $prefix = ''; + public string $prefix = ''; /** * Database data. * - * @var string[] + * @var null|string[] * @since 1.0.0 */ - protected $dbdata = null; + protected ?array $dbdata = null; /** * Database type. @@ -67,7 +67,7 @@ abstract class ConnectionAbstract implements ConnectionInterface * @var string * @since 1.0.0 */ - protected $type = DatabaseType::UNDEFINED; + protected string $type = DatabaseType::UNDEFINED; /** * Database status. @@ -75,23 +75,23 @@ abstract class ConnectionAbstract implements ConnectionInterface * @var int * @since 1.0.0 */ - protected $status = DatabaseStatus::CLOSED; + protected int $status = DatabaseStatus::CLOSED; /** * Database grammar. * - * @var Grammar + * @var null|Grammar * @since 1.0.0 */ - protected $grammar = null; + protected ?Grammar $grammar = null; /** * Database grammar. * - * @var SchemaGrammar + * @var null|SchemaGrammar * @since 1.0.0 */ - protected $schemaGrammar = null; + protected ?SchemaGrammar $schemaGrammar = null; /** * {@inheritdoc} diff --git a/DataStorage/Database/DataMapperAbstract.php b/DataStorage/Database/DataMapperAbstract.php index f602b3a40..3b7400a0f 100644 --- a/DataStorage/Database/DataMapperAbstract.php +++ b/DataStorage/Database/DataMapperAbstract.php @@ -37,10 +37,10 @@ class DataMapperAbstract implements DataMapperInterface /** * Database connection. * - * @var ConnectionAbstract + * @var null|ConnectionAbstract * @since 1.0.0 */ - protected static $db = null; + protected static ?ConnectionAbstract $db = null; /** * Overwriting extended values. @@ -48,7 +48,7 @@ class DataMapperAbstract implements DataMapperInterface * @var bool * @since 1.0.0 */ - protected static $overwrite = true; + protected static bool $overwrite = true; /** * Primary field name. @@ -56,7 +56,7 @@ class DataMapperAbstract implements DataMapperInterface * @var string * @since 1.0.0 */ - protected static $primaryField = ''; + protected static string $primaryField = ''; /** * Primary field name. @@ -64,7 +64,7 @@ class DataMapperAbstract implements DataMapperInterface * @var string * @since 1.0.0 */ - protected static $createdAt = ''; + protected static string $createdAt = ''; /** * Language @@ -72,7 +72,7 @@ class DataMapperAbstract implements DataMapperInterface * @var string * @since 1.0.0 */ - protected static $languageField = ''; + protected static string $languageField = ''; /** * Columns. @@ -80,7 +80,7 @@ class DataMapperAbstract implements DataMapperInterface * @var array> * @since 1.0.0 */ - protected static $columns = []; + protected static array $columns = []; /** * Has many relation. @@ -88,7 +88,7 @@ class DataMapperAbstract implements DataMapperInterface * @var array * @since 1.0.0 */ - protected static $hasMany = []; + protected static array $hasMany = []; /** * Relations. @@ -98,7 +98,7 @@ class DataMapperAbstract implements DataMapperInterface * @var array * @since 1.0.0 */ - protected static $ownsOne = []; + protected static array $ownsOne = []; /** * Relations. @@ -113,7 +113,7 @@ class DataMapperAbstract implements DataMapperInterface * @var array> * @since 1.0.0 */ - protected static $belongsTo = []; + protected static array $belongsTo = []; /** * Table. @@ -121,7 +121,7 @@ class DataMapperAbstract implements DataMapperInterface * @var string * @since 1.0.0 */ - protected static $table = ''; + protected static string $table = ''; /** * Fields to load. @@ -129,7 +129,7 @@ class DataMapperAbstract implements DataMapperInterface * @var array[] * @since 1.0.0 */ - protected static $fields = []; + protected static array $fields = []; /** * Initialized objects for cross reference to reduce initialization costs @@ -137,7 +137,7 @@ class DataMapperAbstract implements DataMapperInterface * @var array[] * @since 1.0.0 */ - protected static $initObjects = []; + protected static array $initObjects = []; /** * Initialized arrays for cross reference to reduce initialization costs @@ -145,7 +145,7 @@ class DataMapperAbstract implements DataMapperInterface * @var array[] * @since 1.0.0 */ - protected static $initArrays = []; + protected static array $initArrays = []; /** * Highest mapper to know when to clear initialized objects @@ -153,7 +153,7 @@ class DataMapperAbstract implements DataMapperInterface * @var null|string * @since 1.0.0 */ - protected static $parentMapper = null; + protected static ?string $parentMapper = null; /** * Extended value collection. @@ -161,7 +161,7 @@ class DataMapperAbstract implements DataMapperInterface * @var array * @since 1.0.0 */ - protected static $collection = [ + protected static array $collection = [ 'primaryField' => [], 'createdAt' => [], 'columns' => [], diff --git a/DataStorage/Database/DatabasePool.php b/DataStorage/Database/DatabasePool.php index a256cf366..1448f1a34 100644 --- a/DataStorage/Database/DatabasePool.php +++ b/DataStorage/Database/DatabasePool.php @@ -36,7 +36,7 @@ final class DatabasePool implements DataStoragePoolInterface * @var DataStorageConnectionInterface[] * @since 1.0.0 */ - private $pool = []; + private array $pool = []; /** * Constructor. diff --git a/DataStorage/Database/GrammarAbstract.php b/DataStorage/Database/GrammarAbstract.php index 046f8648c..b850ea41e 100644 --- a/DataStorage/Database/GrammarAbstract.php +++ b/DataStorage/Database/GrammarAbstract.php @@ -32,7 +32,7 @@ abstract class GrammarAbstract * @var string * @since 1.0.0 */ - protected $comment = '--'; + protected string $comment = '--'; /** * String quotes style. @@ -40,7 +40,7 @@ abstract class GrammarAbstract * @var string * @since 1.0.0 */ - protected $valueQuotes = '\''; + protected string $valueQuotes = '\''; /** * System identifier. @@ -48,7 +48,7 @@ abstract class GrammarAbstract * @var string * @since 1.0.0 */ - protected $systemIdentifier = '"'; + protected string $systemIdentifier = '"'; /** * And operator. @@ -56,7 +56,7 @@ abstract class GrammarAbstract * @var string * @since 1.0.0 */ - protected $and = 'AND'; + protected string $and = 'AND'; /** * Or operator. @@ -64,7 +64,7 @@ abstract class GrammarAbstract * @var string * @since 1.0.0 */ - protected $or = 'OR'; + protected string $or = 'OR'; /** * Table prefix. @@ -72,7 +72,7 @@ abstract class GrammarAbstract * @var string * @since 1.0.0 */ - protected $tablePrefix = ''; + protected string $tablePrefix = ''; /** * Special keywords. @@ -80,7 +80,7 @@ abstract class GrammarAbstract * @var array * @since 1.0.0 */ - protected $specialKeywords = [ + protected array $specialKeywords = [ 'COUNT(', ]; diff --git a/DataStorage/Database/Query/Builder.php b/DataStorage/Database/Query/Builder.php index 2dd530dfa..0992c44ec 100644 --- a/DataStorage/Database/Query/Builder.php +++ b/DataStorage/Database/Query/Builder.php @@ -33,7 +33,7 @@ class Builder extends BuilderAbstract * @var bool * @since 1.0.0 */ - protected $isReadOnly = false; + protected bool $isReadOnly = false; /** * Columns. @@ -41,7 +41,7 @@ class Builder extends BuilderAbstract * @var array * @since 1.0.0 */ - public $selects = []; + public array $selects = []; /** * Columns. @@ -49,7 +49,7 @@ class Builder extends BuilderAbstract * @var array * @since 1.0.0 */ - public $updates = []; + public array $updates = []; /** * Stupid work around because value needs to be not null for it to work in Grammar. @@ -57,7 +57,7 @@ class Builder extends BuilderAbstract * @var array * @since 1.0.0 */ - public $deletes = [1]; + public array $deletes = [1]; /** * Into. @@ -73,7 +73,7 @@ class Builder extends BuilderAbstract * @var array * @since 1.0.0 */ - public $inserts = []; + public array $inserts = []; /** * Into columns. @@ -81,7 +81,7 @@ class Builder extends BuilderAbstract * @var array * @since 1.0.0 */ - public $values = []; + public array $values = []; /** * Into columns. @@ -89,7 +89,7 @@ class Builder extends BuilderAbstract * @var array * @since 1.0.0 */ - public $sets = []; + public array $sets = []; /** * Distinct. @@ -97,7 +97,7 @@ class Builder extends BuilderAbstract * @var bool * @since 1.0.0 */ - public $distinct = false; + public bool $distinct = false; /** * From. @@ -105,7 +105,7 @@ class Builder extends BuilderAbstract * @var array * @since 1.0.0 */ - public $from = []; + public array $from = []; /** * Joins. @@ -113,7 +113,7 @@ class Builder extends BuilderAbstract * @var array * @since 1.0.0 */ - public $joins = []; + public array $joins = []; /** * Ons of joins. @@ -121,7 +121,7 @@ class Builder extends BuilderAbstract * @var array * @since 1.0.0 */ - public $ons = []; + public array $ons = []; /** * Where. @@ -129,7 +129,7 @@ class Builder extends BuilderAbstract * @var array * @since 1.0.0 */ - public $wheres = []; + public array $wheres = []; /** * Group. @@ -137,7 +137,7 @@ class Builder extends BuilderAbstract * @var array * @since 1.0.0 */ - public $groups = []; + public array $groups = []; /** * Order. @@ -145,23 +145,23 @@ class Builder extends BuilderAbstract * @var array * @since 1.0.0 */ - public $orders = []; + public array $orders = []; /** * Limit. * - * @var int + * @var null|int * @since 1.0.0 */ - public $limit = null; + public ?int $limit = null; /** * Offset. * - * @var int + * @var null|int * @since 1.0.0 */ - public $offset = null; + public ?int $offset = null; /** * Binds. @@ -169,7 +169,7 @@ class Builder extends BuilderAbstract * @var array * @since 1.0.0 */ - private $binds = []; + private array $binds = []; /** * Union. @@ -177,7 +177,7 @@ class Builder extends BuilderAbstract * @var array * @since 1.0.0 */ - public $unions = []; + public array $unions = []; /** * Lock. @@ -185,7 +185,7 @@ class Builder extends BuilderAbstract * @var bool * @since 1.0.0 */ - public $lock = false; + public bool $lock = false; /** * Comparison OPERATORS. diff --git a/DataStorage/Database/Query/Column.php b/DataStorage/Database/Query/Column.php index a9d9e77e5..a81f339a0 100644 --- a/DataStorage/Database/Query/Column.php +++ b/DataStorage/Database/Query/Column.php @@ -31,7 +31,7 @@ class Column * @var string * @since 1.0.0 */ - private $column = ''; + private string $column = ''; /** * Constructor. diff --git a/DataStorage/Database/Query/Grammar/Grammar.php b/DataStorage/Database/Query/Grammar/Grammar.php index 3dfba111b..be119ff4c 100644 --- a/DataStorage/Database/Query/Grammar/Grammar.php +++ b/DataStorage/Database/Query/Grammar/Grammar.php @@ -36,7 +36,7 @@ class Grammar extends GrammarAbstract * @var string[] * @since 1.0.0 */ - protected $selectComponents = [ + protected array $selectComponents = [ 'aggregate', 'selects', 'from', @@ -57,7 +57,7 @@ class Grammar extends GrammarAbstract * @var string[] * @since 1.0.0 */ - protected $insertComponents = [ + protected array $insertComponents = [ 'into', 'inserts', 'values', @@ -69,7 +69,7 @@ class Grammar extends GrammarAbstract * @var string[] * @since 1.0.0 */ - protected $updateComponents = [ + protected array $updateComponents = [ 'updates', 'sets', 'wheres', @@ -81,7 +81,7 @@ class Grammar extends GrammarAbstract * @var string[] * @since 1.0.0 */ - protected $deleteComponents = [ + protected array $deleteComponents = [ 'deletes', 'from', 'wheres', @@ -93,7 +93,7 @@ class Grammar extends GrammarAbstract * @var string[] * @since 1.0.0 */ - protected $randomComponents = [ + protected array $randomComponents = [ 'random', ]; diff --git a/DataStorage/Database/Query/Grammar/MysqlGrammar.php b/DataStorage/Database/Query/Grammar/MysqlGrammar.php index ec542de23..fded53d9e 100644 --- a/DataStorage/Database/Query/Grammar/MysqlGrammar.php +++ b/DataStorage/Database/Query/Grammar/MysqlGrammar.php @@ -33,7 +33,7 @@ class MysqlGrammar extends Grammar * @var string * @since 1.0.0 */ - protected $systemIdentifier = '`'; + protected string $systemIdentifier = '`'; /** * Compile random. diff --git a/DataStorage/Database/Query/Grammar/SQLiteGrammar.php b/DataStorage/Database/Query/Grammar/SQLiteGrammar.php index 4ca6d032e..26e501c43 100644 --- a/DataStorage/Database/Query/Grammar/SQLiteGrammar.php +++ b/DataStorage/Database/Query/Grammar/SQLiteGrammar.php @@ -33,7 +33,7 @@ class SQLiteGrammar extends Grammar * @var string * @since 1.0.0 */ - public $systemIdentifier = '`'; + public string $systemIdentifier = '`'; /** * Compile random. diff --git a/DataStorage/Database/Schema/Builder.php b/DataStorage/Database/Schema/Builder.php index 24d426160..a26037910 100644 --- a/DataStorage/Database/Schema/Builder.php +++ b/DataStorage/Database/Schema/Builder.php @@ -27,19 +27,19 @@ use phpOMS\DataStorage\Database\Query\Builder as QueryBuilder; */ class Builder extends QueryBuilder { - public $createTable = ''; + public string $createTable = ''; - public $createFields = []; + public array $createFields = []; - public $dropDatabase = ''; + public string $dropDatabase = ''; - public $dropTable = ''; + public string $dropTable = ''; - public $selectTables = ['*']; + public array $selectTables = ['*']; - public $selectFields = ''; + public string $selectFields = ''; - public $createTableSettings = true; + public bool $createTableSettings = true; /** * Constructor. diff --git a/DataStorage/Database/Schema/Grammar/Grammar.php b/DataStorage/Database/Schema/Grammar/Grammar.php index 55871b822..a8015f724 100644 --- a/DataStorage/Database/Schema/Grammar/Grammar.php +++ b/DataStorage/Database/Schema/Grammar/Grammar.php @@ -34,7 +34,7 @@ class Grammar extends QueryGrammar * @var string[] * @since 1.0.0 */ - protected $dropDatabaseComponents = [ + protected array $dropDatabaseComponents = [ 'dropDatabase', ]; @@ -44,7 +44,7 @@ class Grammar extends QueryGrammar * @var string[] * @since 1.0.0 */ - protected $dropTableComponents = [ + protected array $dropTableComponents = [ 'dropTable', ]; @@ -54,7 +54,7 @@ class Grammar extends QueryGrammar * @var string[] * @since 1.0.0 */ - protected $createTablesComponents = [ + protected array $createTablesComponents = [ 'createTable', 'createFields', 'createTableSettings', @@ -66,7 +66,7 @@ class Grammar extends QueryGrammar * @var string[] * @since 1.0.0 */ - protected $tablesComponents = [ + protected array $tablesComponents = [ 'selectTables', ]; @@ -76,7 +76,7 @@ class Grammar extends QueryGrammar * @var string[] * @since 1.0.0 */ - protected $fieldsComponents = [ + protected array $fieldsComponents = [ 'selectFields', ]; diff --git a/DataStorage/Database/Schema/Grammar/MysqlGrammar.php b/DataStorage/Database/Schema/Grammar/MysqlGrammar.php index e216027b4..821da32be 100644 --- a/DataStorage/Database/Schema/Grammar/MysqlGrammar.php +++ b/DataStorage/Database/Schema/Grammar/MysqlGrammar.php @@ -33,7 +33,7 @@ class MysqlGrammar extends Grammar * @var string * @since 1.0.0 */ - protected $systemIdentifier = '`'; + protected string $systemIdentifier = '`'; /** * Compile from. diff --git a/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php b/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php index 7d6952e32..aec6a1758 100644 --- a/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php +++ b/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php @@ -22,5 +22,5 @@ class SQLiteGrammar extends Grammar * @var string * @since 1.0.0 */ - protected $systemIdentifier = '`'; + protected string $systemIdentifier = '`'; } diff --git a/DataStorage/Database/SchemaMapper.php b/DataStorage/Database/SchemaMapper.php index 309b942f3..c2dd142ad 100644 --- a/DataStorage/Database/SchemaMapper.php +++ b/DataStorage/Database/SchemaMapper.php @@ -30,10 +30,10 @@ class SchemaMapper /** * Database connection. * - * @var ConnectionAbstract + * @var null|ConnectionAbstract * @since 1.0.0 */ - protected $db = null; + protected ?ConnectionAbstract $db = null; public function __construct(ConnectionAbstract $db) { diff --git a/DataStorage/Session/HttpSession.php b/DataStorage/Session/HttpSession.php index 0dda9c0eb..ebfc4137e 100644 --- a/DataStorage/Session/HttpSession.php +++ b/DataStorage/Session/HttpSession.php @@ -37,7 +37,7 @@ class HttpSession implements SessionInterface * @var bool * @since 1.0.0 */ - private $isLocked = false; + private bool $isLocked = false; /** * Raw session data. @@ -45,7 +45,7 @@ class HttpSession implements SessionInterface * @var array * @since 1.0.0 */ - private $sessionData = []; + private array $sessionData = []; /** * Session ID. @@ -61,7 +61,7 @@ class HttpSession implements SessionInterface * @var int * @since 1.0.0 */ - private $inactivityInterval = 0; + private int $inactivityInterval = 0; /** * Constructor. diff --git a/Dispatcher/Dispatcher.php b/Dispatcher/Dispatcher.php index d6d7ad2ed..f4544d1a7 100644 --- a/Dispatcher/Dispatcher.php +++ b/Dispatcher/Dispatcher.php @@ -36,7 +36,7 @@ final class Dispatcher * @var null|ApplicationAbstract * @since 1.0.0 */ - private $app = null; + private ?ApplicationAbstract $app = null; /** * Controller. @@ -46,7 +46,7 @@ final class Dispatcher * @var array * @since 1.0.0 */ - private $controllers = []; + private array $controllers = []; /** * Constructor. diff --git a/Event/EventManager.php b/Event/EventManager.php index 6e69c3744..c623c29d0 100644 --- a/Event/EventManager.php +++ b/Event/EventManager.php @@ -38,7 +38,7 @@ final class EventManager implements \Countable * @var array * @since 1.0.0 */ - private $groups = []; + private array $groups = []; /** * Callbacks. @@ -46,7 +46,7 @@ final class EventManager implements \Countable * @var array * @since 1.0.0 */ - private $callbacks = []; + private array $callbacks = []; /** * Dispatcher. @@ -54,7 +54,7 @@ final class EventManager implements \Countable * @var Dispatcher|Object * @since 1.0.0 */ - private $dispatcher = null; + private ?Dispatcher $dispatcher = null; /** * Constructor. diff --git a/Localization/Defaults/CityMapper.php b/Localization/Defaults/CityMapper.php index 2ce586fab..4047726d9 100644 --- a/Localization/Defaults/CityMapper.php +++ b/Localization/Defaults/CityMapper.php @@ -33,7 +33,7 @@ class CityMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $columns = [ + protected static array $columns = [ 'city_id' => ['name' => 'city_id', 'type' => 'int', 'internal' => 'id'], 'city_city' => ['name' => 'city_city', 'type' => 'string', 'internal' => 'name'], 'city_country' => ['name' => 'city_country', 'type' => 'string', 'internal' => 'countryCode'], @@ -49,7 +49,7 @@ class CityMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $table = 'city'; + protected static string $table = 'city'; /** * Primary field name. @@ -57,5 +57,5 @@ class CityMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $primaryField = 'city_id'; + protected static string $primaryField = 'city_id'; } diff --git a/Localization/Defaults/CountryMapper.php b/Localization/Defaults/CountryMapper.php index 7ff4007b2..6f725cb07 100644 --- a/Localization/Defaults/CountryMapper.php +++ b/Localization/Defaults/CountryMapper.php @@ -33,7 +33,7 @@ class CountryMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $columns = [ + protected static array $columns = [ 'country_id' => ['name' => 'country_id', 'type' => 'int', 'internal' => 'id'], 'country_name' => ['name' => 'country_name', 'type' => 'string', 'internal' => 'name'], 'country_code2' => ['name' => 'country_code2', 'type' => 'string', 'internal' => 'code2'], @@ -48,7 +48,7 @@ class CountryMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $table = 'country'; + protected static string $table = 'country'; /** * Primary field name. @@ -56,5 +56,5 @@ class CountryMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $primaryField = 'country_id'; + protected static string $primaryField = 'country_id'; } diff --git a/Localization/Defaults/CurrencyMapper.php b/Localization/Defaults/CurrencyMapper.php index f9aa384a1..4215694c9 100644 --- a/Localization/Defaults/CurrencyMapper.php +++ b/Localization/Defaults/CurrencyMapper.php @@ -33,7 +33,7 @@ class CurrencyMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $columns = [ + protected static array $columns = [ 'currency_id' => ['name' => 'currency_id', 'type' => 'int', 'internal' => 'id'], 'currency_name' => ['name' => 'currency_name', 'type' => 'string', 'internal' => 'name'], 'currency_code' => ['name' => 'currency_code', 'type' => 'string', 'internal' => 'code'], @@ -48,7 +48,7 @@ class CurrencyMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $table = 'currency'; + protected static string $table = 'currency'; /** * Primary field name. @@ -56,5 +56,5 @@ class CurrencyMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $primaryField = 'currency_id'; + protected static string $primaryField = 'currency_id'; } diff --git a/Localization/Defaults/IbanMapper.php b/Localization/Defaults/IbanMapper.php index c3cf02a2b..165fe13b5 100644 --- a/Localization/Defaults/IbanMapper.php +++ b/Localization/Defaults/IbanMapper.php @@ -33,7 +33,7 @@ class IbanMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $columns = [ + protected static array $columns = [ 'iban_id' => ['name' => 'iban_id', 'type' => 'int', 'internal' => 'id'], 'iban_country' => ['name' => 'iban_country', 'type' => 'string', 'internal' => 'country'], 'iban_chars' => ['name' => 'iban_chars', 'type' => 'int', 'internal' => 'chars'], @@ -47,7 +47,7 @@ class IbanMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $table = 'iban'; + protected static string $table = 'iban'; /** * Primary field name. @@ -55,5 +55,5 @@ class IbanMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $primaryField = 'iban_id'; + protected static string $primaryField = 'iban_id'; } diff --git a/Localization/Defaults/LanguageMapper.php b/Localization/Defaults/LanguageMapper.php index 157cec543..41cfd369b 100644 --- a/Localization/Defaults/LanguageMapper.php +++ b/Localization/Defaults/LanguageMapper.php @@ -33,7 +33,7 @@ class LanguageMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $columns = [ + protected static array $columns = [ 'language_id' => ['name' => 'language_id', 'type' => 'int', 'internal' => 'id'], 'language_native' => ['name' => 'language_native', 'type' => 'string', 'internal' => 'name'], 'language_639_1' => ['name' => 'language_639_1', 'type' => 'string', 'internal' => 'native'], @@ -48,7 +48,7 @@ class LanguageMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $table = 'language'; + protected static string $table = 'language'; /** * Primary field name. @@ -56,5 +56,5 @@ class LanguageMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $primaryField = 'language_id'; + protected static string $primaryField = 'language_id'; } diff --git a/Localization/L11nManager.php b/Localization/L11nManager.php index b2b5de9ad..d4d4a27d4 100644 --- a/Localization/L11nManager.php +++ b/Localization/L11nManager.php @@ -34,7 +34,7 @@ final class L11nManager * @var array * @since 1.0.0 */ - private $language = []; + private array $language = []; /** * App Name. @@ -42,7 +42,7 @@ final class L11nManager * @var string * @since 1.0.0 */ - private $appName = ''; + private string $appName = ''; /** * Construct. diff --git a/Localization/Localization.php b/Localization/Localization.php index 07d0fd8ef..c7526865c 100644 --- a/Localization/Localization.php +++ b/Localization/Localization.php @@ -35,7 +35,7 @@ class Localization * @var string * @since 1.0.0 */ - private $country = ISO3166TwoEnum::_USA; + private string $country = ISO3166TwoEnum::_USA; /** * Timezone. @@ -43,7 +43,7 @@ class Localization * @var string * @since 1.0.0 */ - private $timezone = 'America/New_York'; + private string $timezone = 'America/New_York'; /** * Language ISO code. @@ -51,7 +51,7 @@ class Localization * @var string * @since 1.0.0 */ - private $language = ISO639x1Enum::_EN; + private string $language = ISO639x1Enum::_EN; /** * Currency. @@ -59,7 +59,7 @@ class Localization * @var string * @since 1.0.0 */ - private $currency = ISO4217Enum::_USD; + private string $currency = ISO4217Enum::_USD; /** * Number format. @@ -67,7 +67,7 @@ class Localization * @var string * @since 1.0.0 */ - private $decimal = '.'; + private string $decimal = '.'; /** * Number format. @@ -75,7 +75,7 @@ class Localization * @var string * @since 1.0.0 */ - private $thousands = ','; + private string $thousands = ','; /** * Angle type. @@ -83,7 +83,7 @@ class Localization * @var string * @since 1.0.0 */ - private $angle = AngleType::DEGREE; + private string $angle = AngleType::DEGREE; /** * Temperature type. @@ -91,7 +91,7 @@ class Localization * @var string * @since 1.0.0 */ - private $temperature = TemperatureType::CELSIUS; + private string $temperature = TemperatureType::CELSIUS; /** * Time format. @@ -99,7 +99,7 @@ class Localization * @var array * @since 1.0.0 */ - private $datetime = []; + private array $datetime = []; /** * Weight. @@ -107,7 +107,7 @@ class Localization * @var array * @since 1.0.0 */ - private $weight = []; + private array $weight = []; /** * Speed. @@ -115,7 +115,7 @@ class Localization * @var array * @since 1.0.0 */ - private $speed = []; + private array $speed = []; /** * Length. @@ -123,7 +123,7 @@ class Localization * @var array * @since 1.0.0 */ - private $length = []; + private array $length = []; /** * Area. @@ -131,7 +131,7 @@ class Localization * @var array * @since 1.0.0 */ - private $area = []; + private array $area = []; /** * Volume. @@ -139,7 +139,7 @@ class Localization * @var array * @since 1.0.0 */ - private $volume = []; + private array $volume = []; /** * Load localization from language code diff --git a/Localization/Money.php b/Localization/Money.php index 5e0d58cdd..e8108341c 100644 --- a/Localization/Money.php +++ b/Localization/Money.php @@ -39,7 +39,7 @@ final class Money implements \Serializable * @var string * @since 1.0.0 */ - private $thousands = ','; + private string $thousands = ','; /** * Decimal separator. @@ -47,7 +47,7 @@ final class Money implements \Serializable * @var string * @since 1.0.0 */ - private $decimal = '.'; + private string $decimal = '.'; /** * Currency symbol position @@ -55,7 +55,7 @@ final class Money implements \Serializable * @var int * @since 1.0.0 */ - private $position = 1; + private int $position = 1; /** * Currency symbol. @@ -63,7 +63,7 @@ final class Money implements \Serializable * @var string * @since 1.0.0 */ - private $symbol = ISO4217SymbolEnum::_USD; + private string $symbol = ISO4217SymbolEnum::_USD; /** * Value. @@ -71,7 +71,7 @@ final class Money implements \Serializable * @var int * @since 1.0.0 */ - private $value = 0; + private int $value = 0; /** * Constructor. diff --git a/Log/FileLogger.php b/Log/FileLogger.php index 65d72bec4..7b512728c 100644 --- a/Log/FileLogger.php +++ b/Log/FileLogger.php @@ -42,15 +42,15 @@ final class FileLogger implements LoggerInterface * @var array * @since 1.0.0 */ - private static $timings = []; + private static array $timings = []; /** * Instance. * - * @var FileLogger + * @var null|FileLogger * @since 1.0.0 */ - protected static $instance = null; + protected static ?FileLogger $instance = null; /** * Verbose. @@ -58,7 +58,7 @@ final class FileLogger implements LoggerInterface * @var bool * @since 1.0.0 */ - protected $verbose = false; + protected bool $verbose = false; /** * The file pointer for the logging. @@ -76,7 +76,7 @@ final class FileLogger implements LoggerInterface * @var string * @since 1.0.0 */ - private $path = ''; + private string $path = ''; /** * Is the logging file created @@ -84,7 +84,7 @@ final class FileLogger implements LoggerInterface * @var bool * @since 1.0.0 */ - private $created = false; + private bool $created = false; /** * Object constructor. diff --git a/Math/Geometry/Shape/D2/Polygon.php b/Math/Geometry/Shape/D2/Polygon.php index c76bf55b1..54e469524 100644 --- a/Math/Geometry/Shape/D2/Polygon.php +++ b/Math/Geometry/Shape/D2/Polygon.php @@ -40,7 +40,7 @@ final class Polygon implements D2ShapeInterface * @var array[] * @since 1.0.0 */ - private $coord = []; + private array $coord = []; /** * Constructor. diff --git a/Math/Geometry/Shape/D3/Sphere.php b/Math/Geometry/Shape/D3/Sphere.php index 0666bde72..572ecbdc7 100644 --- a/Math/Geometry/Shape/D3/Sphere.php +++ b/Math/Geometry/Shape/D3/Sphere.php @@ -30,7 +30,7 @@ final class Sphere implements D3ShapeInterface * @var float * @since 1.0.0 */ - private $radius = 0.0; + private float $radius = 0.0; /** * Constructor. diff --git a/Math/Matrix/CholeskyDecomposition.php b/Math/Matrix/CholeskyDecomposition.php index e3a75c4fd..486910f74 100644 --- a/Math/Matrix/CholeskyDecomposition.php +++ b/Math/Matrix/CholeskyDecomposition.php @@ -34,7 +34,7 @@ final class CholeskyDecomposition * @var array * @since 1.0.0 */ - private $L = []; + private array $L = []; /** * Dimension of L @@ -42,7 +42,7 @@ final class CholeskyDecomposition * @var int * @since 1.0.0 */ - private $m = 0; + private int $m = 0; /** * Is symmetric positiv definite @@ -50,7 +50,7 @@ final class CholeskyDecomposition * @var bool * @since 1.0.0 */ - private $isSpd = true; + private bool $isSpd = true; /** * Constructor. diff --git a/Math/Matrix/EigenvalueDecomposition.php b/Math/Matrix/EigenvalueDecomposition.php index a65af294a..485b1bc13 100644 --- a/Math/Matrix/EigenvalueDecomposition.php +++ b/Math/Matrix/EigenvalueDecomposition.php @@ -35,7 +35,7 @@ final class EigenvalueDecomposition * @var int * @since 1.0.0 */ - private $m = 0; + private int $m = 0; /** * Is symmetric @@ -43,7 +43,7 @@ final class EigenvalueDecomposition * @var bool * @since 1.0.0 */ - private $isSymmetric = true; + private bool $isSymmetric = true; /** * A square matrix. @@ -51,7 +51,7 @@ final class EigenvalueDecomposition * @var array * @since 1.0.0 */ - private $A = []; + private array $A = []; /** * Eigenvectors @@ -59,7 +59,7 @@ final class EigenvalueDecomposition * @var array * @since 1.0.0 */ - private $V = []; + private array $V = []; /** * Eigenvalues @@ -67,7 +67,7 @@ final class EigenvalueDecomposition * @var array * @since 1.0.0 */ - private $D = []; + private array $D = []; /** * Eigenvalues @@ -75,7 +75,7 @@ final class EigenvalueDecomposition * @var array * @since 1.0.0 */ - private $E = []; + private array $E = []; /** * Hessenberg form @@ -83,7 +83,7 @@ final class EigenvalueDecomposition * @var array * @since 1.0.0 */ - private $H = []; + private array $H = []; /** * Non-symmetric storage @@ -91,7 +91,7 @@ final class EigenvalueDecomposition * @var array * @since 1.0.0 */ - private $ort = []; + private array $ort = []; /** * Complex scalar division @@ -99,7 +99,7 @@ final class EigenvalueDecomposition * @var float * @since 1.0.0 */ - private $cdivr = 0.0; + private float $cdivr = 0.0; /** * Complex scalar division @@ -107,7 +107,7 @@ final class EigenvalueDecomposition * @var float * @since 1.0.0 */ - private $cdivi = 0.0; + private float $cdivi = 0.0; /** * Constructor. diff --git a/Math/Matrix/LUDecomposition.php b/Math/Matrix/LUDecomposition.php index 1ed61bcab..906eb1574 100644 --- a/Math/Matrix/LUDecomposition.php +++ b/Math/Matrix/LUDecomposition.php @@ -34,7 +34,7 @@ final class LUDecomposition * @var array * @since 1.0.0 */ - private $LU = []; + private array $LU = []; /** * Dimension m @@ -42,7 +42,7 @@ final class LUDecomposition * @var int * @since 1.0.0 */ - private $m = 0; + private int $m = 0; /** * Dimension n @@ -50,7 +50,7 @@ final class LUDecomposition * @var int * @since 1.0.0 */ - private $n = 0; + private int $n = 0; /** * Pivot sign @@ -58,7 +58,7 @@ final class LUDecomposition * @var int * @since 1.0.0 */ - private $pivSign = 1; + private int $pivSign = 1; /** * Pivot @@ -66,7 +66,7 @@ final class LUDecomposition * @var array * @since 1.0.0 */ - private $piv = []; + private array $piv = []; /** * Constructor. diff --git a/Math/Matrix/Matrix.php b/Math/Matrix/Matrix.php index 12b70ce6e..c7d4b2df4 100644 --- a/Math/Matrix/Matrix.php +++ b/Math/Matrix/Matrix.php @@ -32,7 +32,7 @@ class Matrix implements \ArrayAccess, \Iterator * @var array * @since 1.0.0 */ - protected $matrix = []; + protected array $matrix = []; /** * Columns. @@ -40,7 +40,7 @@ class Matrix implements \ArrayAccess, \Iterator * @var int * @since 1.0.0 */ - protected $n = 0; + protected int $n = 0; /** * Rows. @@ -48,7 +48,7 @@ class Matrix implements \ArrayAccess, \Iterator * @var int * @since 1.0.0 */ - protected $m = 0; + protected int $m = 0; /** * Iterator position. @@ -56,7 +56,7 @@ class Matrix implements \ArrayAccess, \Iterator * @var int * @since 1.0.0 */ - protected $position = 0; + protected int $position = 0; /** * Constructor. diff --git a/Math/Matrix/QRDecomposition.php b/Math/Matrix/QRDecomposition.php index 61ce5edf3..b05ea70bb 100644 --- a/Math/Matrix/QRDecomposition.php +++ b/Math/Matrix/QRDecomposition.php @@ -35,7 +35,7 @@ final class QRDecomposition * @var array[] * @since 1.0.0 */ - private $QR = []; + private array $QR = []; /** * Dimension m @@ -43,7 +43,7 @@ final class QRDecomposition * @var int * @since 1.0.0 */ - private $m = 0; + private int $m = 0; /** * Dimension n @@ -51,7 +51,7 @@ final class QRDecomposition * @var int * @since 1.0.0 */ - private $n = 0; + private int $n = 0; /** * R diagonal @@ -59,7 +59,7 @@ final class QRDecomposition * @var array * @since 1.0.0 */ - private $Rdiag = []; + private array $Rdiag = []; /** * Constructor. diff --git a/Math/Matrix/SingularValueDecomposition.php b/Math/Matrix/SingularValueDecomposition.php index 86a35800c..437366ec5 100644 --- a/Math/Matrix/SingularValueDecomposition.php +++ b/Math/Matrix/SingularValueDecomposition.php @@ -32,7 +32,7 @@ final class SingularValueDecomposition * @var array[] * @since 1.0.0 */ - private $U = []; + private array $U = []; /** * V matrix. @@ -40,7 +40,7 @@ final class SingularValueDecomposition * @var array[] * @since 1.0.0 */ - private $V = []; + private array $V = []; /** * Singular values. @@ -48,7 +48,7 @@ final class SingularValueDecomposition * @var array * @since 1.0.0 */ - private $S = []; + private array $S = []; /** * Dimension m @@ -56,7 +56,7 @@ final class SingularValueDecomposition * @var int * @since 1.0.0 */ - private $m = 0; + private int $m = 0; /** * Dimension n @@ -64,7 +64,7 @@ final class SingularValueDecomposition * @var int * @since 1.0.0 */ - private $n = 0; + private int $n = 0; /** * Constructor. diff --git a/Message/Console/Header.php b/Message/Console/Header.php index 4c11643b0..4943b859a 100644 --- a/Message/Console/Header.php +++ b/Message/Console/Header.php @@ -42,7 +42,7 @@ final class Header extends HeaderAbstract * @var string[][] * @since 1.0.0 */ - private $header = []; + private array $header = []; /** * Constructor. diff --git a/Message/Console/Request.php b/Message/Console/Request.php index e4c13c3ef..a3e865b3d 100644 --- a/Message/Console/Request.php +++ b/Message/Console/Request.php @@ -36,10 +36,10 @@ final class Request extends RequestAbstract /** * OS type. * - * @var string + * @var null|string * @since 1.0.0 */ - private $os = null; + private ?string $os = null; /** * Constructor. diff --git a/Message/Console/Response.php b/Message/Console/Response.php index b5e56786b..a7ca1aee3 100644 --- a/Message/Console/Response.php +++ b/Message/Console/Response.php @@ -38,7 +38,7 @@ final class Response extends ResponseAbstract implements RenderableInterface * @var int * @since 1.0.0 */ - protected $status = RequestStatusCode::R_200; + protected int $status = RequestStatusCode::R_200; /** * Constructor. diff --git a/Message/HeaderAbstract.php b/Message/HeaderAbstract.php index 130fe8933..96353c3f4 100644 --- a/Message/HeaderAbstract.php +++ b/Message/HeaderAbstract.php @@ -32,15 +32,15 @@ abstract class HeaderAbstract * @var bool * @since 1.0.0 */ - protected $isLocked = false; + protected bool $isLocked = false; /** * Localization. * - * @var Localization + * @var null|Localization * @since 1.0.0 */ - protected $l11n = null; + protected ?Localization $l11n = null; /** * Account. @@ -48,7 +48,7 @@ abstract class HeaderAbstract * @var int * @since 1.0.0 */ - protected $account = 0; + protected int $account = 0; /** * Response status. @@ -56,7 +56,7 @@ abstract class HeaderAbstract * @var int * @since 1.0.0 */ - protected $status = 0; + protected int $status = 0; /** * Constructor. diff --git a/Message/Http/Header.php b/Message/Http/Header.php index 45d503c6a..0545071b2 100644 --- a/Message/Http/Header.php +++ b/Message/Http/Header.php @@ -36,7 +36,7 @@ final class Header extends HeaderAbstract * @var string[][] * @since 1.0.0 */ - private $header = []; + private array $header = []; /** * Constructor. diff --git a/Message/Http/Request.php b/Message/Http/Request.php index 4800e409e..144e5fbc8 100644 --- a/Message/Http/Request.php +++ b/Message/Http/Request.php @@ -37,26 +37,26 @@ final class Request extends RequestAbstract /** * Browser type. * - * @var string + * @var null|string * @since 1.0.0 */ - private $browser = null; + private ?string $browser = null; /** * OS type. * - * @var string + * @var null|string * @since 1.0.0 */ - private $os = null; + private ?string $os = null; /** * Request information. * - * @var string[] + * @var null|string[] * @since 1.0.0 */ - private $info = null; + private ?array $info = null; /** * Constructor. diff --git a/Message/Http/Response.php b/Message/Http/Response.php index 2338d8031..614650bff 100644 --- a/Message/Http/Response.php +++ b/Message/Http/Response.php @@ -38,7 +38,7 @@ final class Response extends ResponseAbstract implements RenderableInterface * @var int * @since 1.0.0 */ - protected $status = RequestStatusCode::R_200; + protected int $status = RequestStatusCode::R_200; /** * Constructor. diff --git a/Message/Mail/Mail.php b/Message/Mail/Mail.php index f4c5d6ee4..4314ba50c 100644 --- a/Message/Mail/Mail.php +++ b/Message/Mail/Mail.php @@ -163,7 +163,7 @@ class Mail /** * Mail from. * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ protected $messageDate = null; diff --git a/Message/RequestAbstract.php b/Message/RequestAbstract.php index 4be2b5bc5..a14cb5bd5 100644 --- a/Message/RequestAbstract.php +++ b/Message/RequestAbstract.php @@ -29,26 +29,26 @@ abstract class RequestAbstract implements MessageInterface /** * Uri. * - * @var UriInterface + * @var null|UriInterface * @since 1.0.0 */ - protected $uri = null; + protected ?UriInterface $uri = null; /** * Request method. * - * @var string + * @var null|string * @since 1.0.0 */ - protected $method = null; + protected ?string $method = null; /** * Request type. * - * @var string + * @var null|string * @since 1.0.0 */ - protected $type = null; + protected ?string $type = null; /** * Request data. @@ -56,7 +56,7 @@ abstract class RequestAbstract implements MessageInterface * @var array * @since 1.0.0 */ - protected $data = []; + protected array $data = []; /** * Request hash. @@ -64,7 +64,7 @@ abstract class RequestAbstract implements MessageInterface * @var array * @since 1.0.0 */ - protected $hash = []; + protected array $hash = []; /** * Uploaded files. @@ -72,7 +72,7 @@ abstract class RequestAbstract implements MessageInterface * @var array * @since 1.0.0 */ - protected $files = []; + protected array $files = []; /** * Request lock. @@ -80,15 +80,15 @@ abstract class RequestAbstract implements MessageInterface * @var bool * @since 1.0.0 */ - protected $lock = false; + protected bool $lock = false; /** * Request header. * - * @var HeaderAbstract + * @var null|HeaderAbstract * @since 1.0.0 */ - protected $header = null; + protected ?HeaderAbstract $header = null; /** * Get request uri. diff --git a/Message/ResponseAbstract.php b/Message/ResponseAbstract.php index e2b043830..c361cb783 100644 --- a/Message/ResponseAbstract.php +++ b/Message/ResponseAbstract.php @@ -30,15 +30,15 @@ abstract class ResponseAbstract implements MessageInterface, \JsonSerializable * @var array * @since 1.0.0 */ - protected $response = []; + protected array $response = []; /** * Header. * - * @var HeaderAbstract + * @var null|HeaderAbstract * @since 1.0.0 */ - protected $header = null; + protected ?HeaderAbstract $header = null; /** * Get response by ID. diff --git a/Model/Html/Head.php b/Model/Html/Head.php index ec8922098..c47d55166 100644 --- a/Model/Html/Head.php +++ b/Model/Html/Head.php @@ -37,7 +37,7 @@ class Head implements RenderableInterface * @var string * @since 1.0.0 */ - private $language = ISO639x1Enum::_EN; + private string $language = ISO639x1Enum::_EN; /** * Page title. @@ -45,7 +45,7 @@ class Head implements RenderableInterface * @var string * @since 1.0.0 */ - private $title = ''; + private string $title = ''; /** * Assets bound to this page instance. @@ -53,7 +53,7 @@ class Head implements RenderableInterface * @var array * @since 1.0.0 */ - private $assets = []; + private array $assets = []; /** * Is the header set? @@ -61,15 +61,15 @@ class Head implements RenderableInterface * @var bool * @since 1.0.0 */ - private $hasContent = false; + private bool $hasContent = false; /** * Page meta. * - * @var Meta + * @var null|Meta * @since 1.0.0 */ - private $meta = null; + private ?Meta $meta = null; /** * html style. @@ -79,7 +79,7 @@ class Head implements RenderableInterface * @var mixed[] * @since 1.0.0 */ - private $style = []; + private array $style = []; /** * html script. @@ -87,7 +87,7 @@ class Head implements RenderableInterface * @var mixed[] * @since 1.0.0 */ - private $script = []; + private array $script = []; /** * Constructor. diff --git a/Model/Html/Meta.php b/Model/Html/Meta.php index 44c95b2d7..8dd683e31 100644 --- a/Model/Html/Meta.php +++ b/Model/Html/Meta.php @@ -34,7 +34,7 @@ class Meta implements RenderableInterface * @var string[] * @since 1.0.0 */ - private $keywords = []; + private array $keywords = []; /** * Author. @@ -42,7 +42,7 @@ class Meta implements RenderableInterface * @var string * @since 1.0.0 */ - private $author = ''; + private string $author = ''; /** * Charset. @@ -50,7 +50,7 @@ class Meta implements RenderableInterface * @var string * @since 1.0.0 */ - private $charset = ''; + private string $charset = ''; /** * Description. @@ -58,7 +58,7 @@ class Meta implements RenderableInterface * @var string * @since 1.0.0 */ - private $description = ''; + private string $description = ''; /** * Itemprop. @@ -66,7 +66,7 @@ class Meta implements RenderableInterface * @var array * @since 1.0.0 */ - private $itemprops = []; + private array $itemprops = []; /** * Property. @@ -74,7 +74,7 @@ class Meta implements RenderableInterface * @var array * @since 1.0.0 */ - private $properties = []; + private array $properties = []; /** * Name. @@ -82,7 +82,7 @@ class Meta implements RenderableInterface * @var array * @since 1.0.0 */ - private $names = []; + private array $names = []; /** * Add keyword. diff --git a/Model/Message/Dom.php b/Model/Message/Dom.php index 91e0dc8d1..8bf679bf5 100644 --- a/Model/Message/Dom.php +++ b/Model/Message/Dom.php @@ -41,7 +41,7 @@ class Dom implements \Serializable, ArrayableInterface * @var string * @since 1.0.0 */ - private $selector = ''; + private string $selector = ''; /** * Dom content. @@ -49,7 +49,7 @@ class Dom implements \Serializable, ArrayableInterface * @var string * @since 1.0.0 */ - private $content = ''; + private string $content = ''; /** * Dom action. @@ -57,7 +57,7 @@ class Dom implements \Serializable, ArrayableInterface * @var int * @since 1.0.0 */ - private $action = DomAction::MODIFY; + private int $action = DomAction::MODIFY; /** * Delay in ms. @@ -65,7 +65,7 @@ class Dom implements \Serializable, ArrayableInterface * @var int * @since 1.0.0 */ - private $delay = 0; + private int $delay = 0; /** * Set DOM content diff --git a/Model/Message/FormValidation.php b/Model/Message/FormValidation.php index 813f2684e..741cf670d 100644 --- a/Model/Message/FormValidation.php +++ b/Model/Message/FormValidation.php @@ -41,7 +41,7 @@ class FormValidation implements \Serializable, ArrayableInterface, \JsonSerializ * @var array * @since 1.0.0 */ - private $validation = []; + private array $validation = []; /** * Constructor. diff --git a/Model/Message/Notify.php b/Model/Message/Notify.php index c0cac3e89..7e9cb9af3 100644 --- a/Model/Message/Notify.php +++ b/Model/Message/Notify.php @@ -41,7 +41,7 @@ class Notify implements \Serializable, ArrayableInterface, \JsonSerializable * @var string * @since 1.0.0 */ - private $title = ''; + private string $title = ''; /** * Message. @@ -49,7 +49,7 @@ class Notify implements \Serializable, ArrayableInterface, \JsonSerializable * @var string * @since 1.0.0 */ - private $message = ''; + private string $message = ''; /** * Delay in ms. @@ -57,7 +57,7 @@ class Notify implements \Serializable, ArrayableInterface, \JsonSerializable * @var int * @since 1.0.0 */ - private $delay = 0; + private int $delay = 0; /** * Stay in ms. @@ -65,7 +65,7 @@ class Notify implements \Serializable, ArrayableInterface, \JsonSerializable * @var int * @since 1.0.0 */ - private $stay = 0; + private int $stay = 0; /** * Level or type. @@ -73,7 +73,7 @@ class Notify implements \Serializable, ArrayableInterface, \JsonSerializable * @var int * @since 1.0.0 */ - private $level = NotifyType::INFO; + private int $level = NotifyType::INFO; /** * Constructor. diff --git a/Model/Message/Redirect.php b/Model/Message/Redirect.php index 81210db85..4b31c6631 100644 --- a/Model/Message/Redirect.php +++ b/Model/Message/Redirect.php @@ -41,7 +41,7 @@ class Redirect implements \Serializable, ArrayableInterface, \JsonSerializable * @var string * @since 1.0.0 */ - private $uri = ''; + private string $uri = ''; /** * Delay. @@ -49,7 +49,7 @@ class Redirect implements \Serializable, ArrayableInterface, \JsonSerializable * @var int * @since 1.0.0 */ - private $delay = 0; + private int $delay = 0; /** * Window. @@ -57,7 +57,7 @@ class Redirect implements \Serializable, ArrayableInterface, \JsonSerializable * @var bool * @since 1.0.0 */ - private $new = false; + private bool $new = false; /** * Constructor. diff --git a/Model/Message/Reload.php b/Model/Message/Reload.php index a173ede84..530cb6674 100644 --- a/Model/Message/Reload.php +++ b/Model/Message/Reload.php @@ -41,7 +41,7 @@ class Reload implements \Serializable, ArrayableInterface, \JsonSerializable * @var int * @since 1.0.0 */ - private $delay = 0; + private int $delay = 0; /** * Constructor. diff --git a/Module/InfoManager.php b/Module/InfoManager.php index 32d255dcc..a2e77167e 100644 --- a/Module/InfoManager.php +++ b/Module/InfoManager.php @@ -36,7 +36,7 @@ final class InfoManager * @var string * @since 1.0.0 */ - private $path = ''; + private string $path = ''; /** * Info data. @@ -44,7 +44,7 @@ final class InfoManager * @var array * @since 1.0.0 */ - private $info = []; + private array $info = []; /** * Object constructor. diff --git a/Module/ModuleAbstract.php b/Module/ModuleAbstract.php index b332be024..b6f3ba7c3 100644 --- a/Module/ModuleAbstract.php +++ b/Module/ModuleAbstract.php @@ -71,35 +71,39 @@ abstract class ModuleAbstract * @var string[] * @since 1.0.0 */ - protected static $providing = []; + protected static array $providing = []; + /** * Localization files. * * @var array * @since 1.0.0 */ - protected static $localization = []; + protected static array $localization = []; + /** * Dependencies. * * @var string[] * @since 1.0.0 */ - protected static $dependencies = []; + protected static array $dependencies = []; + /** * Receiving modules from? * * @var string[] * @since 1.0.0 */ - protected $receiving = []; + protected array $receiving = []; + /** * Application instance. * - * @var null|\phpOMS\ApplicationAbstract + * @var null|ApplicationAbstract * @since 1.0.0 */ - protected $app = null; + protected ?ApplicationAbstract $app = null; /** * Constructor. diff --git a/Module/ModuleManager.php b/Module/ModuleManager.php index 4768d364f..9e941f522 100644 --- a/Module/ModuleManager.php +++ b/Module/ModuleManager.php @@ -41,7 +41,7 @@ final class ModuleManager * @var \phpOMS\Module\ModuleAbstract[] * @since 1.0.0 */ - private $running = []; + private array $running = []; /** * All modules another module is providing for. @@ -51,15 +51,15 @@ final class ModuleManager * @var array> * @since 1.0.0 */ - private $providing = []; + private array $providing = []; /** * Application instance. * - * @var ApplicationAbstract + * @var null|ApplicationAbstract * @since 1.0.0 */ - private $app = null; + private ?ApplicationAbstract $app = null; /** * Installed modules. @@ -67,7 +67,7 @@ final class ModuleManager * @var array * @since 1.0.0 */ - private $installed = []; + private array $installed = []; /** * All active modules (on all pages not just the ones that are running now). @@ -75,7 +75,7 @@ final class ModuleManager * @var array * @since 1.0.0 */ - private $active = []; + private array $active = []; /** * Module path. @@ -83,7 +83,7 @@ final class ModuleManager * @var string * @since 1.0.0 */ - private $modulePath = __DIR__ . '/../../Modules'; + private string $modulePath = __DIR__ . '/../../Modules'; /** * All modules in the module directory. @@ -91,7 +91,7 @@ final class ModuleManager * @var array * @since 1.0.0 */ - private $all = []; + private array $all = []; /** * To load based on request uri. @@ -99,7 +99,7 @@ final class ModuleManager * @var array * @since 1.0.0 */ - private $uriLoad = null; + private array $uriLoad = []; /** * Constructor. @@ -149,7 +149,7 @@ final class ModuleManager */ public function getUriLoad(RequestAbstract $request) : array { - if ($this->uriLoad === null) { + if (empty($this->uriLoad)) { $uriHash = $request->getHash(); $query = new Builder($this->app->dbPool->get('select')); diff --git a/Module/PackageManager.php b/Module/PackageManager.php index 6718ca58d..31fe0b5f1 100644 --- a/Module/PackageManager.php +++ b/Module/PackageManager.php @@ -39,7 +39,7 @@ final class PackageManager * @var string * @since 1.0.0 */ - private $path = ''; + private string $path = ''; /** * Base path. @@ -47,7 +47,7 @@ final class PackageManager * @var string * @since 1.0.0 */ - private $basePath = ''; + private string $basePath = ''; /** * Extract path. @@ -55,7 +55,7 @@ final class PackageManager * @var string * @since 1.0.0 */ - private $extractPath = ''; + private string $extractPath = ''; /** * Public key. @@ -63,7 +63,7 @@ final class PackageManager * @var string * @since 1.0.0 */ - private $publicKey = ''; + private string $publicKey = ''; /** * Info data. @@ -71,7 +71,7 @@ final class PackageManager * @var array * @since 1.0.0 */ - private $info = []; + private array $info = []; /** * Constructor. diff --git a/Router/Router.php b/Router/Router.php index e7a386e30..d4c78d4fa 100644 --- a/Router/Router.php +++ b/Router/Router.php @@ -34,7 +34,7 @@ final class Router * @var array * @since 1.0.0 */ - private $routes = []; + private array $routes = []; /** * Add routes from file. diff --git a/Security/PhpCode.php b/Security/PhpCode.php index 6ce8e1d0e..8b7ed3a17 100644 --- a/Security/PhpCode.php +++ b/Security/PhpCode.php @@ -33,7 +33,7 @@ final class PhpCode * @var array * @since 1.0.0 */ - public static $disabledFunctions = [ + public static array $disabledFunctions = [ 'apache_child_terminate', 'apache_setenv', 'define_syslog_variables', 'escapeshellarg', 'escapeshellcmd', 'eval', 'exec', 'fp', 'fput', 'ftp_connect', 'ftp_exec', 'ftp_get', 'ftp_login', 'ftp_nb_fput', 'ftp_put', 'ftp_raw', 'ftp_rawlist', 'highlight_file', 'ini_alter', 'ini_get_all', 'ini_restore', 'inject_code', 'mysql_pconnect', @@ -48,7 +48,7 @@ final class PhpCode * @var array * @since 1.0.0 */ - public static $deprecatedFunctions = [ + public static array $deprecatedFunctions = [ 'apache_child_terminate', 'apache_setenv', 'define_syslog_variables', 'escapeshellarg', 'escapeshellcmd', 'eval', 'exec', 'fp', 'fput', 'ftp_connect', 'ftp_exec', 'ftp_get', 'ftp_login', 'ftp_nb_fput', 'ftp_put', 'ftp_raw', 'ftp_rawlist', 'highlight_file', 'ini_alter', 'ini_get_all', 'ini_restore', 'inject_code', 'mysql_pconnect', diff --git a/Stdlib/Base/Address.php b/Stdlib/Base/Address.php index 110716bcc..8682685a6 100644 --- a/Stdlib/Base/Address.php +++ b/Stdlib/Base/Address.php @@ -31,7 +31,7 @@ class Address implements \JsonSerializable * @var string * @since 1.0.0 */ - private $recipient = ''; + private string $recipient = ''; /** * Sub of the address. @@ -39,7 +39,7 @@ class Address implements \JsonSerializable * @var string * @since 1.0.0 */ - private $fao = ''; + private string $fao = ''; /** * Location. @@ -47,7 +47,7 @@ class Address implements \JsonSerializable * @var Location * @since 1.0.0 */ - private $location = null; + private Location $location = null; /** * Constructor. diff --git a/Stdlib/Base/EnumArray.php b/Stdlib/Base/EnumArray.php index 0ff3af511..7bd4e6e2c 100644 --- a/Stdlib/Base/EnumArray.php +++ b/Stdlib/Base/EnumArray.php @@ -32,7 +32,7 @@ abstract class EnumArray * @var array * @since 1.0.0 */ - protected static $constants = []; + protected static array $constants = []; /** * Checking enum name. diff --git a/Stdlib/Base/Iban.php b/Stdlib/Base/Iban.php index 0452ec8a4..4d1a5a828 100644 --- a/Stdlib/Base/Iban.php +++ b/Stdlib/Base/Iban.php @@ -32,7 +32,7 @@ class Iban implements \Serializable * @var string * @since 1.0.0 */ - private $iban = ''; + private string $iban = ''; /** * Constructor. diff --git a/Stdlib/Base/Location.php b/Stdlib/Base/Location.php index 52073dd13..219ced3b0 100644 --- a/Stdlib/Base/Location.php +++ b/Stdlib/Base/Location.php @@ -31,7 +31,7 @@ class Location implements \JsonSerializable, \Serializable * @var int * @since 1.0.0 */ - private $id = 0; + private int $id = 0; /** * Zip or postal. @@ -39,7 +39,7 @@ class Location implements \JsonSerializable, \Serializable * @var string * @since 1.0.0 */ - private $postal = ''; + private string $postal = ''; /** * Name of city. @@ -47,7 +47,7 @@ class Location implements \JsonSerializable, \Serializable * @var string * @since 1.0.0 */ - private $city = ''; + private string $city = ''; /** * Name of the country. @@ -55,7 +55,7 @@ class Location implements \JsonSerializable, \Serializable * @var string * @since 1.0.0 */ - private $country = ''; + private string $country = ''; /** * Street & district. @@ -63,7 +63,7 @@ class Location implements \JsonSerializable, \Serializable * @var string * @since 1.0.0 */ - private $address = ''; + private string $address = ''; /** * Address type @@ -71,7 +71,7 @@ class Location implements \JsonSerializable, \Serializable * @var int * @since 1.0.0 */ - private $type = AddressType::HOME; + private int $type = AddressType::HOME; /** * State. @@ -79,7 +79,7 @@ class Location implements \JsonSerializable, \Serializable * @var string * @since 1.0.0 */ - private $state = ''; + private string $state = ''; /** * Geo coordinates. @@ -87,7 +87,7 @@ class Location implements \JsonSerializable, \Serializable * @var float[] * @since 1.0.0 */ - private $geo = ['lat' => 0, 'long' => 0]; + private array $geo = ['lat' => 0, 'long' => 0]; /** * Constructor. diff --git a/Stdlib/Map/MultiMap.php b/Stdlib/Map/MultiMap.php index 4be540193..7e39db7b2 100644 --- a/Stdlib/Map/MultiMap.php +++ b/Stdlib/Map/MultiMap.php @@ -33,7 +33,7 @@ class MultiMap implements \Countable * @var array * @since 1.0.0 */ - private $values = []; + private array $values = []; /** * Associated keys for values. @@ -41,7 +41,7 @@ class MultiMap implements \Countable * @var array * @since 1.0.0 */ - private $keys = []; + private array $keys = []; /** * Key type. @@ -49,7 +49,7 @@ class MultiMap implements \Countable * @var int * @since 1.0.0 */ - private $keyType = KeyType::SINGLE; + private int $keyType = KeyType::SINGLE; /** * Order type. @@ -57,7 +57,7 @@ class MultiMap implements \Countable * @var int * @since 1.0.0 */ - private $orderType = OrderType::LOOSE; + private int $orderType = OrderType::LOOSE; /** * Constructor. diff --git a/Stdlib/Queue/PriorityQueue.php b/Stdlib/Queue/PriorityQueue.php index 7f7fa09bc..1e3d54760 100644 --- a/Stdlib/Queue/PriorityQueue.php +++ b/Stdlib/Queue/PriorityQueue.php @@ -32,7 +32,7 @@ class PriorityQueue implements \Countable, \Serializable * @var int * @since 1.0.0 */ - private $type = PriorityMode::FIFO; + private int $type = PriorityMode::FIFO; /** * Queue. @@ -40,7 +40,7 @@ class PriorityQueue implements \Countable, \Serializable * @var array * @since 1.0.0 */ - private $queue = []; + private array $queue = []; /** * Constructor. diff --git a/System/File/Ftp/Directory.php b/System/File/Ftp/Directory.php index dcdbc81f2..402f94e2a 100644 --- a/System/File/Ftp/Directory.php +++ b/System/File/Ftp/Directory.php @@ -39,7 +39,7 @@ class Directory extends FileAbstract implements FtpContainerInterface, Directory * @var FileAbstract[] * @since 1.0.0 */ - private $nodes = []; + private array $nodes = []; /** * Create ftp connection. diff --git a/System/File/Ftp/File.php b/System/File/Ftp/File.php index b4e58904d..203a5a53b 100644 --- a/System/File/Ftp/File.php +++ b/System/File/Ftp/File.php @@ -47,10 +47,10 @@ class File extends FileAbstract implements FileInterface /** * Ftp connection uri. * - * @var Http + * @var null|Http * @since 1.0.0 */ - private $uri = null; + private ?Http $uri = null; public function __construct(string $path) { diff --git a/System/File/Ftp/FileAbstract.php b/System/File/Ftp/FileAbstract.php index d74ba2f28..5732e30d5 100644 --- a/System/File/Ftp/FileAbstract.php +++ b/System/File/Ftp/FileAbstract.php @@ -34,7 +34,7 @@ abstract class FileAbstract implements ContainerInterface * @var string * @since 1.0.0 */ - protected $path = ''; + protected string $path = ''; /** * Name. @@ -42,7 +42,7 @@ abstract class FileAbstract implements ContainerInterface * @var string * @since 1.0.0 */ - protected $name = 'new_directory'; + protected string $name = 'new_directory'; /** * Directory/File count. @@ -50,7 +50,7 @@ abstract class FileAbstract implements ContainerInterface * @var int * @since 1.0.0 */ - protected $count = 0; + protected int $count = 0; /** * Directory/Filesize in bytes. @@ -58,23 +58,23 @@ abstract class FileAbstract implements ContainerInterface * @var int * @since 1.0.0 */ - protected $size = 0; + protected int $size = 0; /** * Created at. * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ - protected $createdAt = null; + protected ?\DateTime $createdAt = null; /** * Last changed at. * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ - protected $changedAt = null; + protected ?\DateTime $changedAt = null; /** * Owner. @@ -82,7 +82,7 @@ abstract class FileAbstract implements ContainerInterface * @var int * @since 1.0.0 */ - protected $owner = 0; + protected int $owner = 0; /** * Permission. @@ -90,7 +90,7 @@ abstract class FileAbstract implements ContainerInterface * @var int * @since 1.0.0 */ - protected $permission = 0755; + protected int $permission = 0755; /** * Constructor. diff --git a/System/File/Ftp/FtpStorage.php b/System/File/Ftp/FtpStorage.php index 328cdd469..802c4aca8 100644 --- a/System/File/Ftp/FtpStorage.php +++ b/System/File/Ftp/FtpStorage.php @@ -30,7 +30,7 @@ use phpOMS\System\File\StorageAbstract; */ class FtpStorage extends StorageAbstract { - private static $instance = null; + private static ?self $instance = null; public function __construct() { diff --git a/System/File/Local/Directory.php b/System/File/Local/Directory.php index a75fa919b..6d7a90d9f 100644 --- a/System/File/Local/Directory.php +++ b/System/File/Local/Directory.php @@ -37,7 +37,7 @@ final class Directory extends FileAbstract implements LocalContainerInterface, D * @var string * @since 1.0.0 */ - private $filter = '*'; + private string $filter = '*'; /** * Directory nodes (files and directories). @@ -45,7 +45,7 @@ final class Directory extends FileAbstract implements LocalContainerInterface, D * @var FileAbstract[] * @since 1.0.0 */ - private $nodes = []; + private array $nodes = []; /** * Constructor. diff --git a/System/File/Local/FileAbstract.php b/System/File/Local/FileAbstract.php index 8449bfcd1..5bdafd7e1 100644 --- a/System/File/Local/FileAbstract.php +++ b/System/File/Local/FileAbstract.php @@ -34,7 +34,7 @@ abstract class FileAbstract implements ContainerInterface * @var string * @since 1.0.0 */ - protected $path = ''; + protected string $path = ''; /** * Name. @@ -42,7 +42,7 @@ abstract class FileAbstract implements ContainerInterface * @var string * @since 1.0.0 */ - protected $name = 'new_directory'; + protected string $name = 'new_directory'; /** * Directory/File count. @@ -50,7 +50,7 @@ abstract class FileAbstract implements ContainerInterface * @var int * @since 1.0.0 */ - protected $count = 0; + protected int $count = 0; /** * Directory/Filesize in bytes. @@ -58,23 +58,23 @@ abstract class FileAbstract implements ContainerInterface * @var int * @since 1.0.0 */ - protected $size = 0; + protected int $size = 0; /** * Created at. * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ - protected $createdAt = null; + protected ?\DateTime $createdAt = null; /** * Last changed at. * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ - protected $changedAt = null; + protected ?\DateTime $changedAt = null; /** * Owner. @@ -82,7 +82,7 @@ abstract class FileAbstract implements ContainerInterface * @var int * @since 1.0.0 */ - protected $owner = 0; + protected int $owner = 0; /** * Permission. @@ -90,7 +90,7 @@ abstract class FileAbstract implements ContainerInterface * @var int * @since 1.0.0 */ - protected $permission = 0755; + protected int $permission = 0755; /** * Constructor. diff --git a/System/File/Local/LocalStorage.php b/System/File/Local/LocalStorage.php index cda290b7b..5a5b1b20a 100644 --- a/System/File/Local/LocalStorage.php +++ b/System/File/Local/LocalStorage.php @@ -35,7 +35,7 @@ class LocalStorage extends StorageAbstract * @var LocalStorage * @since 1.0.0 */ - private static $instance = null; + private static ?self $instance = null; /** * Get instance. diff --git a/System/File/Storage.php b/System/File/Storage.php index 00d6bdc21..54527a2c2 100644 --- a/System/File/Storage.php +++ b/System/File/Storage.php @@ -32,7 +32,7 @@ final class Storage * @var array * @since 1.0.0 */ - private static $registered = []; + private static array $registered = []; /** * Constructor. diff --git a/System/File/StorageAbstract.php b/System/File/StorageAbstract.php index a66843f6d..920b82ca9 100644 --- a/System/File/StorageAbstract.php +++ b/System/File/StorageAbstract.php @@ -32,7 +32,7 @@ abstract class StorageAbstract * @var int * @since 1.0.0 */ - protected $type = 0; + protected int $type = 0; /** * Get instance. diff --git a/Uri/Argument.php b/Uri/Argument.php index df08efcd4..b4a1d3843 100644 --- a/Uri/Argument.php +++ b/Uri/Argument.php @@ -37,7 +37,7 @@ final class Argument implements UriInterface * @var string * @since 1.0.0 */ - private $rootPath = '/'; + private string $rootPath = '/'; /** * Path offset. @@ -45,7 +45,7 @@ final class Argument implements UriInterface * @var int * @since 1.0.0 */ - private $pathOffset = 0; + private int $pathOffset = 0; /** * Path elements. @@ -53,7 +53,7 @@ final class Argument implements UriInterface * @var array * @since 1.0.0 */ - private $pathElements = []; + private array $pathElements = []; /** * Uri. @@ -61,7 +61,7 @@ final class Argument implements UriInterface * @var string * @since 1.0.0 */ - private $uri = ''; + private string $uri = ''; /** * Uri scheme. @@ -69,7 +69,7 @@ final class Argument implements UriInterface * @var string * @since 1.0.0 */ - private $scheme = ''; + private string $scheme = ''; /** * Uri host. @@ -77,7 +77,7 @@ final class Argument implements UriInterface * @var string * @since 1.0.0 */ - private $host = ''; + private string $host = ''; /** * Uri port. @@ -85,7 +85,7 @@ final class Argument implements UriInterface * @var int * @since 1.0.0 */ - private $port = 0; + private int $port = 0; /** * Uri user. @@ -93,7 +93,7 @@ final class Argument implements UriInterface * @var string * @since 1.0.0 */ - private $user = ''; + private string $user = ''; /** * Uri password. @@ -101,7 +101,7 @@ final class Argument implements UriInterface * @var string * @since 1.0.0 */ - private $pass = ''; + private string $pass = ''; /** * Uri path. @@ -109,7 +109,7 @@ final class Argument implements UriInterface * @var string * @since 1.0.0 */ - private $path = ''; + private string $path = ''; /** * Uri query. @@ -117,7 +117,7 @@ final class Argument implements UriInterface * @var array * @since 1.0.0 */ - private $query = []; + private array $query = []; /** * Uri query. @@ -125,7 +125,7 @@ final class Argument implements UriInterface * @var string * @since 1.0.0 */ - private $queryString = ''; + private string $queryString = ''; /** * Uri fragment. @@ -133,7 +133,7 @@ final class Argument implements UriInterface * @var string * @since 1.0.0 */ - private $fragment = ''; + private string $fragment = ''; /** * Uri base. @@ -141,7 +141,7 @@ final class Argument implements UriInterface * @var string * @since 1.0.0 */ - private $base = ''; + private string $base = ''; /** * Constructor. diff --git a/Uri/Http.php b/Uri/Http.php index e8532afcb..dff23de2b 100644 --- a/Uri/Http.php +++ b/Uri/Http.php @@ -37,7 +37,7 @@ final class Http implements UriInterface * @var string * @since 1.0.0 */ - private $rootPath = ''; + private string $rootPath = ''; /** * Path offset. @@ -45,7 +45,7 @@ final class Http implements UriInterface * @var int * @since 1.0.0 */ - private $pathOffset = 0; + private int $pathOffset = 0; /** * Path elements. @@ -53,7 +53,7 @@ final class Http implements UriInterface * @var array * @since 1.0.0 */ - private $pathElements = []; + private array $pathElements = []; /** * Uri. @@ -61,7 +61,7 @@ final class Http implements UriInterface * @var string * @since 1.0.0 */ - private $uri = ''; + private string $uri = ''; /** * Uri scheme. @@ -69,7 +69,7 @@ final class Http implements UriInterface * @var string * @since 1.0.0 */ - private $scheme = ''; + private string $scheme = ''; /** * Uri host. @@ -77,7 +77,7 @@ final class Http implements UriInterface * @var string * @since 1.0.0 */ - private $host = ''; + private string $host = ''; /** * Uri port. @@ -85,7 +85,7 @@ final class Http implements UriInterface * @var int * @since 1.0.0 */ - private $port = 80; + private int $port = 80; /** * Uri user. @@ -93,7 +93,7 @@ final class Http implements UriInterface * @var string * @since 1.0.0 */ - private $user = ''; + private string $user = ''; /** * Uri password. @@ -101,7 +101,7 @@ final class Http implements UriInterface * @var string * @since 1.0.0 */ - private $pass = ''; + private string $pass = ''; /** * Uri path. @@ -109,7 +109,7 @@ final class Http implements UriInterface * @var string * @since 1.0.0 */ - private $path = ''; + private string $path = ''; /** * Uri query. @@ -117,7 +117,7 @@ final class Http implements UriInterface * @var array * @since 1.0.0 */ - private $query = []; + private array $query = []; /** * Uri query. @@ -125,7 +125,7 @@ final class Http implements UriInterface * @var string * @since 1.0.0 */ - private $queryString = ''; + private string $queryString = ''; /** * Uri fragment. @@ -133,7 +133,7 @@ final class Http implements UriInterface * @var string * @since 1.0.0 */ - private $fragment = ''; + private string $fragment = ''; /** * Uri base. @@ -141,7 +141,7 @@ final class Http implements UriInterface * @var string * @since 1.0.0 */ - private $base = ''; + private string $base = ''; /** * Constructor. diff --git a/Uri/UriFactory.php b/Uri/UriFactory.php index 9a1d652d3..4293c53cf 100644 --- a/Uri/UriFactory.php +++ b/Uri/UriFactory.php @@ -33,7 +33,7 @@ final class UriFactory * @var string[] * @since 1.0.0 */ - private static $uri = []; + private static array $uri = []; /** * Constructor. diff --git a/Utils/Barcode/C128Abstract.php b/Utils/Barcode/C128Abstract.php index 54edf33ad..4755c03be 100644 --- a/Utils/Barcode/C128Abstract.php +++ b/Utils/Barcode/C128Abstract.php @@ -35,7 +35,7 @@ abstract class C128Abstract * @var int * @since 1.0.0 */ - protected static $CHECKSUM = 0; + protected static int $CHECKSUM = 0; /** * Char weighted array. @@ -43,7 +43,7 @@ abstract class C128Abstract * @var string[] * @since 1.0.0 */ - protected static $CODEARRAY = []; + protected static array $CODEARRAY = []; /** * Code start. @@ -51,7 +51,7 @@ abstract class C128Abstract * @var string * @since 1.0.0 */ - protected static $CODE_START = ''; + protected static string $CODE_START = ''; /** * Code end. @@ -59,7 +59,7 @@ abstract class C128Abstract * @var string * @since 1.0.0 */ - protected static $CODE_END = ''; + protected static string $CODE_END = ''; /** * Orientation. @@ -67,7 +67,7 @@ abstract class C128Abstract * @var int * @since 1.0.0 */ - protected $orientation = 0; + protected int $orientation = 0; /** * Barcode dimension. @@ -75,7 +75,7 @@ abstract class C128Abstract * @var int[] * @since 1.0.0 */ - protected $dimension = ['width' => 0, 'height' => 0]; + protected array $dimension = ['width' => 0, 'height' => 0]; /** * Barcode dimension. @@ -83,7 +83,7 @@ abstract class C128Abstract * @var int * @since 1.0.0 */ - protected $margin = 10; + protected int $margin = 10; /** * Content to encrypt. @@ -91,7 +91,7 @@ abstract class C128Abstract * @var string * @since 1.0.0 */ - protected $content = ''; + protected string $content = ''; /** * Show text below barcode. @@ -99,7 +99,7 @@ abstract class C128Abstract * @var bool * @since 1.0.0 */ - protected $showText = true; + protected bool $showText = true; /** * Background color. @@ -107,7 +107,7 @@ abstract class C128Abstract * @var int[] * @since 1.0.0 */ - protected $background = ['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]; + protected array $background = ['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]; /** * Front color. @@ -115,7 +115,7 @@ abstract class C128Abstract * @var int[] * @since 1.0.0 */ - protected $front = ['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]; + protected array $front = ['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]; /** * Constructor diff --git a/Utils/Barcode/C128a.php b/Utils/Barcode/C128a.php index a8dfdd037..817015d7c 100644 --- a/Utils/Barcode/C128a.php +++ b/Utils/Barcode/C128a.php @@ -41,7 +41,7 @@ class C128a extends C128Abstract * @var string[] * @since 1.0.0 */ - protected static $CODEARRAY = [ + protected static array $CODEARRAY = [ ' ' => '212222', '!' => '222122', '"' => '222221', '#' => '121223', '$' => '121322', '%' => '131222', '&' => '122213', '\'' => '122312', '(' => '132212', ')' => '221213', '*' => '221312', '+' => '231212', ',' => '112232', '-' => '122132', '.' => '122231', '/' => '113222', '0' => '123122', '1' => '123221', @@ -70,7 +70,7 @@ class C128a extends C128Abstract * @var string * @since 1.0.0 */ - protected static $CODE_START = '211412'; + protected static string $CODE_START = '211412'; /** * Code end. @@ -78,7 +78,7 @@ class C128a extends C128Abstract * @var string * @since 1.0.0 */ - protected static $CODE_END = '2331112'; + protected static string $CODE_END = '2331112'; /** * {@inheritdoc} diff --git a/Utils/Barcode/C128b.php b/Utils/Barcode/C128b.php index 098e95b39..6ea9647c3 100644 --- a/Utils/Barcode/C128b.php +++ b/Utils/Barcode/C128b.php @@ -41,7 +41,7 @@ class C128b extends C128Abstract * @var string[] * @since 1.0.0 */ - protected static $CODEARRAY = [ + protected static array $CODEARRAY = [ ' ' => '212222', '!' => '222122', '"' => '222221', '#' => '121223', '$' => '121322', '%' => '131222', '&' => '122213', '\'' => '122312', '(' => '132212', ')' => '221213', '*' => '221312', '+' => '231212', ',' => '112232', '-' => '122132', '.' => '122231', '/' => '113222', '0' => '123122', '1' => '123221', @@ -69,7 +69,7 @@ class C128b extends C128Abstract * @var string * @since 1.0.0 */ - protected static $CODE_START = '211214'; + protected static string $CODE_START = '211214'; /** * Code end. @@ -77,5 +77,5 @@ class C128b extends C128Abstract * @var string * @since 1.0.0 */ - protected static $CODE_END = '2331112'; + protected static string $CODE_END = '2331112'; } diff --git a/Utils/Barcode/C128c.php b/Utils/Barcode/C128c.php index 5dc92d113..8a9394ce2 100644 --- a/Utils/Barcode/C128c.php +++ b/Utils/Barcode/C128c.php @@ -41,7 +41,7 @@ class C128c extends C128Abstract * @var string[] * @since 1.0.0 */ - protected static $CODEARRAY = [ + protected static array $CODEARRAY = [ '00' => '212222', '01' => '222122', '02' => '222221', '03' => '121223', '04' => '121322', '05' => '131222', '06' => '122213', '07' => '122312', '08' => '132212', '09' => '221213', '10' => '221312', '11' => '231212', '12' => '112232', '13' => '122132', '14' => '122231', '15' => '113222', '16' => '123122', '17' => '123221', @@ -69,7 +69,7 @@ class C128c extends C128Abstract * @var string * @since 1.0.0 */ - protected static $CODE_START = '211232'; + protected static string $CODE_START = '211232'; /** * Code end. @@ -77,7 +77,7 @@ class C128c extends C128Abstract * @var string * @since 1.0.0 */ - protected static $CODE_END = '2331112'; + protected static string $CODE_END = '2331112'; /** * {@inheritdoc} diff --git a/Utils/Barcode/C25.php b/Utils/Barcode/C25.php index 7140f9767..88898d3d7 100644 --- a/Utils/Barcode/C25.php +++ b/Utils/Barcode/C25.php @@ -33,7 +33,7 @@ class C25 extends C128Abstract * @var string[] * @since 1.0.0 */ - protected static $CODEARRAY = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']; + protected static array $CODEARRAY = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']; /** * Char weighted array. @@ -41,7 +41,7 @@ class C25 extends C128Abstract * @var string[] * @since 1.0.0 */ - protected static $CODEARRAY2 = [ + protected static array $CODEARRAY2 = [ '3-1-1-1-3', '1-3-1-1-3', '3-3-1-1-1', '1-1-3-1-3', '3-1-3-1-1', '1-3-3-1-1', '1-1-1-3-3', '3-1-1-3-1', '1-3-1-3-1', '1-1-3-3-1', ]; @@ -52,7 +52,7 @@ class C25 extends C128Abstract * @var string * @since 1.0.0 */ - protected static $CODE_START = '1111'; + protected static string $CODE_START = '1111'; /** * Code end. @@ -60,7 +60,7 @@ class C25 extends C128Abstract * @var string * @since 1.0.0 */ - protected static $CODE_END = '311'; + protected static string $CODE_END = '311'; /** * Set content to encrypt diff --git a/Utils/Barcode/C39.php b/Utils/Barcode/C39.php index 1856442f2..90005c570 100644 --- a/Utils/Barcode/C39.php +++ b/Utils/Barcode/C39.php @@ -33,7 +33,7 @@ class C39 extends C128Abstract * @var string[] * @since 1.0.0 */ - protected static $CODEARRAY = [ + protected static array $CODEARRAY = [ '0' => '111221211', '1' => '211211112', '2' => '112211112', '3' => '212211111', '4' => '111221112', '5' => '211221111', '6' => '112221111', '7' => '111211212', '8' => '211211211', '9' => '112211211', 'A' => '211112112', 'B' => '112112112', 'C' => '212112111', 'D' => '111122112', 'E' => '211122111', @@ -51,7 +51,7 @@ class C39 extends C128Abstract * @var string * @since 1.0.0 */ - protected static $CODE_START = '1211212111'; + protected static string $CODE_START = '1211212111'; /** * Code end. @@ -59,7 +59,7 @@ class C39 extends C128Abstract * @var string * @since 1.0.0 */ - protected static $CODE_END = '121121211'; + protected static string $CODE_END = '121121211'; /** * {@inheritdoc} diff --git a/Utils/Barcode/Codebar.php b/Utils/Barcode/Codebar.php index e379079e1..a2f6e5701 100644 --- a/Utils/Barcode/Codebar.php +++ b/Utils/Barcode/Codebar.php @@ -33,7 +33,7 @@ class Codebar extends C128Abstract * @var string[] * @since 1.0.0 */ - protected static $CODEARRAY = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '$', ':', '/', '.', '+', 'A', 'B', 'C', 'D']; + protected static array $CODEARRAY = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '$', ':', '/', '.', '+', 'A', 'B', 'C', 'D']; /** * Char weighted array. @@ -41,7 +41,7 @@ class Codebar extends C128Abstract * @var string[] * @since 1.0.0 */ - protected static $CODEARRAY2 = [ + protected static array $CODEARRAY2 = [ '1111221', '1112112', '2211111', '1121121', '2111121', '1211112', '1211211', '1221111', '2112111', '1111122', '1112211', '1122111', '2111212', '2121112', '2121211', '1121212', '1122121', '1212112', '1112122', '1112221', ]; @@ -52,7 +52,7 @@ class Codebar extends C128Abstract * @var string * @since 1.0.0 */ - protected static $CODE_START = '11221211'; + protected static string $CODE_START = '11221211'; /** * Code end. @@ -60,7 +60,7 @@ class Codebar extends C128Abstract * @var string * @since 1.0.0 */ - protected static $CODE_END = '1122121'; + protected static string $CODE_END = '1122121'; /** * {@inheritdoc} diff --git a/Utils/Converter/Currency.php b/Utils/Converter/Currency.php index f35fb3492..9873d24ef 100644 --- a/Utils/Converter/Currency.php +++ b/Utils/Converter/Currency.php @@ -37,7 +37,7 @@ class Currency * @var null|array * @since 1.0.0 */ - private static $ecbCurrencies = null; + private static ?array $ecbCurrencies = null; /** * Constructor. diff --git a/Utils/Encoding/Huffman/Dictionary.php b/Utils/Encoding/Huffman/Dictionary.php index acaef6c7f..d9a1826c8 100644 --- a/Utils/Encoding/Huffman/Dictionary.php +++ b/Utils/Encoding/Huffman/Dictionary.php @@ -30,7 +30,7 @@ final class Dictionary * @var array * @since 1.0.0 */ - private $dictionary = []; + private array $dictionary = []; /** * Minimum length. @@ -38,7 +38,7 @@ final class Dictionary * @var int * @since 1.0.0 */ - private $min = -1; + private int $min = -1; /** * Maximum length. @@ -46,7 +46,7 @@ final class Dictionary * @var int * @since 1.0.0 */ - private $max = -1; + private int $max = -1; /** * Constructor. diff --git a/Utils/Encoding/Huffman/Huffman.php b/Utils/Encoding/Huffman/Huffman.php index 85260a615..ded8b2513 100644 --- a/Utils/Encoding/Huffman/Huffman.php +++ b/Utils/Encoding/Huffman/Huffman.php @@ -27,10 +27,10 @@ final class Huffman /** * Huffman dictionary. * - * @var Dictionary + * @var null|Dictionary * @since 1.0.0 */ - private $dictionary = null; + private ?Dictionary $dictionary = null; /** * Get dictionary diff --git a/Utils/Git/Author.php b/Utils/Git/Author.php index ffe58cd8a..45ee5f56b 100644 --- a/Utils/Git/Author.php +++ b/Utils/Git/Author.php @@ -30,7 +30,7 @@ class Author * @var string * @since 1.0.0 */ - private $name = ''; + private string $name = ''; /** * Email. @@ -38,7 +38,7 @@ class Author * @var string * @since 1.0.0 */ - private $email = ''; + private string $email = ''; /** * Commit count. @@ -46,7 +46,7 @@ class Author * @var int * @since 1.0.0 */ - private $commitCount = 0; + private int $commitCount = 0; /** * Additions count. @@ -54,7 +54,7 @@ class Author * @var int * @since 1.0.0 */ - private $additionsCount = 0; + private int $additionsCount = 0; /** * Removals count. @@ -62,7 +62,7 @@ class Author * @var int * @since 1.0.0 */ - private $removalsCount = 0; + private int $removalsCount = 0; /** * Constructor diff --git a/Utils/Git/Branch.php b/Utils/Git/Branch.php index 53060b23a..82d3bc6b3 100644 --- a/Utils/Git/Branch.php +++ b/Utils/Git/Branch.php @@ -30,7 +30,7 @@ class Branch * @var string * @since 1.0.0 */ - private $name = ''; + private string $name = ''; /** * Constructor diff --git a/Utils/Git/Commit.php b/Utils/Git/Commit.php index c7923ee30..fa5f4e5fa 100644 --- a/Utils/Git/Commit.php +++ b/Utils/Git/Commit.php @@ -30,47 +30,47 @@ class Commit * @var string * @since 1.0.0 */ - private $id = ''; + private string $id = ''; /** * Author. * - * @var Author + * @var null|Author * @since 1.0.0 */ - private $author = null; + private ?Author $author = null; /** * Branch. * - * @var Branch + * @var null|Branch * @since 1.0.0 */ - private $branch = null; + private ?Branch $branch = null; /** * Tag. * - * @var Tag + * @var null|Tag * @since 1.0.0 */ - private $tag = null; + private ?Tag $tag = null; /** * Commit date. * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ - private $date = null; + private ?\DateTime $date = null; /** * Repository. * - * @var Repository + * @var null|Repository * @since 1.0.0 */ - private $repository = null; + private ?Repository $repository = null; /** * Commit message. @@ -78,7 +78,7 @@ class Commit * @var string * @since 1.0.0 */ - private $message = ''; + private string $message = ''; /** * Files. @@ -86,7 +86,7 @@ class Commit * @var array * @since 1.0.0 */ - private $files = []; + private array $files = []; /** * Constructor diff --git a/Utils/Git/Git.php b/Utils/Git/Git.php index c1251cc4d..765e61abd 100644 --- a/Utils/Git/Git.php +++ b/Utils/Git/Git.php @@ -33,7 +33,7 @@ class Git * @var string * @since 1.0.0 */ - protected static $bin = '/usr/bin/git'; + protected static string $bin = '/usr/bin/git'; /** * Test git. diff --git a/Utils/Git/Repository.php b/Utils/Git/Repository.php index 4db71218b..896055d48 100644 --- a/Utils/Git/Repository.php +++ b/Utils/Git/Repository.php @@ -34,7 +34,7 @@ class Repository * @var string * @since 1.0.0 */ - private $path = ''; + private string $path = ''; /** * Repository name. @@ -42,7 +42,7 @@ class Repository * @var string * @since 1.0.0 */ - private $name = ''; + private string $name = ''; /** * Bare repository. @@ -50,15 +50,15 @@ class Repository * @var bool * @since 1.0.0 */ - private $bare = false; + private bool $bare = false; /** * Current branch. * - * @var Branch + * @var null|Branch * @since 1.0.0 */ - private $branch = null; + private ?Branch $branch = null; /** * Constructor diff --git a/Utils/Git/Tag.php b/Utils/Git/Tag.php index 817e54f4d..1d4be3c18 100644 --- a/Utils/Git/Tag.php +++ b/Utils/Git/Tag.php @@ -30,7 +30,7 @@ class Tag * @var string * @since 1.0.0 */ - private $name = ''; + private string $name = ''; /** * Message. @@ -38,7 +38,7 @@ class Tag * @var string * @since 1.0.0 */ - private $message = ''; + private string $message = ''; /** * Constructor diff --git a/Utils/JsonBuilder.php b/Utils/JsonBuilder.php index 4e94cd830..48d11b7f6 100644 --- a/Utils/JsonBuilder.php +++ b/Utils/JsonBuilder.php @@ -31,7 +31,7 @@ final class JsonBuilder implements \Serializable, \JsonSerializable * @var array * @since 1.0.0 */ - private $json = []; + private array $json = []; /** * Get json data. diff --git a/Utils/StringCompare.php b/Utils/StringCompare.php index 149041ec1..188b18d4a 100644 --- a/Utils/StringCompare.php +++ b/Utils/StringCompare.php @@ -32,7 +32,7 @@ final class StringCompare * @var array * @since 1.0.0 */ - private $dictionary = []; + private array $dictionary = []; /** * Constructor. diff --git a/Utils/TaskSchedule/Interval.php b/Utils/TaskSchedule/Interval.php index 37a8d8c59..8c0083bca 100644 --- a/Utils/TaskSchedule/Interval.php +++ b/Utils/TaskSchedule/Interval.php @@ -28,7 +28,7 @@ class Interval implements \Serializable /** * Start. * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ private $start = null; @@ -36,7 +36,7 @@ class Interval implements \Serializable /** * End. * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ private $end = null; diff --git a/Utils/TaskSchedule/SchedulerAbstract.php b/Utils/TaskSchedule/SchedulerAbstract.php index 36c96da34..2ceb9e704 100644 --- a/Utils/TaskSchedule/SchedulerAbstract.php +++ b/Utils/TaskSchedule/SchedulerAbstract.php @@ -34,7 +34,7 @@ abstract class SchedulerAbstract * @var string * @since 1.0.0 */ - private static $bin = ''; + private static string $bin = ''; /** * Get git binary. diff --git a/Utils/TaskSchedule/TaskAbstract.php b/Utils/TaskSchedule/TaskAbstract.php index baec3239d..1464f1970 100644 --- a/Utils/TaskSchedule/TaskAbstract.php +++ b/Utils/TaskSchedule/TaskAbstract.php @@ -30,7 +30,7 @@ abstract class TaskAbstract * @var string * @since 1.0.0 */ - protected $id = ''; + protected string $id = ''; /** * Command used for creating the task @@ -38,7 +38,7 @@ abstract class TaskAbstract * @var string * @since 1.0.0 */ - protected $command = ''; + protected string $command = ''; /** * Run interval @@ -46,7 +46,7 @@ abstract class TaskAbstract * @var string * @since 1.0.0 */ - protected $interval = ''; + protected string $interval = ''; /** * Status of the task @@ -54,34 +54,31 @@ abstract class TaskAbstract * @var string * @since 1.0.0 */ - protected $status = ''; + protected string $status = ''; /** * Next runtime * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ - protected $nextRunTime = null; + protected ?\DateTime $nextRunTime = null; /** * Last runtime * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ - protected $lastRunTime = null; + protected ?\DateTime $lastRunTime = null; /** * Comment * - * @param string $name Name of the task - * @param string $cmd Command/script to run - * * @var string * @since 1.0.0 */ - protected $comment = ''; + protected string $comment = ''; /** * Constructor diff --git a/Validation/ValidatorAbstract.php b/Validation/ValidatorAbstract.php index 52feda99f..010e25441 100644 --- a/Validation/ValidatorAbstract.php +++ b/Validation/ValidatorAbstract.php @@ -31,7 +31,7 @@ abstract class ValidatorAbstract implements ValidatorInterface * @var int * @since 1.0.0 */ - protected static $error = 0; + protected static int $error = 0; /** * Message string. @@ -39,7 +39,7 @@ abstract class ValidatorAbstract implements ValidatorInterface * @var string * @since 1.0.0 */ - protected static $msg = ''; + protected static string $msg = ''; /** * {@inheritdoc} diff --git a/Views/PaginationView.php b/Views/PaginationView.php index 43a8f0fc3..38253464b 100644 --- a/Views/PaginationView.php +++ b/Views/PaginationView.php @@ -29,7 +29,7 @@ class PaginationView extends View * @var int * @since 1.0.0 */ - protected $maxPages = 7; + protected int $maxPages = 7; /** * Current page id. @@ -37,7 +37,7 @@ class PaginationView extends View * @var int * @since 1.0.0 */ - protected $page = 1; + protected int $page = 1; /** * How many pages exists? @@ -45,7 +45,7 @@ class PaginationView extends View * @var int * @since 1.0.0 */ - protected $pages = 1; + protected int $pages = 1; /** * How many results exists? @@ -53,7 +53,7 @@ class PaginationView extends View * @var int * @since 1.0.0 */ - protected $results = 0; + protected int $results = 0; /** * @return int diff --git a/Views/View.php b/Views/View.php index a18eefbe0..1a94e682b 100644 --- a/Views/View.php +++ b/Views/View.php @@ -37,15 +37,15 @@ class View extends ViewAbstract * @var array * @since 1.0.0 */ - protected $data = []; + protected array $data = []; /** * View Localization. * - * @var Localization + * @var null|Localization * @since 1.0.0 */ - protected $l11n = null; + protected ?Localization $l11n = null; /** * Application. @@ -53,7 +53,7 @@ class View extends ViewAbstract * @var null|ApplicationAbstract * @since 1.0.0 */ - protected $app = null; + protected ?ApplicationAbstract $app = null; /** * Request. @@ -61,7 +61,7 @@ class View extends ViewAbstract * @var null|RequestAbstract * @since 1.0.0 */ - protected $request = null; + protected ?RequestAbstract $request = null; /** * Request. @@ -69,7 +69,7 @@ class View extends ViewAbstract * @var null|ResponseAbstract * @since 1.0.0 */ - protected $response = null; + protected ?ResponseAbstract $response = null; /** * Theme name. @@ -77,7 +77,7 @@ class View extends ViewAbstract * @var null|string * @since 1.0.0 */ - protected $theme = null; + protected ?string $theme = null; /** * Module name. @@ -85,7 +85,7 @@ class View extends ViewAbstract * @var null|string * @since 1.0.0 */ - protected $module = null; + protected ?string $module = null; /** * Constructor. diff --git a/Views/ViewAbstract.php b/Views/ViewAbstract.php index f800e52e8..c2ae44cac 100644 --- a/Views/ViewAbstract.php +++ b/Views/ViewAbstract.php @@ -34,7 +34,7 @@ abstract class ViewAbstract implements RenderableInterface * @var string * @since 1.0.0 */ - protected $template = ''; + protected string $template = ''; /** * Views. @@ -42,7 +42,7 @@ abstract class ViewAbstract implements RenderableInterface * @var \phpOMS\Views\View[] * @since 1.0.0 */ - protected $views = []; + protected array $views = []; /** * Sort views by order. diff --git a/tests/DataStorage/Database/TestModel/BaseModelMapper.php b/tests/DataStorage/Database/TestModel/BaseModelMapper.php index 0cc1a2a15..0baf99103 100644 --- a/tests/DataStorage/Database/TestModel/BaseModelMapper.php +++ b/tests/DataStorage/Database/TestModel/BaseModelMapper.php @@ -24,7 +24,7 @@ class BaseModelMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $columns = [ + protected static array $columns = [ 'test_base_id' => ['name' => 'test_base_id', 'type' => 'int', 'internal' => 'id'], 'test_base_string' => ['name' => 'test_base_string', 'type' => 'string', 'internal' => 'string'], 'test_base_int' => ['name' => 'test_base_int', 'type' => 'int', 'internal' => 'int'], @@ -45,14 +45,14 @@ class BaseModelMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $belongsTo = [ + protected static array $belongsTo = [ 'belongsToOne' => [ 'mapper' => BelongsToModelMapper::class, 'dest' => 'test_base_belongs_to_one', ], ]; - protected static $ownsOne = [ + protected static array $ownsOne = [ 'ownsOneSelf' => [ 'mapper' => OwnsOneModelMapper::class, 'dest' => 'test_base_owns_one_self', @@ -63,7 +63,7 @@ class BaseModelMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $hasMany = [ + protected static array $hasMany = [ 'hasManyDirect' => [ 'mapper' => ManyToManyDirectModelMapper::class, 'table' => 'test_has_many_direct', @@ -78,9 +78,9 @@ class BaseModelMapper extends DataMapperAbstract ], ]; - protected static $table = 'test_base'; + protected static string $table = 'test_base'; - protected static $createdAt = 'test_base_datetime'; + protected static string $createdAt = 'test_base_datetime'; - protected static $primaryField = 'test_base_id'; + protected static string $primaryField = 'test_base_id'; } diff --git a/tests/DataStorage/Database/TestModel/BelongsToModelMapper.php b/tests/DataStorage/Database/TestModel/BelongsToModelMapper.php index 0312d5f6a..7005009ae 100644 --- a/tests/DataStorage/Database/TestModel/BelongsToModelMapper.php +++ b/tests/DataStorage/Database/TestModel/BelongsToModelMapper.php @@ -24,12 +24,12 @@ class BelongsToModelMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $columns = [ + protected static array $columns = [ 'test_belongs_to_one_id' => ['name' => 'test_belongs_to_one_id', 'type' => 'int', 'internal' => 'id'], 'test_belongs_to_one_string' => ['name' => 'test_belongs_to_one_string', 'type' => 'string', 'internal' => 'string'], ]; - protected static $table = 'test_belongs_to_one'; + protected static string $table = 'test_belongs_to_one'; - protected static $primaryField = 'test_belongs_to_one_id'; + protected static string $primaryField = 'test_belongs_to_one_id'; } diff --git a/tests/DataStorage/Database/TestModel/ManyToManyDirectModelMapper.php b/tests/DataStorage/Database/TestModel/ManyToManyDirectModelMapper.php index 282cc558d..2a1d6d249 100644 --- a/tests/DataStorage/Database/TestModel/ManyToManyDirectModelMapper.php +++ b/tests/DataStorage/Database/TestModel/ManyToManyDirectModelMapper.php @@ -24,13 +24,13 @@ class ManyToManyDirectModelMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $columns = [ + protected static array $columns = [ 'test_has_many_direct_id' => ['name' => 'test_has_many_direct_id', 'type' => 'int', 'internal' => 'id'], 'test_has_many_direct_string' => ['name' => 'test_has_many_direct_string', 'type' => 'string', 'internal' => 'string'], 'test_has_many_direct_to' => ['name' => 'test_has_many_direct_to', 'type' => 'int', 'internal' => 'to'], ]; - protected static $table = 'test_has_many_direct'; + protected static string $table = 'test_has_many_direct'; - protected static $primaryField = 'test_has_many_direct_id'; + protected static string $primaryField = 'test_has_many_direct_id'; } diff --git a/tests/DataStorage/Database/TestModel/ManyToManyRelModelMapper.php b/tests/DataStorage/Database/TestModel/ManyToManyRelModelMapper.php index 2bf8d83d0..664892c1c 100644 --- a/tests/DataStorage/Database/TestModel/ManyToManyRelModelMapper.php +++ b/tests/DataStorage/Database/TestModel/ManyToManyRelModelMapper.php @@ -24,12 +24,12 @@ class ManyToManyRelModelMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $columns = [ + protected static array $columns = [ 'test_has_many_rel_id' => ['name' => 'test_has_many_rel_id', 'type' => 'int', 'internal' => 'id'], 'test_has_many_rel_string' => ['name' => 'test_has_many_rel_string', 'type' => 'string', 'internal' => 'string'], ]; - protected static $table = 'test_has_many_rel'; + protected static string $table = 'test_has_many_rel'; - protected static $primaryField = 'test_has_many_rel_id'; + protected static string $primaryField = 'test_has_many_rel_id'; } diff --git a/tests/DataStorage/Database/TestModel/OwnsOneModelMapper.php b/tests/DataStorage/Database/TestModel/OwnsOneModelMapper.php index 0034524a3..5b6cbf673 100644 --- a/tests/DataStorage/Database/TestModel/OwnsOneModelMapper.php +++ b/tests/DataStorage/Database/TestModel/OwnsOneModelMapper.php @@ -24,12 +24,12 @@ class OwnsOneModelMapper extends DataMapperAbstract * @var array> * @since 1.0.0 */ - protected static $columns = [ + protected static array $columns = [ 'test_owns_one_id' => ['name' => 'test_owns_one_id', 'type' => 'int', 'internal' => 'id'], 'test_owns_one_string' => ['name' => 'test_owns_one_string', 'type' => 'string', 'internal' => 'string'], ]; - protected static $table = 'test_owns_one'; + protected static string $table = 'test_owns_one'; - protected static $primaryField = 'test_owns_one_id'; + protected static string $primaryField = 'test_owns_one_id'; } diff --git a/tests/Module/ModuleAbstractTest.php b/tests/Module/ModuleAbstractTest.php index 68ddc622c..3720b6024 100644 --- a/tests/Module/ModuleAbstractTest.php +++ b/tests/Module/ModuleAbstractTest.php @@ -29,7 +29,7 @@ class ModuleAbstractTest extends \PHPUnit\Framework\TestCase const MODULE_VERSION = '1.2.3'; const MODULE_NAME = 'Test'; const MODULE_ID = 2; - protected static $dependencies = [1, 2]; + protected static array $dependencies = [1, 2]; }; self::assertEquals([1, 2], $moduleClass->getDependencies());