From 3b45692ff14efa3d145a942458d4868316aa6e30 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 13 Mar 2018 20:55:49 +0100 Subject: [PATCH] Nullable+void typehint --- Account/Account.php | 28 ++--- Account/Group.php | 6 +- Account/PermissionAbstract.php | 32 ++--- Asset/AssetManager.php | 2 +- Auth/Auth.php | 2 +- Autoloader.php | 2 +- Business/Marketing/NetPromoterScore.php | 2 +- Config/SettingsAbstract.php | 2 +- .../Cache/Connection/ConnectionAbstract.php | 2 +- DataStorage/Cache/Connection/FileCache.php | 4 +- DataStorage/Cache/Connection/MemCached.php | 6 +- DataStorage/Cache/Connection/NullCache.php | 6 +- DataStorage/Cache/Connection/RedisCache.php | 6 +- DataStorage/Cache/Connection/WinCache.php | 6 +- DataStorage/Cookie/CookieJar.php | 4 +- .../Connection/ConnectionAbstract.php | 2 +- .../Database/Connection/MysqlConnection.php | 2 +- .../Connection/SqlServerConnection.php | 2 +- DataStorage/Database/DataMapperAbstract.php | 46 +++---- DataStorage/Database/GrammarAbstract.php | 2 +- DataStorage/Database/Query/Builder.php | 6 +- DataStorage/Database/Query/Column.php | 2 +- DataStorage/Database/Schema/Builder.php | 2 +- DataStorage/Session/ConsoleSession.php | 2 +- DataStorage/Session/HttpSession.php | 10 +- DataStorage/Session/SocketSession.php | 4 +- Dispatcher/Dispatcher.php | 4 +- Event/EventManager.php | 4 +- Localization/L11nManager.php | 4 +- Localization/Localization.php | 28 ++--- Localization/Money.php | 2 +- Log/FileLogger.php | 24 ++-- Math/Matrix/Matrix.php | 2 +- Math/Optimization/TSP/CityPool.php | 2 +- Math/Optimization/TSP/Population.php | 6 +- Math/Optimization/TSP/Tour.php | 4 +- Math/Stochastic/NaiveBayesFilter.php | 4 +- Message/HeaderAbstract.php | 8 +- Message/Http/Header.php | 16 +-- Message/Http/Request.php | 16 +-- Message/Http/Response.php | 2 +- Message/Mail/EmailAbstract.php | 4 +- Message/Mail/Imap.php | 2 +- Message/Mail/Mail.php | 6 +- Message/Mail/Nntp.php | 2 +- Message/Mail/Pop3.php | 2 +- Message/RequestAbstract.php | 8 +- Message/ResponseAbstract.php | 2 +- Model/Html/Head.php | 10 +- Model/Html/Meta.php | 8 +- Module/InfoManager.php | 6 +- Module/InstallerAbstract.php | 12 +- Module/ModuleAbstract.php | 2 +- Module/ModuleFactory.php | 4 +- Module/ModuleManager.php | 18 +-- Module/PackageManager.php | 6 +- Module/StatusAbstract.php | 12 +- Module/UninstallerAbstract.php | 2 +- Module/UpdaterAbstract.php | 2 +- Router/Router.php | 2 +- Socket/Client/Client.php | 2 +- Socket/Client/ClientConnection.php | 8 +- Socket/Packets/Header.php | 10 +- Socket/Packets/PacketAbstract.php | 2 +- Socket/Server/Server.php | 2 +- Stdlib/Base/Address.php | 6 +- Stdlib/Base/Iban.php | 2 +- Stdlib/Base/Location.php | 14 +-- Stdlib/Graph/BinaryTree.php | 6 +- Stdlib/Graph/Tree.php | 4 +- Stdlib/Map/MultiMap.php | 2 +- Stdlib/Queue/PriorityQueue.php | 6 +- System/File/Local/Directory.php | 2 +- System/File/Local/File.php | 2 +- System/File/Local/FileAbstract.php | 2 +- UnhandledHandler.php | 4 +- Uri/Http.php | 4 +- Uri/UriFactory.php | 6 +- Utils/ArrayUtils.php | 4 +- Utils/Barcode/C128Abstract.php | 12 +- Utils/Barcode/C128a.php | 2 +- Utils/Barcode/C25.php | 2 +- Utils/Barcode/C39.php | 2 +- Utils/Barcode/Codebar.php | 2 +- Utils/Barcode/HIBCC.php | 14 +-- Utils/Converter/Currency.php | 2 +- Utils/Encoding/Huffman/Dictionary.php | 8 +- Utils/Encoding/Huffman/Huffman.php | 4 +- Utils/Git/Author.php | 6 +- Utils/Git/Branch.php | 2 +- Utils/Git/Commit.php | 14 +-- Utils/Git/Git.php | 2 +- Utils/Git/Repository.php | 4 +- Utils/Git/Tag.php | 2 +- Utils/IO/Csv/CsvDatabaseMapper.php | 4 +- Utils/IO/Excel/ExcelDatabaseMapper.php | 4 +- Utils/JobQueue/Job.php | 2 +- Utils/JobQueue/JobQueue.php | 8 +- Utils/JsonBuilder.php | 4 +- Utils/Parser/Markdown/Markdown.php | 48 +++---- Utils/RnG/Text.php | 6 +- Utils/StringCompare.php | 2 +- Utils/TaskSchedule/Interval.php | 22 ++-- Utils/TaskSchedule/SchedulerAbstract.php | 4 +- Utils/TaskSchedule/TaskAbstract.php | 12 +- Validation/ValidatorAbstract.php | 2 +- Views/View.php | 2 +- Views/ViewAbstract.php | 2 +- tests/Autoloader.php | 2 +- tests/Message/HeaderAbstractTest.php | 118 +++++++++--------- 110 files changed, 417 insertions(+), 417 deletions(-) diff --git a/Account/Account.php b/Account/Account.php index 01cd4f65d..4c106ac61 100644 --- a/Account/Account.php +++ b/Account/Account.php @@ -222,7 +222,7 @@ class Account implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function addGroup($group) /* : void */ + public function addGroup($group) : void { $this->groups[] = $group; } @@ -236,7 +236,7 @@ class Account implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setL11n(Localization $l11n) /* : void */ + public function setL11n(Localization $l11n) : void { $this->l11n = $l11n; } @@ -252,7 +252,7 @@ class Account implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setPermissions(array $permissions) /* : void */ + public function setPermissions(array $permissions) : void { $this->permissions = $permissions; } @@ -268,7 +268,7 @@ class Account implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function addPermissions(array $permissions) /* : void */ + public function addPermissions(array $permissions) : void { $this->permissions = array_merge($this->permissions, $permissions); } @@ -284,7 +284,7 @@ class Account implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function addPermission(PermissionAbstract $permission) /* : void */ + public function addPermission(PermissionAbstract $permission) : void { $this->permissions[] = $permission; } @@ -371,7 +371,7 @@ class Account implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setName1(string $name) /* : void */ + public function setName1(string $name) : void { $this->name1 = $name; } @@ -397,7 +397,7 @@ class Account implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setName2(string $name) /* : void */ + public function setName2(string $name) : void { $this->name2 = $name; } @@ -423,7 +423,7 @@ class Account implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setName3(string $name) /* : void */ + public function setName3(string $name) : void { $this->name3 = $name; } @@ -451,7 +451,7 @@ class Account implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setEmail(string $email) /* : void */ + public function setEmail(string $email) : void { if (!Email::isValid($email)) { throw new \InvalidArgumentException(); @@ -483,7 +483,7 @@ class Account implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setStatus(int $status) /* : void */ + public function setStatus(int $status) : void { if (!AccountStatus::isValidValue($status)) { throw new \InvalidArgumentException(); @@ -515,7 +515,7 @@ class Account implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setType(int $type) /* : void */ + public function setType(int $type) : void { if (!AccountType::isValidValue($type)) { throw new \InvalidArgumentException(); @@ -559,7 +559,7 @@ class Account implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function generatePassword(string $password) /* : void */ + public function generatePassword(string $password) : void { $this->password = \password_hash($password, \PASSWORD_DEFAULT); @@ -577,7 +577,7 @@ class Account implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setName(string $name) /* : void */ + public function setName(string $name) : void { $this->login = $name; } @@ -589,7 +589,7 @@ class Account implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function updateLastActive() /* : void */ + public function updateLastActive() : void { $this->lastActive = new \DateTime('NOW'); } diff --git a/Account/Group.php b/Account/Group.php index 56a67d8e4..ebd6b6a89 100644 --- a/Account/Group.php +++ b/Account/Group.php @@ -126,7 +126,7 @@ class Group implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setName(string $name) /* : void */ + public function setName(string $name) : void { $this->name = $name; } @@ -152,7 +152,7 @@ class Group implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setDescription(string $description) /* : void */ + public function setDescription(string $description) : void { $this->description = $description; } @@ -180,7 +180,7 @@ class Group implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setStatus(int $status) /* : void */ + public function setStatus(int $status) : void { if (!GroupStatus::isValidValue($status)) { throw new InvalidEnumValue($status); diff --git a/Account/PermissionAbstract.php b/Account/PermissionAbstract.php index 8caa71cd1..2ac5a22bf 100644 --- a/Account/PermissionAbstract.php +++ b/Account/PermissionAbstract.php @@ -118,7 +118,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function getUnit() /* : ?int */ + public function getUnit() : ?int { return $this->unit; } @@ -132,7 +132,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function setUnit(int $unit = null) /* : void */ + public function setUnit(int $unit = null) : void { $this->unit = $unit; } @@ -144,7 +144,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function getApp() /* : ?string */ + public function getApp() : ?string { return $this->app; } @@ -158,7 +158,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function setApp(string $app = null) /* : void */ + public function setApp(string $app = null) : void { $this->app = $app; } @@ -170,7 +170,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function getModule() /* : ?int */ + public function getModule() : ?int { return $this->module; } @@ -184,7 +184,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function setModule(int $module = null) /* : void */ + public function setModule(int $module = null) : void { $this->module = $module; } @@ -196,7 +196,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function getFrom() /* : ?int */ + public function getFrom() : ?int { return $this->from; } @@ -210,7 +210,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function setFrom(int $from = null) /* : void */ + public function setFrom(int $from = null) : void { $this->from = $from; } @@ -222,7 +222,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function getType() /* : ?int */ + public function getType() : ?int { return $this->type; } @@ -236,7 +236,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function setType(int $type = null) /* : void */ + public function setType(int $type = null) : void { $this->type = $type; } @@ -248,7 +248,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function getElement() /* : ?int */ + public function getElement() : ?int { return $this->element; } @@ -262,7 +262,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function setElement(int $element = null) /* : void */ + public function setElement(int $element = null) : void { $this->element = $element; } @@ -274,7 +274,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function getComponent() /* : ?int */ + public function getComponent() : ?int { return $this->component; } @@ -288,7 +288,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function setComponent(int $component = null) /* : void */ + public function setComponent(int $component = null) : void { $this->component = $component; } @@ -314,7 +314,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function setPermission(int $permission = 0) /* : void */ + public function setPermission(int $permission = 0) : void { $this->permission = $permission; } @@ -328,7 +328,7 @@ class PermissionAbstract * * @since 1.0.0 */ - public function addPermission(int $permission = 0) /* : void */ + public function addPermission(int $permission = 0) : void { $this->permission |= $permission; } diff --git a/Asset/AssetManager.php b/Asset/AssetManager.php index 1cd261b3a..8f2323a3a 100644 --- a/Asset/AssetManager.php +++ b/Asset/AssetManager.php @@ -93,7 +93,7 @@ class AssetManager implements \Countable * * @since 1.0.0 */ - public function get(string $id) /* : ?string */ + public function get(string $id) : ?string { if (isset($this->assets[$id])) { return $this->assets[$id]; diff --git a/Auth/Auth.php b/Auth/Auth.php index b029f1e50..810fb4dc0 100644 --- a/Auth/Auth.php +++ b/Auth/Auth.php @@ -63,7 +63,7 @@ class Auth * * @since 1.0.0 */ - public static function logout(SessionInterface $session) /* : void */ + public static function logout(SessionInterface $session) : void { $session->remove('UID'); } diff --git a/Autoloader.php b/Autoloader.php index 4d9c3f02d..de26f6ed2 100644 --- a/Autoloader.php +++ b/Autoloader.php @@ -40,7 +40,7 @@ class Autoloader * * @since 1.0.0 */ - public static function defaultAutoloader(string $class) /* : void */ + public static function defaultAutoloader(string $class) : void { $class = ltrim($class, '\\'); $class = str_replace(['_', '\\'], '/', $class); diff --git a/Business/Marketing/NetPromoterScore.php b/Business/Marketing/NetPromoterScore.php index e246a99e4..ec589cc8b 100644 --- a/Business/Marketing/NetPromoterScore.php +++ b/Business/Marketing/NetPromoterScore.php @@ -54,7 +54,7 @@ class NetPromoterScore * * @since 1.0.0 */ - public function add(int $score) /* : void */ + public function add(int $score) : void { $this->scores[] = $score; } diff --git a/Config/SettingsAbstract.php b/Config/SettingsAbstract.php index 371ac615b..651fd87eb 100644 --- a/Config/SettingsAbstract.php +++ b/Config/SettingsAbstract.php @@ -128,7 +128,7 @@ abstract class SettingsAbstract implements OptionsInterface * * @since 1.0.0 */ - public function set(array $options, bool $store = false) /* : void */ + public function set(array $options, bool $store = false) : void { $this->setOptions($options); diff --git a/DataStorage/Cache/Connection/ConnectionAbstract.php b/DataStorage/Cache/Connection/ConnectionAbstract.php index 3890bc9f5..3cc3b17a7 100644 --- a/DataStorage/Cache/Connection/ConnectionAbstract.php +++ b/DataStorage/Cache/Connection/ConnectionAbstract.php @@ -153,7 +153,7 @@ abstract class ConnectionAbstract implements ConnectionInterface /** * {@inheritdoc} */ - public function close() /* : void */ + public function close() : void { $this->con = null; $this->status = CacheStatus::INACTIVE; diff --git a/DataStorage/Cache/Connection/FileCache.php b/DataStorage/Cache/Connection/FileCache.php index 80aac5e02..c2b0bdb63 100644 --- a/DataStorage/Cache/Connection/FileCache.php +++ b/DataStorage/Cache/Connection/FileCache.php @@ -76,7 +76,7 @@ class FileCache extends ConnectionAbstract /** * {@inheritdoc} */ - public function connect(array $data) /* : void */ + public function connect(array $data) : void { $this->status = CacheStatus::ACTIVE; } @@ -120,7 +120,7 @@ class FileCache extends ConnectionAbstract /** * {@inheritdoc} */ - public function set($key, $value, int $expire = -1) /* : void */ + public function set($key, $value, int $expire = -1) : void { if ($this->status !== CacheStatus::ACTIVE) { return; diff --git a/DataStorage/Cache/Connection/MemCached.php b/DataStorage/Cache/Connection/MemCached.php index b34bb5135..e47f4f198 100644 --- a/DataStorage/Cache/Connection/MemCached.php +++ b/DataStorage/Cache/Connection/MemCached.php @@ -54,7 +54,7 @@ class MemCached extends ConnectionAbstract /** * {@inheritdoc} */ - public function connect(array $data) /* : void */ + public function connect(array $data) : void { $this->status = CacheStatus::ACTIVE; } @@ -76,7 +76,7 @@ class MemCached extends ConnectionAbstract /** * {@inheritdoc} */ - public function set($key, $value, int $expire = -1) /* : void */ + public function set($key, $value, int $expire = -1) : void { $this->memc->set($key, $value, false, $expire); } @@ -175,7 +175,7 @@ class MemCached extends ConnectionAbstract * * @since 1.0.0 */ - public function close() /* : void */ + public function close() : void { if ($this->memc !== null) { $this->memc->close(); diff --git a/DataStorage/Cache/Connection/NullCache.php b/DataStorage/Cache/Connection/NullCache.php index 73abd318a..bc7f95083 100644 --- a/DataStorage/Cache/Connection/NullCache.php +++ b/DataStorage/Cache/Connection/NullCache.php @@ -28,14 +28,14 @@ class NullCache extends ConnectionAbstract /** * {@inheritdoc} */ - public function connect(array $data) /* : void */ + public function connect(array $data) : void { } /** * {@inheritdoc} */ - public function set($key, $value, int $expire = -1) /* : void */ + public function set($key, $value, int $expire = -1) : void { } @@ -106,7 +106,7 @@ class NullCache extends ConnectionAbstract /** * {@inheritdoc} */ - public function setStatus(int $status) /* : void */ + public function setStatus(int $status) : void { } } diff --git a/DataStorage/Cache/Connection/RedisCache.php b/DataStorage/Cache/Connection/RedisCache.php index c69837876..a84d8e060 100644 --- a/DataStorage/Cache/Connection/RedisCache.php +++ b/DataStorage/Cache/Connection/RedisCache.php @@ -30,7 +30,7 @@ class RedisCache extends ConnectionAbstract /** * {@inheritdoc} */ - public function connect(array $data) /* : void */ + public function connect(array $data) : void { $this->status = CacheStatus::ACTIVE; } @@ -38,7 +38,7 @@ class RedisCache extends ConnectionAbstract /** * {@inheritdoc} */ - public function set($key, $value, int $expire = -1) /* : void */ + public function set($key, $value, int $expire = -1) : void { // TODO: Implement set() method. } @@ -114,7 +114,7 @@ class RedisCache extends ConnectionAbstract /** * {@inheritdoc} */ - public function setStatus(int $status) /* : void */ + public function setStatus(int $status) : void { // TODO: Implement setStatus() method. } diff --git a/DataStorage/Cache/Connection/WinCache.php b/DataStorage/Cache/Connection/WinCache.php index ae080cc32..c86db5a56 100644 --- a/DataStorage/Cache/Connection/WinCache.php +++ b/DataStorage/Cache/Connection/WinCache.php @@ -29,7 +29,7 @@ class WinCache extends ConnectionAbstract /** * {@inheritdoc} */ - public function connect(array $data) /* : void */ + public function connect(array $data) : void { $this->status = CacheStatus::ACTIVE; } @@ -37,7 +37,7 @@ class WinCache extends ConnectionAbstract /** * {@inheritdoc} */ - public function set($key, $value, int $expire = -1) /* : void */ + public function set($key, $value, int $expire = -1) : void { // TODO: Implement set() method. } @@ -113,7 +113,7 @@ class WinCache extends ConnectionAbstract /** * {@inheritdoc} */ - public function setStatus(int $status) /* : void */ + public function setStatus(int $status) : void { // TODO: Implement setStatus() method. } diff --git a/DataStorage/Cookie/CookieJar.php b/DataStorage/Cookie/CookieJar.php index 980462138..d2d026ae7 100644 --- a/DataStorage/Cookie/CookieJar.php +++ b/DataStorage/Cookie/CookieJar.php @@ -60,7 +60,7 @@ class CookieJar * * @since 1.0.0 */ - public static function lock() /* : void */ + public static function lock() : void { self::$isLocked = true; } @@ -170,7 +170,7 @@ class CookieJar * * @since 1.0.0 */ - public function save() /* : void */ + public function save() : void { if (self::$isLocked) { throw new LockException('CookieJar'); diff --git a/DataStorage/Database/Connection/ConnectionAbstract.php b/DataStorage/Database/Connection/ConnectionAbstract.php index 68b12456e..c26428bb8 100644 --- a/DataStorage/Database/Connection/ConnectionAbstract.php +++ b/DataStorage/Database/Connection/ConnectionAbstract.php @@ -197,7 +197,7 @@ abstract class ConnectionAbstract implements ConnectionInterface /** * {@inheritdoc} */ - public function close() /* : void */ + public function close() : void { $this->con = null; $this->status = DatabaseStatus::CLOSED; diff --git a/DataStorage/Database/Connection/MysqlConnection.php b/DataStorage/Database/Connection/MysqlConnection.php index 67ce36c2b..fac9fb0f3 100644 --- a/DataStorage/Database/Connection/MysqlConnection.php +++ b/DataStorage/Database/Connection/MysqlConnection.php @@ -54,7 +54,7 @@ class MysqlConnection extends ConnectionAbstract /** * {@inheritdoc} */ - public function connect(array $dbdata = null) /* : void */ + public function connect(array $dbdata = null) : void { $this->dbdata = isset($dbdata) ? $dbdata : $this->dbdata; diff --git a/DataStorage/Database/Connection/SqlServerConnection.php b/DataStorage/Database/Connection/SqlServerConnection.php index 69ce974cd..6131b4f64 100644 --- a/DataStorage/Database/Connection/SqlServerConnection.php +++ b/DataStorage/Database/Connection/SqlServerConnection.php @@ -52,7 +52,7 @@ class SqlServerConnection extends ConnectionAbstract /** * {@inheritdoc} */ - public function connect(array $dbdata = null) /* : void */ + public function connect(array $dbdata = null) : void { $this->close(); diff --git a/DataStorage/Database/DataMapperAbstract.php b/DataStorage/Database/DataMapperAbstract.php index 8a82dffdd..ee405f682 100644 --- a/DataStorage/Database/DataMapperAbstract.php +++ b/DataStorage/Database/DataMapperAbstract.php @@ -199,7 +199,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - public static function setConnection(ConnectionAbstract $con) /* : void */ + public static function setConnection(ConnectionAbstract $con) : void { self::$db = $con; } @@ -237,7 +237,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - private static function extend($class) /* : void */ + private static function extend($class) : void { /* todo: have to implement this in the queries, so far not used */ self::$collection['primaryField'][] = $class::$primaryField; @@ -262,7 +262,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - public static function with(...$objects) /* : void */ + public static function with(...$objects) : void { // todo: how to handle with of parent objects/extends/relations @@ -278,7 +278,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - public static function clear() /* : void */ + public static function clear() : void { self::$overwrite = true; self::$primaryField = ''; @@ -528,7 +528,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - private static function setObjectId(\ReflectionClass $reflectionClass, $obj, $objId) /* : void */ + private static function setObjectId(\ReflectionClass $reflectionClass, $obj, $objId) : void { $reflectionProperty = $reflectionClass->getProperty(static::$columns[static::$primaryField]['internal']); @@ -557,7 +557,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - private static function createHasMany(\ReflectionClass $reflectionClass, $obj, $objId) /* : void */ + private static function createHasMany(\ReflectionClass $reflectionClass, $obj, $objId) : void { foreach (static::$hasMany as $propertyName => $rel) { $property = $reflectionClass->getProperty($propertyName); @@ -638,7 +638,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - private static function createHasManyArray(array &$obj, $objId) /* : void */ + private static function createHasManyArray(array &$obj, $objId) : void { foreach (static::$hasMany as $propertyName => $rel) { $values = $obj[$propertyName]; @@ -885,7 +885,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - private static function updateHasMany(\ReflectionClass $reflectionClass, $obj, $objId) /* : void */ + private static function updateHasMany(\ReflectionClass $reflectionClass, $obj, $objId) : void { $objsIds = []; @@ -1080,7 +1080,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - private static function updateModel($obj, $objId, \ReflectionClass $reflectionClass = null) /* : void */ + private static function updateModel($obj, $objId, \ReflectionClass $reflectionClass = null) : void { $query = new Builder(self::$db); $query->prefix(self::$db->getPrefix()) @@ -1188,7 +1188,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - private static function deleteHasMany(\ReflectionClass $reflectionClass, $obj, $objId, int $relations) /* : void */ + private static function deleteHasMany(\ReflectionClass $reflectionClass, $obj, $objId, int $relations) : void { foreach (static::$hasMany as $propertyName => $rel) { $property = $reflectionClass->getProperty($propertyName); @@ -1306,7 +1306,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - private static function deleteModel($obj, $objId, int $relations = RelationType::REFERENCE, \ReflectionClass $reflectionClass = null) /* : void */ + private static function deleteModel($obj, $objId, int $relations = RelationType::REFERENCE, \ReflectionClass $reflectionClass = null) : void { $query = new Builder(self::$db); $query->prefix(self::$db->getPrefix()) @@ -1474,7 +1474,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - public static function populateManyToMany(array $result, &$obj, int $depth = null) /* : void */ + public static function populateManyToMany(array $result, &$obj, int $depth = null) : void { // todo: maybe pass reflectionClass as optional parameter for performance increase $reflectionClass = new \ReflectionClass($obj); @@ -1510,7 +1510,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - public static function populateManyToManyArray(array $result, array &$obj, int $depth = null) /* : void */ + public static function populateManyToManyArray(array $result, array &$obj, int $depth = null) : void { foreach ($result as $member => $values) { if (!empty($values)) { @@ -1535,7 +1535,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - public static function populateHasOne(&$obj, int $depth = null) /* : void */ + public static function populateHasOne(&$obj, int $depth = null) : void { $reflectionClass = new \ReflectionClass($obj); @@ -1580,7 +1580,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - public static function populateHasOneArray(array &$obj, int $depth = null) /* : void */ + public static function populateHasOneArray(array &$obj, int $depth = null) : void { foreach (static::$hasOne as $member => $one) { /** @var string $mapper */ @@ -1601,7 +1601,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - public static function populateOwnsOne(&$obj, int $depth = null) /* : void */ + public static function populateOwnsOne(&$obj, int $depth = null) : void { $reflectionClass = new \ReflectionClass($obj); @@ -1646,7 +1646,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - public static function populateOwnsOneArray(array &$obj, int $depth = null) /* : void */ + public static function populateOwnsOneArray(array &$obj, int $depth = null) : void { foreach (static::$ownsOne as $member => $one) { /** @var string $mapper */ @@ -1667,7 +1667,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - public static function populateBelongsTo(&$obj, int $depth = null) /* : void */ + public static function populateBelongsTo(&$obj, int $depth = null) : void { $reflectionClass = new \ReflectionClass($obj); @@ -1712,7 +1712,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - public static function populateBelongsToArray(array &$obj, int $depth = null) /* : void */ + public static function populateBelongsToArray(array &$obj, int $depth = null) : void { foreach (static::$belongsTo as $member => $one) { /** @var string $mapper */ @@ -2218,7 +2218,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - public static function fillRelations(array &$obj, int $relations = RelationType::ALL, int $depth = null) /* : void */ + public static function fillRelations(array &$obj, int $relations = RelationType::ALL, int $depth = null) : void { if (isset($depth) && $depth < 1) { return; @@ -2268,7 +2268,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - public static function fillRelationsArray(array &$obj, int $relations = RelationType::ALL, int $depth = null) /* : void */ + public static function fillRelationsArray(array &$obj, int $relations = RelationType::ALL, int $depth = null) : void { if (isset($depth) && $depth < 1) { return null; @@ -2546,7 +2546,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - private static function addInitialized(string $mapper, $id, $obj = null) /* : void */ + private static function addInitialized(string $mapper, $id, $obj = null) : void { if (!isset(self::$initObjects[$mapper])) { self::$initObjects[$mapper] = []; @@ -2609,7 +2609,7 @@ class DataMapperAbstract implements DataMapperInterface * * @since 1.0.0 */ - private static function setUpParentMapper() /* : void */ + private static function setUpParentMapper() : void { self::$parentMapper = static::class; } diff --git a/DataStorage/Database/GrammarAbstract.php b/DataStorage/Database/GrammarAbstract.php index 9b5ecb792..9a1717eaf 100644 --- a/DataStorage/Database/GrammarAbstract.php +++ b/DataStorage/Database/GrammarAbstract.php @@ -149,7 +149,7 @@ abstract class GrammarAbstract * * @since 1.0.0 */ - public function setTablePrefix(string $prefix) /* : void */ + public function setTablePrefix(string $prefix) : void { $this->tablePrefix = $prefix; } diff --git a/DataStorage/Database/Query/Builder.php b/DataStorage/Database/Query/Builder.php index eb813626d..b3277dae1 100644 --- a/DataStorage/Database/Query/Builder.php +++ b/DataStorage/Database/Query/Builder.php @@ -238,7 +238,7 @@ class Builder extends BuilderAbstract * * @since 1.0.0 */ - public function setConnection(ConnectionAbstract $connection) /* : void */ + public function setConnection(ConnectionAbstract $connection) : void { $this->connection = $connection; $this->grammar = $connection->getGrammar(); @@ -528,7 +528,7 @@ class Builder extends BuilderAbstract * * @since 1.0.0 */ - public function getWhereByColumn($column) /* : ?array */ + public function getWhereByColumn($column) : ?array { return $this->wheres[self::getPublicColumnName($column)] ?? null; } @@ -543,7 +543,7 @@ class Builder extends BuilderAbstract * * @since 1.0.0 */ - public function getTableOfSystem($expression, string $systemIdentifier) /* : ?string */ + public function getTableOfSystem($expression, string $systemIdentifier) : ?string { if (($pos = strpos($expression, $systemIdentifier . '.' . $systemIdentifier)) === false) { return null; diff --git a/DataStorage/Database/Query/Column.php b/DataStorage/Database/Query/Column.php index 3c73465a1..a563bd6a6 100644 --- a/DataStorage/Database/Query/Column.php +++ b/DataStorage/Database/Query/Column.php @@ -57,7 +57,7 @@ class Column return $this->column; } - public function setColumn(string $column) /* : void */ + public function setColumn(string $column) : void { $this->column = $column; } diff --git a/DataStorage/Database/Schema/Builder.php b/DataStorage/Database/Schema/Builder.php index 2fa1ea6db..ca73e0d20 100644 --- a/DataStorage/Database/Schema/Builder.php +++ b/DataStorage/Database/Schema/Builder.php @@ -44,7 +44,7 @@ class Builder extends BuilderAbstract $this->grammar = $connection->getSchemaGrammar(); } - public function select(...$table) /* : void */ + public function select(...$table) : void { $this->type = QueryType::SELECT; $this->table += $table; diff --git a/DataStorage/Session/ConsoleSession.php b/DataStorage/Session/ConsoleSession.php index 0f4b0fee4..fac8251cf 100644 --- a/DataStorage/Session/ConsoleSession.php +++ b/DataStorage/Session/ConsoleSession.php @@ -79,7 +79,7 @@ class ConsoleSession implements SessionInterface /** * {@inheritdoc} */ - public function setSID($sid) /* : void */ + public function setSID($sid) : void { $this->sid = $sid; } diff --git a/DataStorage/Session/HttpSession.php b/DataStorage/Session/HttpSession.php index 05688b77f..3088e3f8b 100644 --- a/DataStorage/Session/HttpSession.php +++ b/DataStorage/Session/HttpSession.php @@ -114,7 +114,7 @@ class HttpSession implements SessionInterface * * @since 1.0.0 */ - private function setCsrfProtection() /* : void */ + private function setCsrfProtection() : void { $this->set('UID', 0, false); @@ -151,7 +151,7 @@ class HttpSession implements SessionInterface /** * {@inheritdoc} */ - public function lock() /* : void */ + public function lock() : void { self::$isLocked = true; } @@ -171,7 +171,7 @@ class HttpSession implements SessionInterface /** * {@inheritdoc} */ - public function save() /* : void */ + public function save() : void { if (!self::$isLocked) { $_SESSION = $this->sessionData; @@ -204,7 +204,7 @@ class HttpSession implements SessionInterface /** * {@inheritdoc} */ - public function setSID($sid) /* : void */ + public function setSID($sid) : void { $this->sid = $sid; } @@ -216,7 +216,7 @@ class HttpSession implements SessionInterface * * @since 1.0.0 */ - private function destroy() /* : void */ + private function destroy() : void { session_destroy(); $this->sessionData = []; diff --git a/DataStorage/Session/SocketSession.php b/DataStorage/Session/SocketSession.php index 32dbb194b..c5c6542c7 100644 --- a/DataStorage/Session/SocketSession.php +++ b/DataStorage/Session/SocketSession.php @@ -79,7 +79,7 @@ class SocketSession implements SessionInterface /** * {@inheritdoc} */ - public function setSID($sid) /* : void */ + public function setSID($sid) : void { $this->sid = $sid; } @@ -87,7 +87,7 @@ class SocketSession implements SessionInterface /** * {@inheritdoc} */ - public function save() /* : void */ + public function save() : void { } diff --git a/Dispatcher/Dispatcher.php b/Dispatcher/Dispatcher.php index f70221caf..808759464 100644 --- a/Dispatcher/Dispatcher.php +++ b/Dispatcher/Dispatcher.php @@ -153,7 +153,7 @@ class Dispatcher * * @since 1.0.0 */ - private function dispatchClosure(\Closure $controller, array $data = null) /* : void */ + private function dispatchClosure(\Closure $controller, array $data = null) : void { return $controller($this->app, ...$data); } @@ -194,7 +194,7 @@ class Dispatcher * * @since 1.0.0 */ - public function set(ModuleAbstract $controller, string $name) /* : void */ + public function set(ModuleAbstract $controller, string $name) : void { $this->controllers[$name] = $controller; } diff --git a/Event/EventManager.php b/Event/EventManager.php index f1504e5b4..b75a6972f 100644 --- a/Event/EventManager.php +++ b/Event/EventManager.php @@ -119,7 +119,7 @@ class EventManager * * @since 1.0.0 */ - private function reset(string $group) /* : void */ + private function reset(string $group) : void { foreach ($this->groups[$group] as $id => $ok) { $this->groups[$group][$id] = false; @@ -186,7 +186,7 @@ class EventManager * * @since 1.0.0 */ - public function addGroup(string $group, string $id) /* : void */ + public function addGroup(string $group, string $id) : void { if (!isset($this->groups[$group])) { $this->groups[$group] = []; diff --git a/Localization/L11nManager.php b/Localization/L11nManager.php index 99ae9a18f..c31ff098a 100644 --- a/Localization/L11nManager.php +++ b/Localization/L11nManager.php @@ -75,7 +75,7 @@ class L11nManager * * @since 1.0.0 */ - public function loadLanguage(string $language, string $from, array $translation) /* : void */ + public function loadLanguage(string $language, string $from, array $translation) : void { if (!isset($translation[$from])) { throw new \UnexpectedValueException($from); @@ -103,7 +103,7 @@ class L11nManager * * @since 1.0.0 */ - public function loadLanguageFromFile(string $language, string $from, string $file) /* : void */ + public function loadLanguageFromFile(string $language, string $from, string $file) : void { $lang = []; if (file_exists($file)) { diff --git a/Localization/Localization.php b/Localization/Localization.php index 97337919c..b6c17d3ab 100644 --- a/Localization/Localization.php +++ b/Localization/Localization.php @@ -166,7 +166,7 @@ class Localization * * @since 1.0.0 */ - public function setCountry(string $country) /* : void */ + public function setCountry(string $country) : void { if (!ISO3166TwoEnum::isValidValue($country)) { throw new InvalidEnumValue($country); @@ -198,7 +198,7 @@ class Localization * * @since 1.0.0 */ - public function setTimezone(string $timezone) /* : void */ + public function setTimezone(string $timezone) : void { if (!TimeZoneEnumArray::isValidValue($timezone)) { throw new InvalidEnumValue($timezone); @@ -230,7 +230,7 @@ class Localization * * @since 1.0.0 */ - public function setLanguage(string $language) /* : void */ + public function setLanguage(string $language) : void { $language = strtolower($language); @@ -262,7 +262,7 @@ class Localization * * @since 1.0.0 */ - public function setCurrency(string $currency) /* : void */ + public function setCurrency(string $currency) : void { if (!ISO4217Enum::isValidValue($currency)) { throw new InvalidEnumValue($currency); @@ -292,7 +292,7 @@ class Localization * * @since 1.0.0 */ - public function setDatetime(string $datetime) /* : void */ + public function setDatetime(string $datetime) : void { $this->datetime = $datetime; } @@ -318,7 +318,7 @@ class Localization * * @since 1.0.0 */ - public function setDecimal(string $decimal) /* : void */ + public function setDecimal(string $decimal) : void { $this->decimal = $decimal; } @@ -344,7 +344,7 @@ class Localization * * @since 1.0.0 */ - public function setThousands(string $thousands) /* : void */ + public function setThousands(string $thousands) : void { $this->thousands = $thousands; } @@ -370,7 +370,7 @@ class Localization * * @since 1.0.0 */ - public function setAngle(string $angle) /* : void */ + public function setAngle(string $angle) : void { $this->angle = $angle; } @@ -396,7 +396,7 @@ class Localization * * @since 1.0.0 */ - public function setTemperature(string $temperature) /* : void */ + public function setTemperature(string $temperature) : void { $this->temperature = $temperature; } @@ -422,7 +422,7 @@ class Localization * * @since 1.0.0 */ - public function setSpeed(array $speed) /* : void */ + public function setSpeed(array $speed) : void { $this->speed = $speed; } @@ -448,7 +448,7 @@ class Localization * * @since 1.0.0 */ - public function setWeight(array $weight) /* : void */ + public function setWeight(array $weight) : void { $this->weight = $weight; } @@ -474,7 +474,7 @@ class Localization * * @since 1.0.0 */ - public function setLength(array $length) /* : void */ + public function setLength(array $length) : void { $this->length = $length; } @@ -500,7 +500,7 @@ class Localization * * @since 1.0.0 */ - public function setArea(array $area) /* : void */ + public function setArea(array $area) : void { $this->area = $area; } @@ -526,7 +526,7 @@ class Localization * * @since 1.0.0 */ - public function setVolume(array $volume) /* : void */ + public function setVolume(array $volume) : void { $this->volume = $volume; } diff --git a/Localization/Money.php b/Localization/Money.php index 0aa7fedf4..50678b41a 100644 --- a/Localization/Money.php +++ b/Localization/Money.php @@ -132,7 +132,7 @@ class Money implements \Serializable * * @since 1.0.0 */ - public function setLocalization(string $thousands = ',', string $decimal = '.', string $symbol = '', int $position = 0) /* : void */ + public function setLocalization(string $thousands = ',', string $decimal = '.', string $symbol = '', int $position = 0) : void { $this->thousands = $thousands; $this->decimal = $decimal; diff --git a/Log/FileLogger.php b/Log/FileLogger.php index d4f809cb0..465ad12a9 100644 --- a/Log/FileLogger.php +++ b/Log/FileLogger.php @@ -117,7 +117,7 @@ class FileLogger implements LoggerInterface * * @since 1.0.0 */ - private function createFile() /* : void */ + private function createFile() : void { if (!$this->created && !file_exists($this->path)) { File::create($this->path); @@ -264,7 +264,7 @@ class FileLogger implements LoggerInterface * * @since 1.0.0 */ - private function write(string $message) /* : void */ + private function write(string $message) : void { $this->createFile(); if (!is_writable($this->path)) { @@ -289,7 +289,7 @@ class FileLogger implements LoggerInterface /** * {@inheritdoc} */ - public function emergency(string $message, array $context = []) /* : void */ + public function emergency(string $message, array $context = []) : void { $message = $this->interpolate($message, $context, LogLevel::EMERGENCY); $this->write($message); @@ -298,7 +298,7 @@ class FileLogger implements LoggerInterface /** * {@inheritdoc} */ - public function alert(string $message, array $context = []) /* : void */ + public function alert(string $message, array $context = []) : void { $message = $this->interpolate($message, $context, LogLevel::ALERT); $this->write($message); @@ -307,7 +307,7 @@ class FileLogger implements LoggerInterface /** * {@inheritdoc} */ - public function critical(string $message, array $context = []) /* : void */ + public function critical(string $message, array $context = []) : void { $message = $this->interpolate($message, $context, LogLevel::CRITICAL); $this->write($message); @@ -316,7 +316,7 @@ class FileLogger implements LoggerInterface /** * {@inheritdoc} */ - public function error(string $message, array $context = []) /* : void */ + public function error(string $message, array $context = []) : void { $message = $this->interpolate($message, $context, LogLevel::ERROR); $this->write($message); @@ -325,7 +325,7 @@ class FileLogger implements LoggerInterface /** * {@inheritdoc} */ - public function warning(string $message, array $context = []) /* : void */ + public function warning(string $message, array $context = []) : void { $message = $this->interpolate($message, $context, LogLevel::WARNING); $this->write($message); @@ -334,7 +334,7 @@ class FileLogger implements LoggerInterface /** * {@inheritdoc} */ - public function notice(string $message, array $context = []) /* : void */ + public function notice(string $message, array $context = []) : void { $message = $this->interpolate($message, $context, LogLevel::NOTICE); $this->write($message); @@ -343,7 +343,7 @@ class FileLogger implements LoggerInterface /** * {@inheritdoc} */ - public function info(string $message, array $context = []) /* : void */ + public function info(string $message, array $context = []) : void { $message = $this->interpolate($message, $context, LogLevel::INFO); $this->write($message); @@ -352,7 +352,7 @@ class FileLogger implements LoggerInterface /** * {@inheritdoc} */ - public function debug(string $message, array $context = []) /* : void */ + public function debug(string $message, array $context = []) : void { $message = $this->interpolate($message, $context, LogLevel::DEBUG); $this->write($message); @@ -361,7 +361,7 @@ class FileLogger implements LoggerInterface /** * {@inheritdoc} */ - public function log(string $level, string $message, array $context = []) /* : void */ + public function log(string $level, string $message, array $context = []) : void { if (!LogLevel::isValidValue($level)) { throw new InvalidEnumValue($level); @@ -550,7 +550,7 @@ class FileLogger implements LoggerInterface * * @since 1.0.0 */ - public function console(string $message, bool $verbose = true, array $context = []) /* : void */ + public function console(string $message, bool $verbose = true, array $context = []) : void { if (empty($context)) { $message = date('[Y-m-d H:i:s] ') . $message . "\r\n"; diff --git a/Math/Matrix/Matrix.php b/Math/Matrix/Matrix.php index 6735aed75..9b274c7fe 100644 --- a/Math/Matrix/Matrix.php +++ b/Math/Matrix/Matrix.php @@ -89,7 +89,7 @@ class Matrix implements \ArrayAccess, \Iterator * * @since 1.0.0 */ - public function set(int $m, int $n, $value) /* : void */ + public function set(int $m, int $n, $value) : void { if (!isset($this->matrix[$m], $this->matrix[$m][$n])) { throw new InvalidDimensionException($m . 'x' . $n); diff --git a/Math/Optimization/TSP/CityPool.php b/Math/Optimization/TSP/CityPool.php index 268f70ab1..8712a7c14 100644 --- a/Math/Optimization/TSP/CityPool.php +++ b/Math/Optimization/TSP/CityPool.php @@ -53,7 +53,7 @@ class CityPool implements \Countable * * @since 1.0.0 */ - public function addCity(City $city) /* : void */ + public function addCity(City $city) : void { $this->cities[$city->getName() . $city->getLatitude() . $city->getLongitude()] = $city; } diff --git a/Math/Optimization/TSP/Population.php b/Math/Optimization/TSP/Population.php index 98e05fadf..d709de425 100644 --- a/Math/Optimization/TSP/Population.php +++ b/Math/Optimization/TSP/Population.php @@ -60,7 +60,7 @@ class Population implements \Countable * * @since 1.0.0 */ - public function insertAt(int $index, Tour $tour) /* : void */ + public function insertAt(int $index, Tour $tour) : void { $this->tours = array_slice($this->tours, 0, $index) + [$tour] + array_slice($this->tours, $index); } @@ -75,7 +75,7 @@ class Population implements \Countable * * @since 1.0.0 */ - public function set(int $index, Tour $tour) /* : void */ + public function set(int $index, Tour $tour) : void { $this->tours[$index] = $tour; asort($this->tours); @@ -90,7 +90,7 @@ class Population implements \Countable * * @since 1.0.0 */ - public function add(Tour $tour) /* : void */ + public function add(Tour $tour) : void { $this->tours[] = $tour; } diff --git a/Math/Optimization/TSP/Tour.php b/Math/Optimization/TSP/Tour.php index dd4833633..2ed8abdca 100644 --- a/Math/Optimization/TSP/Tour.php +++ b/Math/Optimization/TSP/Tour.php @@ -139,7 +139,7 @@ class Tour implements \Countable * * @since 1.0.0 */ - public function addCity(City $city) /* : void */ + public function addCity(City $city) : void { $this->cities[] = $city; @@ -157,7 +157,7 @@ class Tour implements \Countable * * @since 1.0.0 */ - public function setCity(int $index, City $city) /* : void */ + public function setCity(int $index, City $city) : void { $this->cities[$index] = $city; asort($this->cities); diff --git a/Math/Stochastic/NaiveBayesFilter.php b/Math/Stochastic/NaiveBayesFilter.php index a74be0d36..41b871c12 100644 --- a/Math/Stochastic/NaiveBayesFilter.php +++ b/Math/Stochastic/NaiveBayesFilter.php @@ -29,11 +29,11 @@ class NaiveBayesFilter { } - public function trainMatch($matched) /* : void */ + public function trainMatch($matched) : void { } - public function trainMismatch($mismatch) /* : void */ + public function trainMismatch($mismatch) : void { } diff --git a/Message/HeaderAbstract.php b/Message/HeaderAbstract.php index ef3edd579..ee7b2a528 100644 --- a/Message/HeaderAbstract.php +++ b/Message/HeaderAbstract.php @@ -75,7 +75,7 @@ abstract class HeaderAbstract * * @since 1.0.0 */ - public static function lock() /* : void */ + public static function lock() : void { // todo: maybe pass session as member and make lock not static self::$isLocked = true; @@ -114,7 +114,7 @@ abstract class HeaderAbstract * * @since 1.0.0 */ - public function setL11n(Localization $l11n) /* : void */ + public function setL11n(Localization $l11n) : void { $this->l11n = $l11n; } @@ -140,7 +140,7 @@ abstract class HeaderAbstract * * @since 1.0.0 */ - public function setAccount(int $account) /* : void */ + public function setAccount(int $account) : void { $this->account = $account; } @@ -154,7 +154,7 @@ abstract class HeaderAbstract * * @since 1.0.0 */ - public function setStatusCode(int $status) /* : void */ + public function setStatusCode(int $status) : void { $this->status = $status; $this->generate($status); diff --git a/Message/Http/Header.php b/Message/Http/Header.php index 7cdc0c273..09c44c3d3 100644 --- a/Message/Http/Header.php +++ b/Message/Http/Header.php @@ -227,7 +227,7 @@ class Header extends HeaderAbstract * @since 1.0.0 * @codeCoverageIgnore */ - public function push() /* : void */ + public function push() : void { if (self::$isLocked) { throw new \Exception('Already locked'); @@ -247,7 +247,7 @@ class Header extends HeaderAbstract /** * {@inheritdoc} */ - public function generate(int $code) /* : void */ + public function generate(int $code) : void { switch ($code) { case RequestStatusCode::R_403: @@ -277,7 +277,7 @@ class Header extends HeaderAbstract * * @since 1.0.0 */ - private function generate403() /* : void */ + private function generate403() : void { $this->set('HTTP', 'HTTP/1.0 403 Forbidden'); $this->set('Status', 'Status: HTTP/1.0 403 Forbidden'); @@ -291,7 +291,7 @@ class Header extends HeaderAbstract * * @since 1.0.0 */ - private function generate404() /* : void */ + private function generate404() : void { $this->set('HTTP', 'HTTP/1.0 404 Not Found'); $this->set('Status', 'Status: HTTP/1.0 404 Not Found'); @@ -305,7 +305,7 @@ class Header extends HeaderAbstract * * @since 1.0.0 */ - private function generate406() /* : void */ + private function generate406() : void { $this->set('HTTP', 'HTTP/1.0 406 Not acceptable'); $this->set('Status', 'Status: 406 Not acceptable'); @@ -319,7 +319,7 @@ class Header extends HeaderAbstract * * @since 1.0.0 */ - private function generate407() /* : void */ + private function generate407() : void { \http_response_code(407); } @@ -331,7 +331,7 @@ class Header extends HeaderAbstract * * @since 1.0.0 */ - private function generate503() /* : void */ + private function generate503() : void { $this->set('HTTP', 'HTTP/1.0 503 Service Temporarily Unavailable'); $this->set('Status', 'Status: 503 Service Temporarily Unavailable'); @@ -346,7 +346,7 @@ class Header extends HeaderAbstract * * @since 1.0.0 */ - private function generate500() /* : void */ + private function generate500() : void { $this->set('HTTP', 'HTTP/1.0 500 Internal Server Error'); $this->set('Status', 'Status: 500 Internal Server Error'); diff --git a/Message/Http/Request.php b/Message/Http/Request.php index ea0741cbd..f30189a0e 100644 --- a/Message/Http/Request.php +++ b/Message/Http/Request.php @@ -95,7 +95,7 @@ class Request extends RequestAbstract * * @since 1.0.0 */ - private function init() /* : void */ + private function init() : void { if ($this->uri === null) { $this->initCurrentRequest(); @@ -116,7 +116,7 @@ class Request extends RequestAbstract * * @since 1.0.0 */ - private function initCurrentRequest() /* : void */ + private function initCurrentRequest() : void { $this->uri = new Http(Http::getCurrent()); $this->data = $_GET ?? []; @@ -165,7 +165,7 @@ class Request extends RequestAbstract * * @since 1.0.0 */ - private function cleanupGlobals() /* : void */ + private function cleanupGlobals() : void { unset($_FILES); unset($_GET); @@ -180,7 +180,7 @@ class Request extends RequestAbstract * * @since 1.0.0 */ - private function setupUriBuilder() /* : void */ + private function setupUriBuilder() : void { UriFactory::setQuery('/lang', $this->header->getL11n()->getLanguage()); @@ -205,7 +205,7 @@ class Request extends RequestAbstract /** * {@inheritdoc} */ - public function setUri(UriInterface $uri) /* : void */ + public function setUri(UriInterface $uri) : void { parent::setUri($uri); $this->data += $uri->getQueryArray(); @@ -224,7 +224,7 @@ class Request extends RequestAbstract * * @since 1.0.0 */ - public function createRequestHashs(int $start = 0) /* : void */ + public function createRequestHashs(int $start = 0) : void { $this->hash = []; $pathArray = $this->uri->getPathElements(); @@ -307,7 +307,7 @@ class Request extends RequestAbstract * * @since 1.0.0 */ - public function setBrowser(string $browser) /* : void */ + public function setBrowser(string $browser) : void { $this->browser = $browser; } @@ -348,7 +348,7 @@ class Request extends RequestAbstract * * @since 1.0.0 */ - public function setOS(string $os) /* : void */ + public function setOS(string $os) : void { $this->os = $os; } diff --git a/Message/Http/Response.php b/Message/Http/Response.php index ff36309ae..8516cfd1c 100644 --- a/Message/Http/Response.php +++ b/Message/Http/Response.php @@ -60,7 +60,7 @@ class Response extends ResponseAbstract implements RenderableInterface * * @since 1.0.0 */ - public function setResponse(array $response) /* : void */ + public function setResponse(array $response) : void { $this->response = $response; } diff --git a/Message/Mail/EmailAbstract.php b/Message/Mail/EmailAbstract.php index 91edac091..b12a7098b 100644 --- a/Message/Mail/EmailAbstract.php +++ b/Message/Mail/EmailAbstract.php @@ -125,7 +125,7 @@ class EmailAbstract * * @since 1.0.0 */ - public function disconnect() /* : void */ + public function disconnect() : void { if ($this->con === null) { imap_close($this->con); @@ -143,7 +143,7 @@ class EmailAbstract * * @since 1.0.0 */ - public function connect(string $user = '', string $pass = '') /* : void */ + public function connect(string $user = '', string $pass = '') : void { $this->mailbox = substr($this->mailbox, 0, -1) . ($this->ssl ? '/ssl/validate-cert' : '/novalidate-cert') . '}'; diff --git a/Message/Mail/Imap.php b/Message/Mail/Imap.php index 819ebd6ad..f62b77025 100644 --- a/Message/Mail/Imap.php +++ b/Message/Mail/Imap.php @@ -49,7 +49,7 @@ class Imap extends EmailAbstract * * @since 1.0.0 */ - public function connect(string $user = '', string $pass = '') /* : void */ + public function connect(string $user = '', string $pass = '') : void { $this->mailbox = '{' . $this->host . ':' . $this->port . '/imap}'; parent::connect(); diff --git a/Message/Mail/Mail.php b/Message/Mail/Mail.php index 025edf773..fbe4f515e 100644 --- a/Message/Mail/Mail.php +++ b/Message/Mail/Mail.php @@ -189,7 +189,7 @@ class Mail * * @since 1.0.0 */ - public function setBody(string $body) /* : void */ + public function setBody(string $body) : void { $this->body = $body; } @@ -203,7 +203,7 @@ class Mail * * @since 1.0.0 */ - public function setOverview(string $overview) /* : void */ + public function setOverview(string $overview) : void { $this->overview = $overview; } @@ -217,7 +217,7 @@ class Mail * * @since 1.0.0 */ - public function setEncoding(int $encoding) /* : void */ + public function setEncoding(int $encoding) : void { $this->encoding = $encoding; } diff --git a/Message/Mail/Nntp.php b/Message/Mail/Nntp.php index 5dbe2eecf..7a0ff392b 100644 --- a/Message/Mail/Nntp.php +++ b/Message/Mail/Nntp.php @@ -49,7 +49,7 @@ class Nntp extends EmailAbstract * * @since 1.0.0 */ - public function connect(string $user = '', string $pass = '') /* : void */ + public function connect(string $user = '', string $pass = '') : void { $this->mailbox = '{' . $this->host . ':' . $this->port . '/nntp}'; parent::connect(); diff --git a/Message/Mail/Pop3.php b/Message/Mail/Pop3.php index 767524e0d..26396d403 100644 --- a/Message/Mail/Pop3.php +++ b/Message/Mail/Pop3.php @@ -49,7 +49,7 @@ class Pop3 extends EmailAbstract * * @since 1.0.0 */ - public function connect(string $user = '', string $pass = '') /* : void */ + public function connect(string $user = '', string $pass = '') : void { $this->mailbox = '{' . $this->host . ':' . $this->port . '/pop3}'; parent::connect(); diff --git a/Message/RequestAbstract.php b/Message/RequestAbstract.php index a1492d3b8..4d51a09fe 100644 --- a/Message/RequestAbstract.php +++ b/Message/RequestAbstract.php @@ -122,7 +122,7 @@ abstract class RequestAbstract implements MessageInterface * * @since 1.0.0 */ - public function setUri(UriInterface $uri) /* : void */ + public function setUri(UriInterface $uri) : void { $this->uri = $uri; } @@ -160,7 +160,7 @@ abstract class RequestAbstract implements MessageInterface * * @since 1.0.0 */ - public function setRequestSource(int $source) /* : void */ + public function setRequestSource(int $source) : void { if (!RequestSource::isValidValue($source)) { throw new InvalidEnumValue((string) $source); @@ -187,7 +187,7 @@ abstract class RequestAbstract implements MessageInterface * * @since 1.0.0 */ - public function setMethod(string $method) /* : void */ + public function setMethod(string $method) : void { $this->method = $method; } @@ -258,7 +258,7 @@ abstract class RequestAbstract implements MessageInterface * * @since 1.0.0 */ - public function lock() /* : void */ + public function lock() : void { $this->lock = true; } diff --git a/Message/ResponseAbstract.php b/Message/ResponseAbstract.php index d8392eba8..08ca93dae 100644 --- a/Message/ResponseAbstract.php +++ b/Message/ResponseAbstract.php @@ -65,7 +65,7 @@ abstract class ResponseAbstract implements MessageInterface, \JsonSerializable * * @since 1.0.0 */ - public function set($key, $response, bool $overwrite = true) /* : void */ + public function set($key, $response, bool $overwrite = true) : void { // This is not working since the key kontains :: from http:// //$this->response = ArrayUtils::setArray((string) $key, $this->response, $response, ':', $overwrite); diff --git a/Model/Html/Head.php b/Model/Html/Head.php index 277446537..187deaeaf 100644 --- a/Model/Html/Head.php +++ b/Model/Html/Head.php @@ -132,7 +132,7 @@ class Head implements RenderableInterface * * @since 1.0.0 */ - public function setTitle(string $title) /* : void */ + public function setTitle(string $title) : void { $this->title = $title; } @@ -147,7 +147,7 @@ class Head implements RenderableInterface * * @since 1.0.0 */ - public function addAsset(int $type, string $uri) /* : void */ + public function addAsset(int $type, string $uri) : void { $this->assets[$uri] = $type; } @@ -161,7 +161,7 @@ class Head implements RenderableInterface * * @since 1.0.0 */ - public function setLanguage(string $language) /* : void */ + public function setLanguage(string $language) : void { $this->language = $language; } @@ -241,7 +241,7 @@ class Head implements RenderableInterface * * @since 1.0.0 */ - public function setStyle(string $key, string $style, bool $overwrite = true) /* : void */ + public function setStyle(string $key, string $style, bool $overwrite = true) : void { if ($overwrite || !isset($this->script[$key])) { $this->style[$key] = $style; @@ -259,7 +259,7 @@ class Head implements RenderableInterface * * @since 1.0.0 */ - public function setScript(string $key, string $script, bool $overwrite = true) /* : void */ + public function setScript(string $key, string $script, bool $overwrite = true) : void { if ($overwrite || !isset($this->script[$key])) { $this->script[$key] = $script; diff --git a/Model/Html/Meta.php b/Model/Html/Meta.php index 5bf486499..5145f36a4 100644 --- a/Model/Html/Meta.php +++ b/Model/Html/Meta.php @@ -69,7 +69,7 @@ class Meta implements RenderableInterface * * @since 1.0.0 */ - public function addKeyword(string $keyword) /* : void */ + public function addKeyword(string $keyword) : void { if (!in_array($keyword, $this->keywords)) { $this->keywords[] = $keyword; @@ -109,7 +109,7 @@ class Meta implements RenderableInterface * * @since 1.0.0 */ - public function setAuthor(string $author) /* : void */ + public function setAuthor(string $author) : void { $this->author = $author; } @@ -135,7 +135,7 @@ class Meta implements RenderableInterface * * @since 1.0.0 */ - public function setCharset(string $charset) /* : void */ + public function setCharset(string $charset) : void { $this->charset = $charset; } @@ -161,7 +161,7 @@ class Meta implements RenderableInterface * * @since 1.0.0 */ - public function setDescription(string $description) /* : void */ + public function setDescription(string $description) : void { $this->description = $description; } diff --git a/Module/InfoManager.php b/Module/InfoManager.php index 1152fd217..19fa3de4f 100644 --- a/Module/InfoManager.php +++ b/Module/InfoManager.php @@ -79,7 +79,7 @@ class InfoManager * * @since 1.0.0 */ - public function load() /* : void */ + public function load() : void { if (!file_exists($this->path)) { throw new PathException($this->path); @@ -95,7 +95,7 @@ class InfoManager * * @since 1.0.0 */ - public function update() /* : void */ + public function update() : void { if (!file_exists($this->path)) { throw new PathException((string) $this->path); @@ -115,7 +115,7 @@ class InfoManager * * @since 1.0.0 */ - public function set(string $path, $data, string $delim = '/') /* : void */ + public function set(string $path, $data, string $delim = '/') : void { if (!is_scalar($data) && !is_array($data) && !($data instanceof \JsonSerializable)) { throw new \InvalidArgumentException('Type of $data "' . gettype($data) . '" is not supported.'); diff --git a/Module/InstallerAbstract.php b/Module/InstallerAbstract.php index 8c4200ced..c26bdca4d 100644 --- a/Module/InstallerAbstract.php +++ b/Module/InstallerAbstract.php @@ -42,7 +42,7 @@ class InstallerAbstract * * @since 1.0.0 */ - public static function registerInDatabase(DatabasePool $dbPool, InfoManager $info) /* : void */ + public static function registerInDatabase(DatabasePool $dbPool, InfoManager $info) : void { switch ($dbPool->get()->getType()) { case DatabaseType::MYSQL: @@ -96,7 +96,7 @@ class InstallerAbstract * * @since 1.0.0 */ - public static function install(string $modulePath, DatabasePool $dbPool, InfoManager $info) /* : void */ + public static function install(string $modulePath, DatabasePool $dbPool, InfoManager $info) : void { self::registerInDatabase($dbPool, $info); self::initRoutes($modulePath, $info); @@ -113,7 +113,7 @@ class InstallerAbstract * * @since 1.0.0 */ - private static function activate(DatabasePool $dbPool, InfoManager $info) /* : void */ + private static function activate(DatabasePool $dbPool, InfoManager $info) : void { /** @var ActivateAbstract $class */ $class = '\Modules\\' . $info->getDirectory() . '\Admin\Status'; @@ -130,7 +130,7 @@ class InstallerAbstract * * @since 1.0.0 */ - public static function reInit(string $modulePath, InfoManager $info) /* : void */ + public static function reInit(string $modulePath, InfoManager $info) : void { self::initRoutes($modulePath, $info); } @@ -147,7 +147,7 @@ class InstallerAbstract * * @since 1.0.0 */ - private static function initRoutes(string $modulePath, InfoManager $info) /* : void */ + private static function initRoutes(string $modulePath, InfoManager $info) : void { // todo: maybe use static::__DIR__ ? $directories = new Directory($modulePath . '/Admin/Routes'); @@ -173,7 +173,7 @@ class InstallerAbstract * * @since 1.0.0 */ - private static function installRoutes(string $destRoutePath, string $srcRoutePath) /* : void */ + private static function installRoutes(string $destRoutePath, string $srcRoutePath) : void { if (!file_exists($destRoutePath)) { file_put_contents($destRoutePath, 'receiving[] = $module; } diff --git a/Module/ModuleFactory.php b/Module/ModuleFactory.php index 1f2f1f491..f370967e5 100644 --- a/Module/ModuleFactory.php +++ b/Module/ModuleFactory.php @@ -99,7 +99,7 @@ class ModuleFactory * * @since 1.0.0 */ - private static function registerRequesting(ModuleAbstract $obj) /* : void */ + private static function registerRequesting(ModuleAbstract $obj) : void { foreach ($obj->getProviding() as $providing) { if (isset(self::$loaded[$providing])) { @@ -119,7 +119,7 @@ class ModuleFactory * * @since 1.0.0 */ - private static function registerProvided(ModuleAbstract $obj) /* : void */ + private static function registerProvided(ModuleAbstract $obj) : void { $name = $obj->getName(); if (isset(self::$providing[$name])) { diff --git a/Module/ModuleManager.php b/Module/ModuleManager.php index 0b225c055..32e358c2b 100644 --- a/Module/ModuleManager.php +++ b/Module/ModuleManager.php @@ -361,7 +361,7 @@ class ModuleManager * * @since 1.0.0 */ - private function deactivateModule(InfoManager $info) /* : void */ + private function deactivateModule(InfoManager $info) : void { $class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Status'; @@ -419,7 +419,7 @@ class ModuleManager * * @since 1.0.0 */ - private function activateModule(InfoManager $info) /* : void */ + private function activateModule(InfoManager $info) : void { $class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Status'; @@ -442,7 +442,7 @@ class ModuleManager * * @since 1.0.0 */ - public function reInit(string $module) /* : void */ + public function reInit(string $module) : void { $info = $this->loadInfo($module); $class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Installer'; @@ -512,7 +512,7 @@ class ModuleManager * * @since 1.0.0 */ - private function installDependencies(array $dependencies) /* : void */ + private function installDependencies(array $dependencies) : void { foreach ($dependencies as $key => $version) { $this->install($key); @@ -530,7 +530,7 @@ class ModuleManager * * @since 1.0.0 */ - private function installModule(InfoManager $info) /* : void */ + private function installModule(InfoManager $info) : void { $class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Installer'; @@ -554,7 +554,7 @@ class ModuleManager * * @since 1.0.0 */ - public function installProviding(string $from, string $for) /* : void */ + public function installProviding(string $from, string $for) : void { if (file_exists($this->modulePath . '/' . $from . '/Admin/Install/' . $for . '.php')) { $class = '\\Modules\\' . $from . '\\Admin\\Install\\' . $for; @@ -597,7 +597,7 @@ class ModuleManager * * @since 1.0.0 */ - public function initModule($modules) /* : void */ + public function initModule($modules) : void { $modules = (array) $modules; @@ -623,7 +623,7 @@ class ModuleManager * * @since 1.0.0 */ - private function initModuleController(string $module) /* : void */ + private function initModuleController(string $module) : void { try { $this->running[$module] = ModuleFactory::getInstance($module, $this->app); @@ -642,7 +642,7 @@ class ModuleManager * * @since 1.0.0 */ - public function initRequestModules(Request $request) /* : void */ + public function initRequestModules(Request $request) : void { $toInit = $this->getRoutedModules($request); diff --git a/Module/PackageManager.php b/Module/PackageManager.php index 37f8bd5d1..729666c50 100644 --- a/Module/PackageManager.php +++ b/Module/PackageManager.php @@ -88,7 +88,7 @@ class PackageManager * * @since 1.0.0 */ - public function extract(string $path) /* : void */ + public function extract(string $path) : void { $this->extractPath = $path; Zip::unpack($this->path, $this->extractPath); @@ -103,7 +103,7 @@ class PackageManager * * @since 1.0.0 */ - public function load() /* : void */ + public function load() : void { if (!file_exists($this->extractPath)) { throw new PathException($this->extractPath); @@ -156,7 +156,7 @@ class PackageManager * * @since 1.0.0 */ - public function install() /* : void */ + public function install() : void { if (!$this->isValid()) { throw new \Exception(); diff --git a/Module/StatusAbstract.php b/Module/StatusAbstract.php index 8d87d7778..afd40704e 100644 --- a/Module/StatusAbstract.php +++ b/Module/StatusAbstract.php @@ -39,7 +39,7 @@ class StatusAbstract * * @since 1.0.0 */ - public static function activate(DatabasePool $dbPool, InfoManager $info) /* : void */ + public static function activate(DatabasePool $dbPool, InfoManager $info) : void { self::activateRoutes(__DIR__ . '/../../Web/Routes.php', __DIR__ . '/../../Modules/' . $info->getDirectory() . '/Admin/Routes/http.php'); self::activateInDatabase($dbPool, $info); @@ -55,7 +55,7 @@ class StatusAbstract * * @since 1.0.0 */ - private static function activateRoutes(string $destRoutePath, string $srcRoutePath) /* : void */ + private static function activateRoutes(string $destRoutePath, string $srcRoutePath) : void { // todo: remove route } @@ -70,7 +70,7 @@ class StatusAbstract * * @since 1.0.0 */ - public static function activateInDatabase(DatabasePool $dbPool, InfoManager $info) /* : void */ + public static function activateInDatabase(DatabasePool $dbPool, InfoManager $info) : void { switch ($dbPool->get()->getType()) { case DatabaseType::MYSQL: @@ -102,7 +102,7 @@ class StatusAbstract * * @since 1.0.0 */ - public static function deactivate(DatabasePool $dbPool, InfoManager $info) /* : void */ + public static function deactivate(DatabasePool $dbPool, InfoManager $info) : void { self::deactivateRoutes(__DIR__ . '/../../Web/Routes.php', __DIR__ . '/../../Modules/' . $info->getDirectory() . '/Admin/Routes/http.php'); self::deactivateInDatabase($dbPool, $info); @@ -118,7 +118,7 @@ class StatusAbstract * * @since 1.0.0 */ - private static function deactivateRoutes(string $destRoutePath, string $srcRoutePath) /* : void */ + private static function deactivateRoutes(string $destRoutePath, string $srcRoutePath) : void { // todo: remove route } @@ -133,7 +133,7 @@ class StatusAbstract * * @since 1.0.0 */ - public static function deactivateInDatabase(DatabasePool $dbPool, InfoManager $info) /* : void */ + public static function deactivateInDatabase(DatabasePool $dbPool, InfoManager $info) : void { switch ($dbPool->get()->getType()) { case DatabaseType::MYSQL: diff --git a/Module/UninstallerAbstract.php b/Module/UninstallerAbstract.php index bd42b65a5..939d762b6 100644 --- a/Module/UninstallerAbstract.php +++ b/Module/UninstallerAbstract.php @@ -37,7 +37,7 @@ class UninstallerAbstract * * @since 1.0.0 */ - public static function uninstall(DatabasePool $dbPool, InfoManager $info) /* : void */ + public static function uninstall(DatabasePool $dbPool, InfoManager $info) : void { } diff --git a/Module/UpdaterAbstract.php b/Module/UpdaterAbstract.php index 713e985df..2ff97fa92 100644 --- a/Module/UpdaterAbstract.php +++ b/Module/UpdaterAbstract.php @@ -37,7 +37,7 @@ class UpdaterAbstract * * @since 1.0.0 */ - public static function update(DatabasePool $dbPool, InfoManager $info) /* : void */ + public static function update(DatabasePool $dbPool, InfoManager $info) : void { } } diff --git a/Router/Router.php b/Router/Router.php index 33c578050..f56194358 100644 --- a/Router/Router.php +++ b/Router/Router.php @@ -76,7 +76,7 @@ class Router * * @since 1.0.0 */ - public function add(string $route, $destination, int $verb = RouteVerb::GET) /* : void */ + public function add(string $route, $destination, int $verb = RouteVerb::GET) : void { if (!isset($this->routes[$route])) { $this->routes[$route] = []; diff --git a/Socket/Client/Client.php b/Socket/Client/Client.php index 0fe9f58d6..bcce8afd6 100644 --- a/Socket/Client/Client.php +++ b/Socket/Client/Client.php @@ -51,7 +51,7 @@ class Client extends SocketAbstract * * @since 1.0.0 */ - private function disconnect() /* : void */ + private function disconnect() : void { $this->run = false; } diff --git a/Socket/Client/ClientConnection.php b/Socket/Client/ClientConnection.php index 7b10bf6ff..f13a7aacb 100644 --- a/Socket/Client/ClientConnection.php +++ b/Socket/Client/ClientConnection.php @@ -46,7 +46,7 @@ class ClientConnection return $this->socket; } - public function setSocket($socket) /* : void */ + public function setSocket($socket) : void { $this->socket = $socket; } @@ -56,7 +56,7 @@ class ClientConnection return $this->handshake; } - public function setHandshake($handshake) /* : void */ + public function setHandshake($handshake) : void { $this->handshake = $handshake; } @@ -66,7 +66,7 @@ class ClientConnection return $this->pid; } - public function setPid($pid) /* : void */ + public function setPid($pid) : void { $this->pid = $pid; } @@ -76,7 +76,7 @@ class ClientConnection return $this->connected; } - public function setConnected(bool $connected) /* : void */ + public function setConnected(bool $connected) : void { $this->connected = $connected; } diff --git a/Socket/Packets/Header.php b/Socket/Packets/Header.php index 59aa58998..7bb582dc2 100644 --- a/Socket/Packets/Header.php +++ b/Socket/Packets/Header.php @@ -59,7 +59,7 @@ class Header implements \Serializable return $this->sendFrom; } - public function setSendFrom($sendFrom) /* : void */ + public function setSendFrom($sendFrom) : void { $this->sendFrom = $sendFrom; } @@ -69,7 +69,7 @@ class Header implements \Serializable return $this->sendTo; } - public function setSendTo($sendTo) /* : void */ + public function setSendTo($sendTo) : void { $this->sendTo = $sendTo; } @@ -91,7 +91,7 @@ class Header implements \Serializable * * @since 1.0.0 */ - public function setLength($length) /* : void */ + public function setLength($length) : void { $this->length = $length; } @@ -113,7 +113,7 @@ class Header implements \Serializable * * @since 1.0.0 */ - public function setType(int $type) /* : void */ + public function setType(int $type) : void { $this->type = $type; } @@ -135,7 +135,7 @@ class Header implements \Serializable * * @since 1.0.0 */ - public function setSubtype($subtype) /* : void */ + public function setSubtype($subtype) : void { $this->subtype = $subtype; } diff --git a/Socket/Packets/PacketAbstract.php b/Socket/Packets/PacketAbstract.php index abc90ae27..fb7e8e941 100644 --- a/Socket/Packets/PacketAbstract.php +++ b/Socket/Packets/PacketAbstract.php @@ -91,7 +91,7 @@ abstract class PacketAbstract implements \Serializable * * @since 1.0.0 */ - public function setHeader(Header $header) /* : void */ + public function setHeader(Header $header) : void { $this->header = $header; } diff --git a/Socket/Server/Server.php b/Socket/Server/Server.php index f026c8310..64e5c5cb6 100644 --- a/Socket/Server/Server.php +++ b/Socket/Server/Server.php @@ -120,7 +120,7 @@ class Server extends SocketAbstract * * @since 1.0.0 */ - public function setLimit(int $limit) /* : void */ + public function setLimit(int $limit) : void { $this->limit = $limit; } diff --git a/Stdlib/Base/Address.php b/Stdlib/Base/Address.php index 0019ad942..9a74a31a7 100644 --- a/Stdlib/Base/Address.php +++ b/Stdlib/Base/Address.php @@ -80,7 +80,7 @@ class Address implements \JsonSerializable * * @since 1.0.0 */ - public function setRecipient(string $recipient) /* : void */ + public function setRecipient(string $recipient) : void { $this->recipient = $recipient; } @@ -106,7 +106,7 @@ class Address implements \JsonSerializable * * @since 1.0.0 */ - public function setFAO(string $fao) /* : void */ + public function setFAO(string $fao) : void { $this->fao = $fao; } @@ -132,7 +132,7 @@ class Address implements \JsonSerializable * * @since 1.0.0 */ - public function setLocation(Location $location) /* : void */ + public function setLocation(Location $location) : void { $this->location = $location; } diff --git a/Stdlib/Base/Iban.php b/Stdlib/Base/Iban.php index bb71f0927..4312cd026 100644 --- a/Stdlib/Base/Iban.php +++ b/Stdlib/Base/Iban.php @@ -55,7 +55,7 @@ class Iban implements \Serializable * * @since 1.0.0 */ - private function parse(string $iban) /* : void */ + private function parse(string $iban) : void { $this->iban = self::normalize($iban); diff --git a/Stdlib/Base/Location.php b/Stdlib/Base/Location.php index b3cbf23b1..4fed3e89c 100644 --- a/Stdlib/Base/Location.php +++ b/Stdlib/Base/Location.php @@ -131,7 +131,7 @@ class Location implements \JsonSerializable, \Serializable * * @since 1.0.0 */ - public function setType(int $type) /* : void */ + public function setType(int $type) : void { $this->type = $type; } @@ -157,7 +157,7 @@ class Location implements \JsonSerializable, \Serializable * * @since 1.0.0 */ - public function setPostal(string $postal) /* : void */ + public function setPostal(string $postal) : void { $this->postal = $postal; } @@ -183,7 +183,7 @@ class Location implements \JsonSerializable, \Serializable * * @since 1.0.0 */ - public function setCity(string $city) /* : void */ + public function setCity(string $city) : void { $this->city = $city; } @@ -209,7 +209,7 @@ class Location implements \JsonSerializable, \Serializable * * @since 1.0.0 */ - public function setCountry(string $country) /* : void */ + public function setCountry(string $country) : void { $this->country = $country; } @@ -235,7 +235,7 @@ class Location implements \JsonSerializable, \Serializable * * @since 1.0.0 */ - public function setAddress(string $address) /* : void */ + public function setAddress(string $address) : void { $this->address = $address; } @@ -261,7 +261,7 @@ class Location implements \JsonSerializable, \Serializable * * @since 1.0.0 */ - public function setState(string $state) /* : void */ + public function setState(string $state) : void { $this->state = $state; } @@ -287,7 +287,7 @@ class Location implements \JsonSerializable, \Serializable * * @since 1.0.0 */ - public function setGeo(array $geo) /* : void */ + public function setGeo(array $geo) : void { $this->geo = $geo; } diff --git a/Stdlib/Graph/BinaryTree.php b/Stdlib/Graph/BinaryTree.php index cc6f2f387..806d852c1 100644 --- a/Stdlib/Graph/BinaryTree.php +++ b/Stdlib/Graph/BinaryTree.php @@ -127,7 +127,7 @@ class BinaryTree extends Tree * * @since 1.0.0 */ - public function inOrder(Node $node, \Closure $callback) /* : void */ + public function inOrder(Node $node, \Closure $callback) : void { $this->inOrder($this->getLeft($node), $callback); $callback($node); @@ -145,7 +145,7 @@ class BinaryTree extends Tree * * @since 1.0.0 */ - private function getVerticalOrder(Node $node, int $horizontalDistance = 0, array &$order) /* : void */ + private function getVerticalOrder(Node $node, int $horizontalDistance = 0, array &$order) : void { if (!isset($order[$horizontalDistance])) { $order[$horizontalDistance] = []; @@ -174,7 +174,7 @@ class BinaryTree extends Tree * * @since 1.0.0 */ - public function verticalOrder(Node $node, \Closure $callback) /* : void */ + public function verticalOrder(Node $node, \Closure $callback) : void { $order = []; $this->getVerticalOrder($node, 0, $order); diff --git a/Stdlib/Graph/Tree.php b/Stdlib/Graph/Tree.php index 744e5a063..af793fdbc 100644 --- a/Stdlib/Graph/Tree.php +++ b/Stdlib/Graph/Tree.php @@ -214,7 +214,7 @@ class Tree extends Graph * * @since 1.0.0 */ - public function preOrder(Node $node, \Closure $callback) /* : void */ + public function preOrder(Node $node, \Closure $callback) : void { if (count($this->nodes) === 0) { return; @@ -239,7 +239,7 @@ class Tree extends Graph * * @since 1.0.0 */ - public function postOrder(Node $node, \Closure $callback) /* : void */ + public function postOrder(Node $node, \Closure $callback) : void { if (count($this->nodes) === 0) { return; diff --git a/Stdlib/Map/MultiMap.php b/Stdlib/Map/MultiMap.php index 610b4c387..4a3a19cd3 100644 --- a/Stdlib/Map/MultiMap.php +++ b/Stdlib/Map/MultiMap.php @@ -119,7 +119,7 @@ class MultiMap implements \Countable * * @since 1.0.0 */ - private function garbageCollect() /* : void */ + private function garbageCollect() : void { /* garbage collect keys */ foreach ($this->keys as $key => $keyValue) { diff --git a/Stdlib/Queue/PriorityQueue.php b/Stdlib/Queue/PriorityQueue.php index 52f3e8a0d..d6fe112ac 100644 --- a/Stdlib/Queue/PriorityQueue.php +++ b/Stdlib/Queue/PriorityQueue.php @@ -93,7 +93,7 @@ class PriorityQueue implements \Countable, \Serializable * * @since 1.0.0 */ - public function increaseAll(float $increase = 0.1) /* : void */ + public function increaseAll(float $increase = 0.1) : void { foreach ($this->queue as $key => &$ele) { $ele['priority'] += $increase; @@ -121,7 +121,7 @@ class PriorityQueue implements \Countable, \Serializable * * @since 1.0.0 */ - public function delete(int $id = null) /* : void */ + public function delete(int $id = null) : void { if ($id === null) { $this->remove(); @@ -152,7 +152,7 @@ class PriorityQueue implements \Countable, \Serializable * * @since 1.0.0 */ - public function setPriority(int $id, float $priority) /* : void */ + public function setPriority(int $id, float $priority) : void { $this->queue[$id]['priority'] = $priority; } diff --git a/System/File/Local/Directory.php b/System/File/Local/Directory.php index ab41e5ece..df2a5028c 100644 --- a/System/File/Local/Directory.php +++ b/System/File/Local/Directory.php @@ -124,7 +124,7 @@ class Directory extends FileAbstract implements DirectoryInterface /** * {@inheritdoc} */ - public function index() /* : void */ + public function index() : void { parent::index(); diff --git a/System/File/Local/File.php b/System/File/Local/File.php index c4b586edd..a670cdbed 100644 --- a/System/File/Local/File.php +++ b/System/File/Local/File.php @@ -52,7 +52,7 @@ class File extends FileAbstract implements FileInterface /** * {@inheritdoc} */ - public function index() /* : void */ + public function index() : void { parent::index(); diff --git a/System/File/Local/FileAbstract.php b/System/File/Local/FileAbstract.php index 244aac314..d477d91e5 100644 --- a/System/File/Local/FileAbstract.php +++ b/System/File/Local/FileAbstract.php @@ -183,7 +183,7 @@ abstract class FileAbstract implements ContainerInterface /** * {@inheritdoc} */ - public function index() /* : void */ + public function index() : void { $this->createdAt->setTimestamp(filemtime($this->path)); $this->changedAt->setTimestamp(filectime($this->path)); diff --git a/UnhandledHandler.php b/UnhandledHandler.php index f33031b73..52b4cdf41 100644 --- a/UnhandledHandler.php +++ b/UnhandledHandler.php @@ -35,7 +35,7 @@ final class UnhandledHandler * @since 1.0.0 * @codeCoverageIgnore */ - public static function exceptionHandler(\Throwable $e) /* : void */ + public static function exceptionHandler(\Throwable $e) : void { $logger = FileLogger::getInstance(__DIR__ . '/../Logs'); $logger->critical(FileLogger::MSG_FULL, [ @@ -93,7 +93,7 @@ final class UnhandledHandler * @since 1.0.0 * @codeCoverageIgnore */ - public static function shutdownHandler() /* : void */ + public static function shutdownHandler() : void { $e = error_get_last(); diff --git a/Uri/Http.php b/Uri/Http.php index ae5535746..cf727d708 100644 --- a/Uri/Http.php +++ b/Uri/Http.php @@ -142,7 +142,7 @@ class Http implements UriInterface /** * {@inheritdoc} */ - public function set(string $uri) /* : void */ + public function set(string $uri) : void { $this->uri = $uri; $url = parse_url($this->uri); @@ -203,7 +203,7 @@ class Http implements UriInterface /** * {@inheritdoc} */ - public function setRootPath(string $root) /* : void */ + public function setRootPath(string $root) : void { $this->rootPath = $root; $this->set($this->uri); diff --git a/Uri/UriFactory.php b/Uri/UriFactory.php index 723dce545..f19e0e29e 100644 --- a/Uri/UriFactory.php +++ b/Uri/UriFactory.php @@ -54,7 +54,7 @@ class UriFactory * * @since 1.0.0 */ - public static function getQuery(string $key) /* : ?string */ + public static function getQuery(string $key) : ?string { return self::$uri[$key] ?? null; } @@ -104,7 +104,7 @@ class UriFactory * * @since 1.0.0 */ - public static function setupUriBuilder(UriInterface $uri) /* : void */ + public static function setupUriBuilder(UriInterface $uri) : void { self::setQuery('/scheme', $uri->getScheme()); self::setQuery('/host', $uri->getHost()); @@ -225,7 +225,7 @@ class UriFactory * * @since 1.0.0 */ - public static function build(string $uri, array $toMatch = []) /* : ?string */ + public static function build(string $uri, array $toMatch = []) : ?string { $parsed = preg_replace_callback('(\{[\/#\?%@\.\$][a-zA-Z0-9\-]*\})', function ($match) use ($toMatch) { $match = substr($match[0], 1, strlen($match[0]) - 2); diff --git a/Utils/ArrayUtils.php b/Utils/ArrayUtils.php index add7177be..79bbcd0d0 100644 --- a/Utils/ArrayUtils.php +++ b/Utils/ArrayUtils.php @@ -284,7 +284,7 @@ class ArrayUtils * * @since 1.0.0 */ - public static function getArg(string $id, array $args) /* : ?string */ + public static function getArg(string $id, array $args) : ?string { if (($key = array_search($id, $args)) === false || $key === count($args) - 1) { return null; @@ -303,7 +303,7 @@ class ArrayUtils * * @since 1.0.0 */ - public static function hasArg(string $id, array $args) /* : ?int */ + public static function hasArg(string $id, array $args) : ?int { if (($key = array_search($id, $args)) === false) { return null; diff --git a/Utils/Barcode/C128Abstract.php b/Utils/Barcode/C128Abstract.php index 323a57dec..1b9781406 100644 --- a/Utils/Barcode/C128Abstract.php +++ b/Utils/Barcode/C128Abstract.php @@ -150,7 +150,7 @@ abstract class C128Abstract * * @since 1.0.0 */ - public function setDimension(int $width, int $height) /* : void */ + public function setDimension(int $width, int $height) : void { if ($width < 0) { throw new \OutOfBoundsException($width); @@ -173,7 +173,7 @@ abstract class C128Abstract * * @since 1.0.0 */ - public function setMargin(int $margin) /* : void */ + public function setMargin(int $margin) : void { $this->margin = $margin; } @@ -187,7 +187,7 @@ abstract class C128Abstract * * @since 1.0.0 */ - public function setOrientation(int $orientation) /* : void */ + public function setOrientation(int $orientation) : void { if (!OrientationType::isValidValue($orientation)) { throw new InvalidEnumValue($orientation); @@ -217,7 +217,7 @@ abstract class C128Abstract * * @since 1.0.0 */ - public function setContent(string $content) /* : void */ + public function setContent(string $content) : void { $this->content = $content; } @@ -245,7 +245,7 @@ abstract class C128Abstract * * @since 1.0.0 */ - public function saveToPngFile(string $file) /* : void */ + public function saveToPngFile(string $file) : void { $res = $this->get(); @@ -262,7 +262,7 @@ abstract class C128Abstract * * @since 1.0.0 */ - public function saveToJpgFile(string $file) /* : void */ + public function saveToJpgFile(string $file) : void { $res = $this->get(); diff --git a/Utils/Barcode/C128a.php b/Utils/Barcode/C128a.php index 2f41fee13..a943ee808 100644 --- a/Utils/Barcode/C128a.php +++ b/Utils/Barcode/C128a.php @@ -91,7 +91,7 @@ class C128a extends C128Abstract * * @since 1.0.0 */ - public function setContent(string $content) /* : void */ + public function setContent(string $content) : void { parent::setContent(strtoupper($content)); } diff --git a/Utils/Barcode/C25.php b/Utils/Barcode/C25.php index db58751dc..4d98c21bc 100644 --- a/Utils/Barcode/C25.php +++ b/Utils/Barcode/C25.php @@ -92,7 +92,7 @@ class C25 extends C128Abstract * * @since 1.0.0 */ - public function setContent(string $content) /* : void */ + public function setContent(string $content) : void { if (!ctype_digit($content)) { throw new \InvalidArgumentException($content); diff --git a/Utils/Barcode/C39.php b/Utils/Barcode/C39.php index fa78a5f3f..a3f6e84d4 100644 --- a/Utils/Barcode/C39.php +++ b/Utils/Barcode/C39.php @@ -70,7 +70,7 @@ class C39 extends C128Abstract * * @since 1.0.0 */ - public function setContent(string $content) /* : void */ + public function setContent(string $content) : void { parent::setContent(strtoupper($content)); } diff --git a/Utils/Barcode/Codebar.php b/Utils/Barcode/Codebar.php index 881eb23e4..4aa6dec42 100644 --- a/Utils/Barcode/Codebar.php +++ b/Utils/Barcode/Codebar.php @@ -71,7 +71,7 @@ class Codebar extends C128Abstract * * @since 1.0.0 */ - public function setContent(string $content) /* : void */ + public function setContent(string $content) : void { parent::setContent(strtoupper($content)); } diff --git a/Utils/Barcode/HIBCC.php b/Utils/Barcode/HIBCC.php index f9c9fe518..38a0d3d41 100644 --- a/Utils/Barcode/HIBCC.php +++ b/Utils/Barcode/HIBCC.php @@ -45,7 +45,7 @@ class HIBCC } - public function setIdentifier(string $identifier) /* : void */ + public function setIdentifier(string $identifier) : void { $this->identifier = $identifier; } @@ -55,7 +55,7 @@ class HIBCC return $this->identifier; } - public function setProductId(string $id) /* : void */ + public function setProductId(string $id) : void { $this->productId = $id; } @@ -65,7 +65,7 @@ class HIBCC return $this->productId; } - public function setMeasureOfUnit(int $measure) /* : void */ + public function setMeasureOfUnit(int $measure) : void { $this->measureOfUnit = $measure; } @@ -75,7 +75,7 @@ class HIBCC return $this->measureOfUnit; } - public function setDateFormat(string $format) /* : void */ + public function setDateFormat(string $format) : void { $this->dateFormat = $format; } @@ -85,7 +85,7 @@ class HIBCC return $this->dateFormat(); } - public function setExpirationDate(\DateTime $date) /* : void */ + public function setExpirationDate(\DateTime $date) : void { $this->expirationDate = $date; } @@ -95,7 +95,7 @@ class HIBCC return $this->expirationDate; } - public function setPrductionDate(\DateTime $date) /* : void */ + public function setPrductionDate(\DateTime $date) : void { $this->productionDate = $date; } @@ -105,7 +105,7 @@ class HIBCC return $this->productionDate; } - public function setLot(string $lot) /* : void */ + public function setLot(string $lot) : void { $this->lot = $lot; } diff --git a/Utils/Converter/Currency.php b/Utils/Converter/Currency.php index 6b1cf8a75..580b88814 100644 --- a/Utils/Converter/Currency.php +++ b/Utils/Converter/Currency.php @@ -58,7 +58,7 @@ class Currency * * @since 1.0.0 */ - public static function resetCurrencies() /* : void */ + public static function resetCurrencies() : void { self::$ecbCurrencies = null; } diff --git a/Utils/Encoding/Huffman/Dictionary.php b/Utils/Encoding/Huffman/Dictionary.php index ba39c5b08..5ce9b3aca 100644 --- a/Utils/Encoding/Huffman/Dictionary.php +++ b/Utils/Encoding/Huffman/Dictionary.php @@ -71,7 +71,7 @@ final class Dictionary * * @since 1.0.0 */ - public function generate(string $source) /* : void */ + public function generate(string $source) : void { $this->dictionary = []; $this->min = -1; @@ -105,7 +105,7 @@ final class Dictionary * * @since 1.0.0 */ - private function fill(array $entry, string $value = '') /* : void */ + private function fill(array $entry, string $value = '') : void { if (!is_array($entry[0][1])) { $this->set($entry[0][1], $value . '0'); @@ -134,7 +134,7 @@ final class Dictionary * * @since 1.0.0 */ - public function set(string $entry, string $value) /* : void */ + public function set(string $entry, string $value) : void { if (strlen($entry) !== 1) { throw new \InvalidArgumentException('Must be a character.'); @@ -194,7 +194,7 @@ final class Dictionary * * @since 1.0.0 */ - public function getEntry(&$value) /* : ?string */ + public function getEntry(&$value) : ?string { $length = strlen($value); if ($length < $this->min) { diff --git a/Utils/Encoding/Huffman/Huffman.php b/Utils/Encoding/Huffman/Huffman.php index 7057185a6..a6257d67d 100644 --- a/Utils/Encoding/Huffman/Huffman.php +++ b/Utils/Encoding/Huffman/Huffman.php @@ -39,7 +39,7 @@ final class Huffman * * @since 1.0.0 */ - public function removeDictionary() /* : void */ + public function removeDictionary() : void { $this->dictionary = null; } @@ -65,7 +65,7 @@ final class Huffman * * @since 1.0.0 */ - public function setDictionary(Dictionary $dictionary) /* : void */ + public function setDictionary(Dictionary $dictionary) : void { $this->dictionary = $dictionary; } diff --git a/Utils/Git/Author.php b/Utils/Git/Author.php index fd532aeab..7439b81a8 100644 --- a/Utils/Git/Author.php +++ b/Utils/Git/Author.php @@ -123,7 +123,7 @@ class Author * * @since 1.0.0 */ - public function setCommitCount(int $count) /* : void */ + public function setCommitCount(int $count) : void { $this->commitCount = $count; } @@ -137,7 +137,7 @@ class Author * * @since 1.0.0 */ - public function setAdditionCount(int $count) /* : void */ + public function setAdditionCount(int $count) : void { $this->additionsCount = $count; } @@ -163,7 +163,7 @@ class Author * * @since 1.0.0 */ - public function setRemovalCount(int $count) /* : void */ + public function setRemovalCount(int $count) : void { $this->removalsCount = $count; } diff --git a/Utils/Git/Branch.php b/Utils/Git/Branch.php index 4ccf732e4..2bf596386 100644 --- a/Utils/Git/Branch.php +++ b/Utils/Git/Branch.php @@ -65,7 +65,7 @@ class Branch * * @since 1.0.0 */ - public function setName(string $name) /* : void */ + public function setName(string $name) : void { $this->name = $name; } diff --git a/Utils/Git/Commit.php b/Utils/Git/Commit.php index ce0533da1..6ce575261 100644 --- a/Utils/Git/Commit.php +++ b/Utils/Git/Commit.php @@ -157,7 +157,7 @@ class Commit * * @since 1.0.0 */ - public function setMessage(string $message) /* : void */ + public function setMessage(string $message) : void { $this->message = $message; } @@ -215,7 +215,7 @@ class Commit * * @since 1.0.0 */ - public function setAuthor(Author $author) /* : void */ + public function setAuthor(Author $author) : void { $this->author = $author; } @@ -241,7 +241,7 @@ class Commit * * @since 1.0.0 */ - public function setBranch(Branch $branch) /* : void */ + public function setBranch(Branch $branch) : void { $this->branch = $branch; } @@ -267,7 +267,7 @@ class Commit * * @since 1.0.0 */ - public function setTag(Tag $tag) /* : void */ + public function setTag(Tag $tag) : void { $this->tag = $tag; } @@ -293,7 +293,7 @@ class Commit * * @since 1.0.0 */ - public function setDate(\DateTime $date) /* : void */ + public function setDate(\DateTime $date) : void { $this->date = $date; } @@ -319,7 +319,7 @@ class Commit * * @since 1.0.0 */ - public function setRepository(Repository $repository) /* : void */ + public function setRepository(Repository $repository) : void { $this->repository = $repository; } @@ -338,7 +338,7 @@ class Commit * * @since 1.0.0 */ - private function addChange(string $path, int $line, string $old, string $new) /* : void */ + private function addChange(string $path, int $line, string $old, string $new) : void { if (!isset($this->files[$path])) { throw new \Exception(); diff --git a/Utils/Git/Git.php b/Utils/Git/Git.php index 341f58f11..016eee066 100644 --- a/Utils/Git/Git.php +++ b/Utils/Git/Git.php @@ -80,7 +80,7 @@ class Git * * @since 1.0.0 */ - public static function setBin(string $path) /* : void */ + public static function setBin(string $path) : void { if (realpath($path) === false) { throw new PathException($path); diff --git a/Utils/Git/Repository.php b/Utils/Git/Repository.php index 6c951112d..21c5f06c7 100644 --- a/Utils/Git/Repository.php +++ b/Utils/Git/Repository.php @@ -83,7 +83,7 @@ class Repository * * @since 1.0.0 */ - private function setPath(string $path) /* : void */ + private function setPath(string $path) : void { if (!is_dir($path)) { throw new PathException($path); @@ -601,7 +601,7 @@ class Repository * * @since 1.0.0 */ - public function setDescription(string $description) /* : void */ + public function setDescription(string $description) : void { file_put_contents($this->getDirectoryPath(), $description); } diff --git a/Utils/Git/Tag.php b/Utils/Git/Tag.php index e2ca3edc9..99cf3fe27 100644 --- a/Utils/Git/Tag.php +++ b/Utils/Git/Tag.php @@ -73,7 +73,7 @@ class Tag * * @since 1.0.0 */ - public function setMessage(string $message) /* : void */ + public function setMessage(string $message) : void { $this->message = $message; } diff --git a/Utils/IO/Csv/CsvDatabaseMapper.php b/Utils/IO/Csv/CsvDatabaseMapper.php index 998f3c561..39f182e2c 100644 --- a/Utils/IO/Csv/CsvDatabaseMapper.php +++ b/Utils/IO/Csv/CsvDatabaseMapper.php @@ -44,7 +44,7 @@ class CsvDatabaseMapper implements IODatabaseMapper $this->sources = array_unique($this->sources); } - public function setSources(array $sources) /* : void */ + public function setSources(array $sources) : void { $this->sources = $sources; } @@ -54,7 +54,7 @@ class CsvDatabaseMapper implements IODatabaseMapper $this->autoIdentifyCsvSettings = $identify; } - public function setLineBuffer(int $buffer) /* : void */ + public function setLineBuffer(int $buffer) : void { $this->lineBuffer = $buffer; } diff --git a/Utils/IO/Excel/ExcelDatabaseMapper.php b/Utils/IO/Excel/ExcelDatabaseMapper.php index 1e87fe2d7..63d983e7b 100644 --- a/Utils/IO/Excel/ExcelDatabaseMapper.php +++ b/Utils/IO/Excel/ExcelDatabaseMapper.php @@ -27,12 +27,12 @@ class ExcelDatabaseMapper implements IODatabaseMapper $this->sources[] = $source; } - public function setLineBuffer(int $buffer) /* : void */ + public function setLineBuffer(int $buffer) : void { $this->lineBuffer = $buffer; } - public function setSources(array $sources) /* : void */ + public function setSources(array $sources) : void { $this->sources = $sources; } diff --git a/Utils/JobQueue/Job.php b/Utils/JobQueue/Job.php index 8c4dbfbe1..f32f5240a 100644 --- a/Utils/JobQueue/Job.php +++ b/Utils/JobQueue/Job.php @@ -44,7 +44,7 @@ class Job return $this->priority; } - public function setPriority(float $priority) /* : void */ + public function setPriority(float $priority) : void { $this->priority = $priority; } diff --git a/Utils/JobQueue/JobQueue.php b/Utils/JobQueue/JobQueue.php index b5443a0e3..794cc32d4 100644 --- a/Utils/JobQueue/JobQueue.php +++ b/Utils/JobQueue/JobQueue.php @@ -98,7 +98,7 @@ class JobQueue register_shutdown_function(function() { posix_kill(posix_getpid(), SIGHUP); }); } - public function setRunning(bool $run = true) /* : void */ + public function setRunning(bool $run = true) : void { $this->run = $run; $this->suspended = $run; @@ -114,7 +114,7 @@ class JobQueue return $this->suspended; } - public function setSuspended(bool $suspended = true) /* : void */ + public function setSuspended(bool $suspended = true) : void { $this->suspended = $suspended; } @@ -124,7 +124,7 @@ class JobQueue return $this->isTerminating; } - public function setTerminating(bool $terminating = true) /* : void */ + public function setTerminating(bool $terminating = true) : void { $this->isTerminating = $terminating; } @@ -134,7 +134,7 @@ class JobQueue return $this->isDeamonized; } - public function setDeamonized(bool $deamonized) /* : void */ + public function setDeamonized(bool $deamonized) : void { $this->isDeamonized = $deamonized; } diff --git a/Utils/JsonBuilder.php b/Utils/JsonBuilder.php index 7c24695a2..4e80ed12e 100644 --- a/Utils/JsonBuilder.php +++ b/Utils/JsonBuilder.php @@ -65,7 +65,7 @@ class JsonBuilder implements \Serializable, \JsonSerializable * * @since 1.0.0 */ - public function add(string $path, $value, bool $overwrite = true) /* : void */ + public function add(string $path, $value, bool $overwrite = true) : void { $this->json = ArrayUtils::setArray($path, $this->json, $value, '/', $overwrite); } @@ -79,7 +79,7 @@ class JsonBuilder implements \Serializable, \JsonSerializable * * @since 1.0.0 */ - public function remove(string $path) /* : void */ + public function remove(string $path) : void { $this->json = ArrayUtils::unsetArray($path, $this->json, '/'); } diff --git a/Utils/Parser/Markdown/Markdown.php b/Utils/Parser/Markdown/Markdown.php index 675eec6f5..ce8bc2019 100644 --- a/Utils/Parser/Markdown/Markdown.php +++ b/Utils/Parser/Markdown/Markdown.php @@ -355,7 +355,7 @@ class Markdown * * @since 1.0.0 */ - protected static function blockCode(array $lineArray, array $block = null) /* : ?array */ + protected static function blockCode(array $lineArray, array $block = null) : ?array { if ($block !== null && !isset($block['type']) && !isset($block['interrupted'])) { return; @@ -387,7 +387,7 @@ class Markdown * * @since 1.0.0 */ - protected static function blockCodeContinue(array $lineArray, array $block) /* : ?array */ + protected static function blockCodeContinue(array $lineArray, array $block) : ?array { if ($lineArray['indent'] < 4) { return; @@ -428,7 +428,7 @@ class Markdown * * @since 1.0.0 */ - protected static function blockFencedCode(array $lineArray) /* : ?array */ + protected static function blockFencedCode(array $lineArray) : ?array { if (!preg_match('/^[' . $lineArray['text'][0] . ']{3,}[ ]*([^`]+)?[ ]*$/', $lineArray['text'], $matches)) { return; @@ -465,7 +465,7 @@ class Markdown * * @since 1.0.0 */ - protected static function blockFencedCodeContinue(array $lineArray, array $block) /* : ?array */ + protected static function blockFencedCodeContinue(array $lineArray, array $block) : ?array { if (isset($block['complete'])) { return; @@ -512,7 +512,7 @@ class Markdown * * @since 1.0.0 */ - protected static function blockHeader(array $lineArray) /* : ?array */ + protected static function blockHeader(array $lineArray) : ?array { if (!isset($lineArray['text'][1])) { return; @@ -545,7 +545,7 @@ class Markdown * * @since 1.0.0 */ - protected static function blockList(array $lineArray) /* : ?array */ + protected static function blockList(array $lineArray) : ?array { list($name, $pattern) = $lineArray['text'][0] <= '-' ? ['ul', '[*+-]'] : ['ol', '[0-9]+[.]']; @@ -593,7 +593,7 @@ class Markdown * * @since 1.0.0 */ - protected static function blockListContinue(array $lineArray, array $block) /* : ?array */ + protected static function blockListContinue(array $lineArray, array $block) : ?array { if ($block['indent'] === $lineArray['indent'] && preg_match('/^' . $block['pattern'] . '(?:[ ]+(.*)|$)/', $lineArray['text'], $matches)) { if (isset($block['interrupted'])) { @@ -646,7 +646,7 @@ class Markdown * * @since 1.0.0 */ - protected static function blockQuote(array $lineArray) /* : ?array */ + protected static function blockQuote(array $lineArray) : ?array { if (!preg_match('/^>[ ]?(.*)/', $lineArray['text'], $matches)) { return; @@ -671,7 +671,7 @@ class Markdown * * @since 1.0.0 */ - protected static function blockQuoteContinue(array $lineArray, array $block) /* : ?array */ + protected static function blockQuoteContinue(array $lineArray, array $block) : ?array { if ($lineArray['text'][0] === '>' && preg_match('/^>[ ]?(.*)/', $lineArray['text'], $matches)) { if (isset($block['interrupted'])) { @@ -701,7 +701,7 @@ class Markdown * * @since 1.0.0 */ - protected static function blockRule(array $lineArray) /* : ?array */ + protected static function blockRule(array $lineArray) : ?array { if (!preg_match('/^([' . $lineArray['text'][0] . '])([ ]*\1){2,}[ ]*$/', $lineArray['text'])) { return; @@ -724,7 +724,7 @@ class Markdown * * @since 1.0.0 */ - protected static function blockSetextHeader(array $lineArray, array $block = null) /* : ?array */ + protected static function blockSetextHeader(array $lineArray, array $block = null) : ?array { if (!isset($block) || isset($block['type']) || isset($block['interrupted'])) { return; @@ -748,7 +748,7 @@ class Markdown * * @since 1.0.0 */ - protected static function blockReference(array $lineArray) /* : ?array */ + protected static function blockReference(array $lineArray) : ?array { if (!preg_match('/^\[(.+?)\]:[ ]*?(?:[ ]+["\'(](.+)["\')])?[ ]*$/', $lineArray['text'], $matches)) { return; @@ -774,7 +774,7 @@ class Markdown * * @since 1.0.0 */ - protected static function blockTable($lineArray, array $block = null) /* : ?array */ + protected static function blockTable($lineArray, array $block = null) : ?array { if (!isset($block) || isset($block['type']) || isset($block['interrupted'])) { return; @@ -869,7 +869,7 @@ class Markdown * * @since 1.0.0 */ - protected static function blockTableContinue(array $lineArray, array $block) /* : ?array */ + protected static function blockTableContinue(array $lineArray, array $block) : ?array { if (isset($block['interrupted'])) { return; @@ -989,7 +989,7 @@ class Markdown * * @since 1.0.0 */ - protected static function inlineCode(array $excerpt) /* : ?array */ + protected static function inlineCode(array $excerpt) : ?array { $marker = $excerpt['text'][0]; @@ -1015,7 +1015,7 @@ class Markdown * * @since 1.0.0 */ - protected static function inlineEmailTag(array $excerpt) /* : ?array */ + protected static function inlineEmailTag(array $excerpt) : ?array { if (strpos($excerpt['text'], '>') === false || !preg_match('/^<((mailto:)?\S+?@\S+?)>/i', $excerpt['text'], $matches)) { return; @@ -1048,7 +1048,7 @@ class Markdown * * @since 1.0.0 */ - protected static function inlineEmphasis(array $excerpt) /* : ?array */ + protected static function inlineEmphasis(array $excerpt) : ?array { if (!isset($excerpt['text'][1])) { return; @@ -1083,7 +1083,7 @@ class Markdown * * @since 1.0.0 */ - protected static function inlineEscapeSequence(array $excerpt) /* : ?array */ + protected static function inlineEscapeSequence(array $excerpt) : ?array { if (!isset($excerpt['text'][1]) || !in_array($excerpt['text'][1], self::$specialCharacters)) { return; @@ -1104,7 +1104,7 @@ class Markdown * * @since 1.0.0 */ - protected static function inlineImage(array $excerpt) /* : ?array */ + protected static function inlineImage(array $excerpt) : ?array { if (!isset($excerpt['text'][1]) || $excerpt['text'][1] !== '[') { return; @@ -1144,7 +1144,7 @@ class Markdown * * @since 1.0.0 */ - protected static function inlineLink(array $excerpt) /* : ?array */ + protected static function inlineLink(array $excerpt) : ?array { $element = [ 'name' => 'a', @@ -1210,7 +1210,7 @@ class Markdown * * @since 1.0.0 */ - protected static function inlineSpecialCharacter(array $excerpt) /* : ?array */ + protected static function inlineSpecialCharacter(array $excerpt) : ?array { if ($excerpt['text'][0] === '&' && !preg_match('/^&#?\w+;/', $excerpt['text'])) { return [ @@ -1238,7 +1238,7 @@ class Markdown * * @since 1.0.0 */ - protected static function inlineStrikethrough(array $excerpt) /* : ?array */ + protected static function inlineStrikethrough(array $excerpt) : ?array { if (!isset($excerpt['text'][1])) { return; @@ -1267,7 +1267,7 @@ class Markdown * * @since 1.0.0 */ - protected static function inlineUrl(array $excerpt) /* : ?array */ + protected static function inlineUrl(array $excerpt) : ?array { if (!isset($excerpt['text'][2]) || $excerpt['text'][2] !== '/') { return; @@ -1299,7 +1299,7 @@ class Markdown * * @since 1.0.0 */ - protected static function inlineUrlTag(array $excerpt) /* : ?array */ + protected static function inlineUrlTag(array $excerpt) : ?array { if (strpos($excerpt['text'], '>') === false || !preg_match('/^<(\w+:\/{2}[^ >]+)>/i', $excerpt['text'], $matches)) { return; diff --git a/Utils/RnG/Text.php b/Utils/RnG/Text.php index a3ced84b3..bb2928d69 100644 --- a/Utils/RnG/Text.php +++ b/Utils/RnG/Text.php @@ -83,7 +83,7 @@ class Text * * @since 1.0.0 */ - public function setFormatting(bool $hasFormatting) /* : void */ + public function setFormatting(bool $hasFormatting) : void { $this->hasFormatting = $hasFormatting; } @@ -97,7 +97,7 @@ class Text * * @since 1.0.0 */ - public function setParagraphs(bool $hasParagraphs) /* : void */ + public function setParagraphs(bool $hasParagraphs) : void { $this->hasParagraphs = $hasParagraphs; } @@ -280,7 +280,7 @@ class Text * * @since 1.0.0 */ - private function generateParagraph(int $length) /* : void */ + private function generateParagraph(int $length) : void { $minSentence = 3; $maxSentence = 10; diff --git a/Utils/StringCompare.php b/Utils/StringCompare.php index 0a62dcb0b..d1e2d89c8 100644 --- a/Utils/StringCompare.php +++ b/Utils/StringCompare.php @@ -55,7 +55,7 @@ class StringCompare * * @since 1.0.0 */ - public function add(string $word) /* : void */ + public function add(string $word) : void { $this->dictionary[] = $word; } diff --git a/Utils/TaskSchedule/Interval.php b/Utils/TaskSchedule/Interval.php index bde6b0083..82c39315f 100644 --- a/Utils/TaskSchedule/Interval.php +++ b/Utils/TaskSchedule/Interval.php @@ -231,7 +231,7 @@ class Interval implements \Serializable * * @since 1.0.0 */ - public function setStart(\DateTime $start) /* : void */ + public function setStart(\DateTime $start) : void { $this->start = $start; } @@ -257,7 +257,7 @@ class Interval implements \Serializable * * @since 1.0.0 */ - public function setEnd(\DateTime $end) /* : void */ + public function setEnd(\DateTime $end) : void { $this->end = $end; } @@ -287,7 +287,7 @@ class Interval implements \Serializable * * @since 1.0.0 */ - public function setMinute(array $minute, int $step = 0, bool $any = false) /* : void */ + public function setMinute(array $minute, int $step = 0, bool $any = false) : void { if ($this->validateTime($minute, $step, 0, 59)) { $this->hour = [ @@ -352,7 +352,7 @@ class Interval implements \Serializable * * @since 1.0.0 */ - public function setHour(array $hour, int $step = 0, bool $any = false) /* : void */ + public function setHour(array $hour, int $step = 0, bool $any = false) : void { if ($this->validateTime($hour, $step, 0, 23)) { $this->hour = [ @@ -392,7 +392,7 @@ class Interval implements \Serializable * * @since 1.0.0 */ - public function setDayOfMonth(array $dayOfMonth, int $step = 0, bool $any = false, bool $last = false, int $nearest = 0) /* : void */ + public function setDayOfMonth(array $dayOfMonth, int $step = 0, bool $any = false, bool $last = false, int $nearest = 0) : void { if ($this->validateDayOfMonth($arr = [ 'dayOfMonth' => $dayOfMonth, @@ -461,7 +461,7 @@ class Interval implements \Serializable * * @since 1.0.0 */ - public function setDayOfWeek(array $dayOfWeek, int $step = 0, bool $any = false, bool $last = false) /* : void */ + public function setDayOfWeek(array $dayOfWeek, int $step = 0, bool $any = false, bool $last = false) : void { if ($this->validateDayOfWeek($arr = [ 'dayOfWeek' => $dayOfWeek, @@ -525,7 +525,7 @@ class Interval implements \Serializable * * @since 1.0.0 */ - public function setMonth(array $month, int $step = 0, bool $any = false) /* : void */ + public function setMonth(array $month, int $step = 0, bool $any = false) : void { if ($this->validateTime($month, $step, 1, 12)) { $this->month = [ @@ -563,7 +563,7 @@ class Interval implements \Serializable * * @since 1.0.0 */ - public function setYear(array $year, int $step = 0, bool $any = false) /* : void */ + public function setYear(array $year, int $step = 0, bool $any = false) : void { if ($this->validateYear($arr = [ 'year' => $year, @@ -620,7 +620,7 @@ class Interval implements \Serializable * * @since 1.0.0 */ - public function serializeTime($time, $step) /* : void */ + public function serializeTime($time, $step) : void { if (($count = count($time)) > 0) { $serialize = implode(',', $time); @@ -643,7 +643,7 @@ class Interval implements \Serializable * * @since 1.0.0 */ - public function serializeDayOfMonth() /* : void */ + public function serializeDayOfMonth() : void { if (($count = count($this->dayOfMonth['dayOfMonth'])) > 0) { $serialize = implode(',', $this->dayOfMonth['dayOfMonth']); @@ -670,7 +670,7 @@ class Interval implements \Serializable * * @since 1.0.0 */ - public function serializeDayOfWeek() /* : void */ + public function serializeDayOfWeek() : void { if (($count = count($this->dayOfWeek['dayOfWeek'])) > 0) { $serialize = implode(',', $this->dayOfWeek['dayOfWeek']); diff --git a/Utils/TaskSchedule/SchedulerAbstract.php b/Utils/TaskSchedule/SchedulerAbstract.php index 5a2c6c7d5..2ab3b1cec 100644 --- a/Utils/TaskSchedule/SchedulerAbstract.php +++ b/Utils/TaskSchedule/SchedulerAbstract.php @@ -59,7 +59,7 @@ abstract class SchedulerAbstract * * @since 1.0.0 */ - public static function setBin(string $path) /* : void */ + public static function setBin(string $path) : void { if (realpath($path) === false) { throw new PathException($path); @@ -100,7 +100,7 @@ abstract class SchedulerAbstract * * @since 1.0.0 */ - public function create(TaskAbstract $task) /* : void */ + public function create(TaskAbstract $task) : void { $this->run($task->getCommand()); } diff --git a/Utils/TaskSchedule/TaskAbstract.php b/Utils/TaskSchedule/TaskAbstract.php index 490c15596..c361556ef 100644 --- a/Utils/TaskSchedule/TaskAbstract.php +++ b/Utils/TaskSchedule/TaskAbstract.php @@ -132,7 +132,7 @@ abstract class TaskAbstract * * @since 1.0.0 */ - public function setCommand(string $command) /* : void */ + public function setCommand(string $command) : void { $this->command = $command; } @@ -158,7 +158,7 @@ abstract class TaskAbstract * * @since 1.0.0 */ - public function setRun(string $run) /* : void */ + public function setRun(string $run) : void { $this->run = $run; } @@ -184,7 +184,7 @@ abstract class TaskAbstract * * @since 1.0.0 */ - public function setStatus(string $status) /* : void */ + public function setStatus(string $status) : void { $this->status = $status; } @@ -210,7 +210,7 @@ abstract class TaskAbstract * * @since 1.0.0 */ - public function setNextRunTime(\DateTime $nextRunTime) /* : void */ + public function setNextRunTime(\DateTime $nextRunTime) : void { $this->nextRunTime = $nextRunTime; } @@ -236,7 +236,7 @@ abstract class TaskAbstract * * @since 1.0.0 */ - public function setLastRuntime(\DateTime $lastRunTime) /* : void */ + public function setLastRuntime(\DateTime $lastRunTime) : void { $this->lastRunTime = $lastRunTime; } @@ -262,7 +262,7 @@ abstract class TaskAbstract * * @since 1.0.0 */ - public function setComment(string $comment) /* : void */ + public function setComment(string $comment) : void { $this->comment = $comment; } diff --git a/Validation/ValidatorAbstract.php b/Validation/ValidatorAbstract.php index 835dd1267..495ee676f 100644 --- a/Validation/ValidatorAbstract.php +++ b/Validation/ValidatorAbstract.php @@ -60,7 +60,7 @@ abstract class ValidatorAbstract implements ValidatorInterface /** * {@inheritdoc} */ - public static function resetError() /* : void */ + public static function resetError() : void { self::$error = 0; self::$msg = ''; diff --git a/Views/View.php b/Views/View.php index 8b12a16c4..08c492620 100644 --- a/Views/View.php +++ b/Views/View.php @@ -112,7 +112,7 @@ class View extends ViewAbstract * * @since 1.0.0 */ - public function setData(string $id, $data) /* : void */ + public function setData(string $id, $data) : void { $this->data[$id] = $data; } diff --git a/Views/ViewAbstract.php b/Views/ViewAbstract.php index 310f40d40..ef47d2e7b 100644 --- a/Views/ViewAbstract.php +++ b/Views/ViewAbstract.php @@ -83,7 +83,7 @@ abstract class ViewAbstract implements \Serializable * * @since 1.0.0 */ - public function setTemplate(string $template) /* : void */ + public function setTemplate(string $template) : void { $this->template = $template; } diff --git a/tests/Autoloader.php b/tests/Autoloader.php index 2efd8357f..93f7bd872 100644 --- a/tests/Autoloader.php +++ b/tests/Autoloader.php @@ -40,7 +40,7 @@ class Autoloader * * @since 1.0.0 */ - public static function defaultAutoloader(string $class) /* : void */ + public static function defaultAutoloader(string $class) : void { $class = ltrim($class, '\\'); $class = str_replace(['_', '\\'], '/', $class); diff --git a/tests/Message/HeaderAbstractTest.php b/tests/Message/HeaderAbstractTest.php index fd1209b18..0989d77c5 100644 --- a/tests/Message/HeaderAbstractTest.php +++ b/tests/Message/HeaderAbstractTest.php @@ -1,59 +1,59 @@ -header = new class extends HeaderAbstract - { - public function generate(int $statusCode) /* : void */ - { - } - - public function getProtocolVersion() : string - { - return '1'; - } - - public function set(string $key, string $value, bool $overwrite = false) /* : void */ - { - - } - - public function get(string $key) : array - { - return []; - } - - public function has(string $key) : bool - { - return true; - } - }; - } - - public function testSetGet() - { - $this->header->setStatusCode(2); - self::assertEquals(2, $this->header->getStatusCode()); - } -} +header = new class extends HeaderAbstract + { + public function generate(int $statusCode) : void + { + } + + public function getProtocolVersion() : string + { + return '1'; + } + + public function set(string $key, string $value, bool $overwrite = false) : void + { + + } + + public function get(string $key) : array + { + return []; + } + + public function has(string $key) : bool + { + return true; + } + }; + } + + public function testSetGet() + { + $this->header->setStatusCode(2); + self::assertEquals(2, $this->header->getStatusCode()); + } +}