diff --git a/Account/Account.php b/Account/Account.php index c0904404a..f7a13dca3 100644 --- a/Account/Account.php +++ b/Account/Account.php @@ -36,7 +36,7 @@ class Account /** * Id. * - * @var \int + * @var int * @since 1.0.0 */ protected $id = 0; @@ -44,7 +44,7 @@ class Account /** * Names. * - * @var \string + * @var string * @since 1.0.0 */ protected $name1 = ''; @@ -52,7 +52,7 @@ class Account /** * Names. * - * @var \string + * @var string * @since 1.0.0 */ protected $name2 = ''; @@ -60,7 +60,7 @@ class Account /** * Names. * - * @var \string + * @var string * @since 1.0.0 */ protected $name3 = ''; @@ -68,7 +68,7 @@ class Account /** * Email. * - * @var \string + * @var string * @since 1.0.0 */ protected $email = ''; @@ -78,7 +78,7 @@ class Account * * Used in order to make sure ips don't change * - * @var \string + * @var string * @since 1.0.0 */ protected $origin = ''; @@ -86,7 +86,7 @@ class Account /** * Login. * - * @var \string + * @var string * @since 1.0.0 */ protected $login = ''; @@ -118,7 +118,7 @@ class Account /** * Groups. * - * @var \int[] + * @var int[] * @since 1.0.0 */ protected $groups = []; @@ -160,12 +160,12 @@ class Account /** * Get account id. * - * @return \int Account id + * @return int Account id * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getId() : \int + public function getId() : int { return $this->id; } @@ -201,12 +201,12 @@ class Account /** * Get name1. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getName1() : \string + public function getName1() : string { return $this->name1; } @@ -214,12 +214,12 @@ class Account /** * Get name2. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getName2() : \string + public function getName2() : string { return $this->name2; } @@ -227,12 +227,12 @@ class Account /** * Get name3. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getName3() : \string + public function getName3() : string { return $this->name3; } @@ -240,12 +240,12 @@ class Account /** * Get email. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getEmail() : \string + public function getEmail() : string { return $this->email; } @@ -255,12 +255,12 @@ class Account * * AccountStatus * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getStatus() : \int + public function getStatus() : int { return $this->status; } @@ -270,12 +270,12 @@ class Account * * AccountType * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getType() : \int + public function getType() : int { return $this->type; } @@ -309,14 +309,14 @@ class Account /** * Set name1. * - * @param \string $name Name + * @param string $name Name * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setName1(\string $name) + public function setName1(string $name) { $this->name1 = $name; } @@ -324,14 +324,14 @@ class Account /** * Set name2. * - * @param \string $name Name + * @param string $name Name * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setName2(\string $name) + public function setName2(string $name) { $this->name2 = $name; } @@ -339,14 +339,14 @@ class Account /** * Set name3. * - * @param \string $name Name + * @param string $name Name * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setName3(\string $name) + public function setName3(string $name) { $this->name3 = $name; } @@ -354,14 +354,14 @@ class Account /** * Set email. * - * @param \string $email Email + * @param string $email Email * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setEmail(\string $email) + public function setEmail(string $email) { if(!Email::isValid($email)) { throw new \InvalidArgumentException(); @@ -373,14 +373,14 @@ class Account /** * Get status. * - * @param \int $status Status + * @param int $status Status * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setStatus(\int $status) + public function setStatus(int $status) { if(!AccountStatus::isValidValue($status)) { throw new \InvalidArgumentException(); @@ -392,14 +392,14 @@ class Account /** * Get type. * - * @param \int $type Type + * @param int $type Type * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setType(\int $type) + public function setType(int $type) { if(!AccountType::isValidValue($type)) { throw new \InvalidArgumentException(); diff --git a/Account/AccountManager.php b/Account/AccountManager.php index 938a866bb..5d2dc9d45 100644 --- a/Account/AccountManager.php +++ b/Account/AccountManager.php @@ -50,14 +50,14 @@ class AccountManager /** * Get account. * - * @param \int $id Account id + * @param int $id Account id * * @return Account * * @since 1.0.0 * @author Dennis Eichhorn */ - public function get(\int $id) : Account + public function get(int $id) : Account { return $this->accounts[$id] ?? new NullAccount(); } @@ -67,7 +67,7 @@ class AccountManager * * @param Account $account Account * - * @return \int Account id + * @return int Account id * * @since 1.0.0 * @author Dennis Eichhorn diff --git a/Account/Group.php b/Account/Group.php index 0f70f6bd9..d2e90ad15 100644 --- a/Account/Group.php +++ b/Account/Group.php @@ -32,7 +32,7 @@ class Group /** * Account id. * - * @var \int + * @var int * @since 1.0.0 */ protected $id = 0; @@ -40,7 +40,7 @@ class Group /** * Account name. * - * @var \string + * @var string * @since 1.0.0 */ protected $name = ''; @@ -48,7 +48,7 @@ class Group /** * Account name. * - * @var \string + * @var string * @since 1.0.0 */ protected $description = ''; @@ -56,7 +56,7 @@ class Group /** * Account name. * - * @var \int + * @var int * @since 1.0.0 */ protected $members = []; @@ -64,7 +64,7 @@ class Group /** * Parents . * - * @var \int[] + * @var int[] * @since 1.0.0 */ protected $parents = []; @@ -72,7 +72,7 @@ class Group /** * Permissions. * - * @var \int[] + * @var int[] * @since 1.0.0 */ protected $permissions = []; @@ -90,12 +90,12 @@ class Group /** * Get group id. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getId() : \int + public function getId() : int { return $this->id; } @@ -103,12 +103,12 @@ class Group /** * Get group name. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getName() : \string + public function getName() : string { return $this->name; } @@ -116,12 +116,12 @@ class Group /** * Get group description. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getDescription() : \string + public function getDescription() : string { return $this->description; } @@ -129,12 +129,12 @@ class Group /** * Set group name. * - * @param \string $name Group name + * @param string $name Group name * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setName(\string $name) + public function setName(string $name) { $this->name = $name; } @@ -142,12 +142,12 @@ class Group /** * Set group description. * - * @param \string $description Group description + * @param string $description Group description * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setDescription(\string $description) + public function setDescription(string $description) { $this->description = $description; } diff --git a/Asset/AssetManager.php b/Asset/AssetManager.php index 290b6d357..1e2389866 100644 --- a/Asset/AssetManager.php +++ b/Asset/AssetManager.php @@ -52,16 +52,16 @@ class AssetManager implements \Countable /** * Add asset. * - * @param \string $id Asset id - * @param \string $asset Asset - * @param \bool $overwrite Overwrite + * @param string $id Asset id + * @param string $asset Asset + * @param bool $overwrite Overwrite * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function set(\string $id, \string $asset, \bool $overwrite = true) : \bool + public function set(string $id, string $asset, bool $overwrite = true) : bool { if ($overwrite || !isset($this->assets[$id])) { $this->assets[$id] = $asset; @@ -75,14 +75,14 @@ class AssetManager implements \Countable /** * Remove asset. * - * @param \string $id Asset id + * @param string $id Asset id * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function remove(\string $id) : \bool + public function remove(string $id) : bool { if (isset($this->assets[$id])) { unset($this->assets[$id]); @@ -96,14 +96,14 @@ class AssetManager implements \Countable /** * Get asset. * - * @param \string $id Asset id + * @param string $id Asset id * * @return mixed Asset * * @since 1.0.0 * @author Dennis Eichhorn */ - public function get(\string $id) + public function get(string $id) { if (isset($this->assets[$id])) { return $this->assets[$id]; @@ -120,7 +120,7 @@ class AssetManager implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function count() : \int + public function count() : int { return count($this->assets); } diff --git a/Auth/Auth.php b/Auth/Auth.php index 42aa25fb3..284083f24 100644 --- a/Auth/Auth.php +++ b/Auth/Auth.php @@ -68,12 +68,12 @@ class Auth /** * Authenticates user. * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function authenticate() : \bool + public function authenticate() : bool { $uid = $this->session->get('UID'); @@ -87,15 +87,15 @@ class Auth /** * Login user. * - * @param \string $login Username - * @param \string $password Password + * @param string $login Username + * @param string $password Password * - * @return \int Login code + * @return int Login code * * @since 1.0.0 * @author Dennis Eichhorn */ - public function login(\string $login, \string $password) : \int + public function login(string $login, string $password) : int { try { $result = null; @@ -146,14 +146,14 @@ class Auth /** * Logout the given user. * - * @param \int $uid User ID + * @param int $uid User ID * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function logout(\int $uid = null) + public function logout(int $uid = null) { // TODO: logout other users? If admin wants to kick a user for updates etc. $this->session->remove('UID'); diff --git a/Autoloader.php b/Autoloader.php index ac7cd1088..c4fe3a4c7 100644 --- a/Autoloader.php +++ b/Autoloader.php @@ -35,14 +35,14 @@ class Autoloader /** * Loading classes by namespace + class name. * - * @param \string $class Class path + * @param string $class Class path * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function default_autoloader(\string $class) + public static function default_autoloader(string $class) { if (($class = self::exists($class)) !== false) { /** @noinspection PhpIncludeInspection */ @@ -53,14 +53,14 @@ class Autoloader /** * Check if class exists. * - * @param \string $class Class path + * @param string $class Class path * * @return false|string * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function exists(\string $class) + public static function exists(string $class) { $class = ltrim($class, '\\'); $class = str_replace(['_', '\\'], DIRECTORY_SEPARATOR, $class); diff --git a/Config/OptionsInterface.php b/Config/OptionsInterface.php index c2bfdb123..a97c31c1f 100644 --- a/Config/OptionsInterface.php +++ b/Config/OptionsInterface.php @@ -46,27 +46,27 @@ interface OptionsInterface * * @param mixed $key Unique option key * @param mixed $value Option value - * @param \bool $overwrite Overwrite existing value + * @param bool $overwrite Overwrite existing value * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setOption($key, $value, \bool $overwrite = true) : \bool; + public function setOption($key, $value, bool $overwrite = true) : bool; /** * Updating or adding settings. * * @param array $pair Key value pair - * @param \bool $overwrite Overwrite existing value + * @param bool $overwrite Overwrite existing value * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setOptions(array $pair, \bool $overwrite = true) : \bool; + public function setOptions(array $pair, bool $overwrite = true) : bool; /** * Get option by key. diff --git a/Config/OptionsTrait.php b/Config/OptionsTrait.php index ac8e26205..0ecec2485 100644 --- a/Config/OptionsTrait.php +++ b/Config/OptionsTrait.php @@ -52,7 +52,7 @@ trait OptionsTrait /** * {@inheritdoc} */ - public function setOption($key, $value, \bool $overwrite = true) : \bool + public function setOption($key, $value, bool $overwrite = true) : bool { if ($overwrite || !array_key_exists($key, $this->options)) { $this->options[$key] = $value; @@ -66,7 +66,7 @@ trait OptionsTrait /** * {@inheritdoc} */ - public function setOptions(array $pair, \bool $overwrite = true) : \bool + public function setOptions(array $pair, bool $overwrite = true) : bool { if ($overwrite) { $this->options += $pair; diff --git a/Config/SettingsAbstract.php b/Config/SettingsAbstract.php index cba5e1919..91e7b4428 100644 --- a/Config/SettingsAbstract.php +++ b/Config/SettingsAbstract.php @@ -55,7 +55,7 @@ abstract class SettingsAbstract implements OptionsInterface /** * Settings table. * - * @var \string + * @var string * @since 1.0.0 */ protected static $table = null; @@ -63,7 +63,7 @@ abstract class SettingsAbstract implements OptionsInterface /** * Columns to identify the value. * - * @var \string[] + * @var string[] * @since 1.0.0 */ protected static $columns = [ @@ -73,7 +73,7 @@ abstract class SettingsAbstract implements OptionsInterface /** * Field where the actual value is stored. * - * @var \string + * @var string * @since 1.0.0 */ protected $valueField = 'option'; @@ -81,7 +81,7 @@ abstract class SettingsAbstract implements OptionsInterface /** * Get option by key. * - * @param \string[] $columns Column values for filtering + * @param string[] $columns Column values for filtering * * @return mixed Option value * @@ -114,15 +114,15 @@ abstract class SettingsAbstract implements OptionsInterface /** * Set option by key. * - * @param \string[] $options Column values for filtering - * @param \bool $store Save this Setting immediately to database + * @param string[] $options Column values for filtering + * @param bool $store Save this Setting immediately to database * * @return mixed Option value * * @since 1.0.0 * @author Dennis Eichhorn */ - public function set(array $options, \bool $store = false) + public function set(array $options, bool $store = false) { $this->setOptions($options); diff --git a/Console/CommandManager.php b/Console/CommandManager.php index 459bd3e62..3c3cffdcf 100644 --- a/Console/CommandManager.php +++ b/Console/CommandManager.php @@ -38,7 +38,7 @@ class CommandManager implements \Countable /** * Commands. * - * @var \int + * @var int * @since 1.0.0 */ private $count = 0; @@ -56,17 +56,17 @@ class CommandManager implements \Countable /** * Attach new command. * - * @param \string $cmd Command ID + * @param string $cmd Command ID * @param mixed $callback Function callback * @param mixed $source Provider - * @param \bool $overwrite Overwrite existing + * @param bool $overwrite Overwrite existing * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function attach(\string $cmd, $callback, $source, \bool $overwrite = true) : \bool + public function attach(string $cmd, $callback, $source, bool $overwrite = true) : bool { if ($overwrite || !isset($this->commands[$cmd])) { $this->commands[$cmd] = [$callback, $source]; @@ -81,15 +81,15 @@ class CommandManager implements \Countable /** * Detach existing command. * - * @param \string $cmd Command ID + * @param string $cmd Command ID * @param mixed $source Provider * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function detach(\string $cmd, $source) : \bool + public function detach(string $cmd, $source) : bool { if (array_key_exists($cmd, $this->commands)) { unset($this->commands[$cmd]); @@ -104,7 +104,7 @@ class CommandManager implements \Countable /** * Trigger command. * - * @param \string $cmd Command ID + * @param string $cmd Command ID * @param mixed $para Parameters to pass * * @return mixed|bool @@ -112,7 +112,7 @@ class CommandManager implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function trigger(\string $cmd, $para) + public function trigger(string $cmd, $para) { if (array_key_exists($cmd, $this->commands)) { return $this->commands[$cmd][0]($para); @@ -124,12 +124,12 @@ class CommandManager implements \Countable /** * Count commands. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function count() : \int + public function count() : int { return $this->count; } diff --git a/Contract/JsonableInterface.php b/Contract/JsonableInterface.php index 503121936..42ae7e972 100644 --- a/Contract/JsonableInterface.php +++ b/Contract/JsonableInterface.php @@ -34,13 +34,13 @@ interface JsonableInterface extends ArrayableInterface /** * Convert the object to its JSON representation. * - * @param \int $options + * @param int $options * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function toJson(\int $options = 0) : \string; + public function toJson(int $options = 0) : string; } diff --git a/Contract/RenderableInterface.php b/Contract/RenderableInterface.php index 04227d310..b711a7173 100644 --- a/Contract/RenderableInterface.php +++ b/Contract/RenderableInterface.php @@ -35,11 +35,11 @@ interface RenderableInterface /** * Get the evaluated contents of the object. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function render() : \string; + public function render() : string; } diff --git a/DataStorage/Cache/CacheInterface.php b/DataStorage/Cache/CacheInterface.php index 10189f9e1..ded2a8644 100644 --- a/DataStorage/Cache/CacheInterface.php +++ b/DataStorage/Cache/CacheInterface.php @@ -35,14 +35,14 @@ interface CacheInterface * @param mixed $key Unique cache key * @param mixed $value Cache value * @param CacheStatus $type Cache type - * @param \int $expire Valid duration (in s) + * @param int $expire Valid duration (in s) * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function set($key, $value, CacheStatus $type = null, \int $expire = 2592000); + public function set($key, $value, CacheStatus $type = null, int $expire = 2592000); /** * Adding new data if it doesn't exist. @@ -50,14 +50,14 @@ interface CacheInterface * @param mixed $key Unique cache key * @param mixed $value Cache value * @param CacheStatus $type Cache type - * @param \int $expire Valid duration (in s) + * @param int $expire Valid duration (in s) * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function add($key, $value, CacheStatus $type = null, \int $expire = 2592000) : \bool; + public function add($key, $value, CacheStatus $type = null, int $expire = 2592000) : bool; /** * Get cache by key. @@ -78,12 +78,12 @@ interface CacheInterface * @param mixed $key Unique cache key * @param CacheStatus $type Cache status/type * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function delete($key, CacheStatus $type = null) : \bool; + public function delete($key, CacheStatus $type = null) : bool; /** * Removing all elements from cache (invalidate cache). @@ -103,14 +103,14 @@ interface CacheInterface * @param mixed $key Unique cache key * @param mixed $value Cache value * @param CacheType $type Cache type - * @param \int $expire Timestamp + * @param int $expire Timestamp * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function replace($key, $value, CacheType $type = null, \int $expire = -1) : \bool; + public function replace($key, $value, CacheType $type = null, int $expire = -1) : bool; /** * Requesting cache stats. @@ -125,11 +125,11 @@ interface CacheInterface /** * Get the threshold required to cache data using this cache. * - * @return \int Storage threshold + * @return int Storage threshold * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getThreshold() : \int; + public function getThreshold() : int; } diff --git a/DataStorage/Cache/FileCache.php b/DataStorage/Cache/FileCache.php index d9f922589..05e3021a0 100644 --- a/DataStorage/Cache/FileCache.php +++ b/DataStorage/Cache/FileCache.php @@ -36,7 +36,7 @@ class FileCache implements CacheInterface /** * Cache path. * - * @var \string + * @var string * @since 1.0.0 */ const CACHE_PATH = __DIR__ . '/../../../Cache'; @@ -44,7 +44,7 @@ class FileCache implements CacheInterface /** * Only cache if data is larger than threshold (0-100). * - * @var \int + * @var int * @since 1.0.0 */ private $threshold = 50; @@ -52,14 +52,14 @@ class FileCache implements CacheInterface /** * {@inheritdoc} */ - public function set($key, $value, CacheStatus $type = null, \int $expire = 2592000) + public function set($key, $value, CacheStatus $type = null, int $expire = 2592000) { } /** * {@inheritdoc} */ - public function add($key, $value, CacheStatus $type = null, \int $expire = 2592000) + public function add($key, $value, CacheStatus $type = null, int $expire = 2592000) { } @@ -88,7 +88,7 @@ class FileCache implements CacheInterface /** * {@inheritdoc} */ - public function replace($key, $value, CacheType $type = null, \int $expire = -1) + public function replace($key, $value, CacheType $type = null, int $expire = -1) { } @@ -108,7 +108,7 @@ class FileCache implements CacheInterface /** * {@inheritdoc} */ - public function getThreshold() : \int + public function getThreshold() : int { return $this->threshold; } diff --git a/DataStorage/Cache/MemCache.php b/DataStorage/Cache/MemCache.php index 1647211b0..b8037ac21 100644 --- a/DataStorage/Cache/MemCache.php +++ b/DataStorage/Cache/MemCache.php @@ -40,7 +40,7 @@ class MemCache implements CacheInterface /** * Only cache if data is larger than threshold (0-100). * - * @var \int + * @var int * @since 1.0.0 */ private $threshold = 10; @@ -74,7 +74,7 @@ class MemCache implements CacheInterface /** * {@inheritdoc} */ - public function set($key, $value, CacheStatus $type = null, \int $expire = 2592000) + public function set($key, $value, CacheStatus $type = null, int $expire = 2592000) { $this->memc->set($key, $value, false, $expire); } @@ -82,7 +82,7 @@ class MemCache implements CacheInterface /** * {@inheritdoc} */ - public function add($key, $value, CacheStatus $type = null, \int $expire = 2592000) + public function add($key, $value, CacheStatus $type = null, int $expire = 2592000) { return $this->memc->add($key, $value, false, $expire); } @@ -114,7 +114,7 @@ class MemCache implements CacheInterface /** * {@inheritdoc} */ - public function replace($key, $value, CacheType $type = null, \int $expire = -1) + public function replace($key, $value, CacheType $type = null, int $expire = -1) { $this->memc->replace($key, $value, false, $expire); } @@ -130,7 +130,7 @@ class MemCache implements CacheInterface /** * {@inheritdoc} */ - public function getThreshold() : \int + public function getThreshold() : int { return $this->threshold; } diff --git a/DataStorage/Cache/NullCache.php b/DataStorage/Cache/NullCache.php index 7581a43d3..6f06ec0ac 100644 --- a/DataStorage/Cache/NullCache.php +++ b/DataStorage/Cache/NullCache.php @@ -32,7 +32,7 @@ class NullCache implements CacheInterface /** * {@inheritdoc} */ - public function set($key, $value, CacheStatus $type = null, \int $expire = 2592000) + public function set($key, $value, CacheStatus $type = null, int $expire = 2592000) { // TODO: Implement set() method. } @@ -40,7 +40,7 @@ class NullCache implements CacheInterface /** * {@inheritdoc} */ - public function add($key, $value, CacheStatus $type = null, \int $expire = 2592000) + public function add($key, $value, CacheStatus $type = null, int $expire = 2592000) { // TODO: Implement add() method. } @@ -72,7 +72,7 @@ class NullCache implements CacheInterface /** * {@inheritdoc} */ - public function replace($key, $value, CacheType $type = null, \int $expire = -1) + public function replace($key, $value, CacheType $type = null, int $expire = -1) { // TODO: Implement replace() method. } @@ -88,7 +88,7 @@ class NullCache implements CacheInterface /** * {@inheritdoc} */ - public function getThreshold() : \int + public function getThreshold() : int { // TODO: Implement getThreshold() method. } diff --git a/DataStorage/Cache/Pool.php b/DataStorage/Cache/Pool.php index dc1b530c3..3d52331e8 100644 --- a/DataStorage/Cache/Pool.php +++ b/DataStorage/Cache/Pool.php @@ -83,14 +83,14 @@ class Pool implements OptionsInterface /** * Requesting caching instance. * - * @param \int $type Cache to request + * @param int $type Cache to request * * @return \phpOMS\DataStorage\Cache\MemCache|\phpOMS\DataStorage\Cache\FileCache|null * * @since 1.0.0 * @author Dennis Eichhorn */ - public function get(\int $type = null) + public function get(int $type = null) { if (($type === null || $type === CacheStatus::MEMCACHE) && $this->memc !== null) { return $this->memc; @@ -114,7 +114,7 @@ class Pool implements OptionsInterface /** * {@inheritdoc} */ - public function add(\int $type, CacheInterface $cache) + public function add(int $type, CacheInterface $cache) { if (($type === null || $type === CacheStatus::MEMCACHE) && $this->memc !== null) { $this->memc = $cache; diff --git a/DataStorage/Cache/RedisCache.php b/DataStorage/Cache/RedisCache.php index 044e906ef..ab4ab51c7 100644 --- a/DataStorage/Cache/RedisCache.php +++ b/DataStorage/Cache/RedisCache.php @@ -34,7 +34,7 @@ class RedisCache implements CacheInterface /** * {@inheritdoc} */ - public function set($key, $value, CacheStatus $type = null, \int $expire = 2592000) + public function set($key, $value, CacheStatus $type = null, int $expire = 2592000) { // TODO: Implement set() method. } @@ -42,7 +42,7 @@ class RedisCache implements CacheInterface /** * {@inheritdoc} */ - public function add($key, $value, CacheStatus $type = null, \int $expire = 2592000) + public function add($key, $value, CacheStatus $type = null, int $expire = 2592000) { // TODO: Implement add() method. } @@ -74,7 +74,7 @@ class RedisCache implements CacheInterface /** * {@inheritdoc} */ - public function replace($key, $value, CacheType $type = null, \int $expire = -1) + public function replace($key, $value, CacheType $type = null, int $expire = -1) { // TODO: Implement replace() method. } @@ -90,7 +90,7 @@ class RedisCache implements CacheInterface /** * {@inheritdoc} */ - public function getThreshold() : \int + public function getThreshold() : int { // TODO: Implement getThreshold() method. } diff --git a/DataStorage/Cache/WinCache.php b/DataStorage/Cache/WinCache.php index daf6c3572..d44bf0764 100644 --- a/DataStorage/Cache/WinCache.php +++ b/DataStorage/Cache/WinCache.php @@ -34,7 +34,7 @@ class WinCache implements CacheInterface /** * {@inheritdoc} */ - public function set($key, $value, CacheStatus $type = null, \int $expire = 2592000) + public function set($key, $value, CacheStatus $type = null, int $expire = 2592000) { // TODO: Implement set() method. } @@ -42,7 +42,7 @@ class WinCache implements CacheInterface /** * {@inheritdoc} */ - public function add($key, $value, CacheStatus $type = null, \int $expire = 2592000) + public function add($key, $value, CacheStatus $type = null, int $expire = 2592000) { // TODO: Implement add() method. } @@ -74,7 +74,7 @@ class WinCache implements CacheInterface /** * {@inheritdoc} */ - public function replace($key, $value, CacheType $type = null, \int $expire = -1) + public function replace($key, $value, CacheType $type = null, int $expire = -1) { // TODO: Implement replace() method. } @@ -90,7 +90,7 @@ class WinCache implements CacheInterface /** * {@inheritdoc} */ - public function getThreshold() : \int + public function getThreshold() : int { // TODO: Implement getThreshold() method. } diff --git a/DataStorage/Cookie/CookieJar.php b/DataStorage/Cookie/CookieJar.php index eb50f5325..443d1cb0e 100644 --- a/DataStorage/Cookie/CookieJar.php +++ b/DataStorage/Cookie/CookieJar.php @@ -33,7 +33,7 @@ class CookieJar $this->cookies = $_COOKIE; } - public function set($id, $value, \int $expiry = 86400, $path = '/', $domain = null, \bool $secure = false, \bool $httponly = true, \bool $overwrite = true) : \bool + public function set($id, $value, int $expiry = 86400, $path = '/', $domain = null, bool $secure = false, bool $httponly = true, bool $overwrite = true) : bool { if ($overwrite || !isset($this->cookies[$id])) { $this->cookies[$id] = [ @@ -51,7 +51,7 @@ class CookieJar return false; } - public function remove($id) : \bool + public function remove($id) : bool { if (isset($this->cookies[$id])) { unset($this->cookies[$id]); @@ -62,7 +62,7 @@ class CookieJar return false; } - public function delete($id) : \bool + public function delete($id) : bool { $this->remove($id); setcookie($id, '', time() - 3600); diff --git a/DataStorage/Database/BuilderAbstract.php b/DataStorage/Database/BuilderAbstract.php index 13001d4ec..0220856cf 100644 --- a/DataStorage/Database/BuilderAbstract.php +++ b/DataStorage/Database/BuilderAbstract.php @@ -51,7 +51,7 @@ abstract class BuilderAbstract /** * Prefix. * - * @var \string + * @var string * @since 1.0.0 */ protected $prefix = ''; @@ -59,14 +59,14 @@ abstract class BuilderAbstract /** * Set prefix. * - * @param \string $prefix Prefix + * @param string $prefix Prefix * * @return BuilderAbstract * * @since 1.0.0 * @author Dennis Eichhorn */ - public function prefix(\string $prefix) + public function prefix(string $prefix) { $this->prefix = $prefix; @@ -76,12 +76,12 @@ abstract class BuilderAbstract /** * Get prefix. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getPrefix() : \string + public function getPrefix() : string { return $this->prefix; } @@ -89,12 +89,12 @@ abstract class BuilderAbstract /** * Get query type. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getType() : \int + public function getType() : int { return $this->type; } diff --git a/DataStorage/Database/Connection/ConnectionAbstract.php b/DataStorage/Database/Connection/ConnectionAbstract.php index be1c6f706..81f52207d 100644 --- a/DataStorage/Database/Connection/ConnectionAbstract.php +++ b/DataStorage/Database/Connection/ConnectionAbstract.php @@ -51,7 +51,7 @@ abstract class ConnectionAbstract implements ConnectionInterface * * The database prefix name for unique table names * - * @var \string + * @var string * @since 1.0.0 */ public $prefix = ''; @@ -59,7 +59,7 @@ abstract class ConnectionAbstract implements ConnectionInterface /** * Database data. * - * @var \string[] + * @var string[] * @since 1.0.0 */ protected $dbdata = null; @@ -99,7 +99,7 @@ abstract class ConnectionAbstract implements ConnectionInterface /** * {@inheritdoc} */ - public function getType() : \int + public function getType() : int { return $this->type; } @@ -107,7 +107,7 @@ abstract class ConnectionAbstract implements ConnectionInterface /** * {@inheritdoc} */ - public function getStatus() : \int + public function getStatus() : int { return $this->status; } @@ -115,12 +115,12 @@ abstract class ConnectionAbstract implements ConnectionInterface /** * Get table prefix. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getPrefix() : \string + public function getPrefix() : string { return $this->prefix; } diff --git a/DataStorage/Database/Connection/ConnectionFactory.php b/DataStorage/Database/Connection/ConnectionFactory.php index 50c40a5bb..4564ecf72 100644 --- a/DataStorage/Database/Connection/ConnectionFactory.php +++ b/DataStorage/Database/Connection/ConnectionFactory.php @@ -45,7 +45,7 @@ class ConnectionFactory * * Overwrites current connection if existing * - * @param \string[] $dbdata the basic database information for establishing a connection + * @param string[] $dbdata the basic database information for establishing a connection * * @return ConnectionInterface * diff --git a/DataStorage/Database/Connection/ConnectionInterface.php b/DataStorage/Database/Connection/ConnectionInterface.php index ce92cb233..935902421 100644 --- a/DataStorage/Database/Connection/ConnectionInterface.php +++ b/DataStorage/Database/Connection/ConnectionInterface.php @@ -37,7 +37,7 @@ interface ConnectionInterface * * Overwrites current connection if existing * - * @param \string[] $dbdata the basic database information for establishing a connection + * @param string[] $dbdata the basic database information for establishing a connection * * @return void * @@ -49,22 +49,22 @@ interface ConnectionInterface /** * Get the database type. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getType() : \int; + public function getType() : int; /** * Get the database status. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getStatus() : \int; + public function getStatus() : int; /** * Close database connection. diff --git a/DataStorage/Database/Connection/MysqlConnection.php b/DataStorage/Database/Connection/MysqlConnection.php index ad1cd48cd..40b9b1fb7 100644 --- a/DataStorage/Database/Connection/MysqlConnection.php +++ b/DataStorage/Database/Connection/MysqlConnection.php @@ -42,7 +42,7 @@ class MysqlConnection extends ConnectionAbstract * * Creates the database object and overwrites all default values. * - * @param \string[] $dbdata the basic database information for establishing a connection + * @param string[] $dbdata the basic database information for establishing a connection * * @since 1.0.0 * @author Dennis Eichhorn diff --git a/DataStorage/Database/Connection/SQLiteConnection.php b/DataStorage/Database/Connection/SQLiteConnection.php index 3790f3384..7e45256fe 100644 --- a/DataStorage/Database/Connection/SQLiteConnection.php +++ b/DataStorage/Database/Connection/SQLiteConnection.php @@ -41,7 +41,7 @@ class SqliteConnection extends ConnectionAbstract * * Creates the database object and overwrites all default values. * - * @param \string[] $dbdata the basic database information for establishing a connection + * @param string[] $dbdata the basic database information for establishing a connection * * @since 1.0.0 * @author Dennis Eichhorn diff --git a/DataStorage/Database/DataMapperAbstract.php b/DataStorage/Database/DataMapperAbstract.php index 633cab511..e83c89940 100644 --- a/DataStorage/Database/DataMapperAbstract.php +++ b/DataStorage/Database/DataMapperAbstract.php @@ -46,7 +46,7 @@ abstract class DataMapperAbstract implements DataMapperInterface /** * Overwriting extended values. * - * @var \bool + * @var bool * @since 1.0.0 */ protected static $overwrite = true; @@ -54,7 +54,7 @@ abstract class DataMapperAbstract implements DataMapperInterface /** * Primary field name. * - * @var \string + * @var string * @since 1.0.0 */ protected static $primaryField = ''; @@ -62,7 +62,7 @@ abstract class DataMapperAbstract implements DataMapperInterface /** * Primary field name. * - * @var \string + * @var string * @since 1.0.0 */ protected static $createdAt = ''; @@ -78,7 +78,7 @@ abstract class DataMapperAbstract implements DataMapperInterface /** * Relations. * - * @var \string[] + * @var string[] * @since 1.0.0 */ protected static $hasMany = []; @@ -86,7 +86,7 @@ abstract class DataMapperAbstract implements DataMapperInterface /** * Relations. * - * @var \string[] + * @var string[] * @since 1.0.0 */ protected static $ownsMany = []; @@ -94,7 +94,7 @@ abstract class DataMapperAbstract implements DataMapperInterface /** * Relations. * - * @var \string[] + * @var string[] * @since 1.0.0 */ protected static $hasOne = []; @@ -102,7 +102,7 @@ abstract class DataMapperAbstract implements DataMapperInterface /** * Extending relations. * - * @var \string[] + * @var string[] * @since 1.0.0 */ protected static $extends = []; @@ -110,7 +110,7 @@ abstract class DataMapperAbstract implements DataMapperInterface /** * Relations. * - * @var \string[] + * @var string[] * @since 1.0.0 */ protected static $ownsOne = []; @@ -118,7 +118,7 @@ abstract class DataMapperAbstract implements DataMapperInterface /** * Table. * - * @var \string + * @var string * @since 1.0.0 */ protected static $table = ''; @@ -512,7 +512,7 @@ abstract class DataMapperAbstract implements DataMapperInterface * * This will fall back to the insert id if no datetime column is present. * - * @param \int $limit Newest limit + * @param int $limit Newest limit * @param Builder $query Pre-defined query * * @return mixed @@ -520,7 +520,7 @@ abstract class DataMapperAbstract implements DataMapperInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function getNewest(\int $limit = 1, Builder $query = null) + public function getNewest(int $limit = 1, Builder $query = null) { if (!isset(static::$createdAt) || !isset(static::$columns[static::$createdAt])) { throw new \BadMethodCallException('Method "' . __METHOD__ . '" is not supported.'); @@ -591,14 +591,14 @@ abstract class DataMapperAbstract implements DataMapperInterface * Get object. * * @param mixed $primaryKey Key - * @param \bool $relations Load relations + * @param bool $relations Load relations * * @return mixed * * @since 1.0.0 * @author Dennis Eichhorn */ - public function get($primaryKey, \bool $relations = true) + public function get($primaryKey, bool $relations = true) { $obj = []; if (is_array($primaryKey)) { @@ -740,12 +740,12 @@ abstract class DataMapperAbstract implements DataMapperInterface /** * Get primary field. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getPrimaryField() : \string + public function getPrimaryField() : string { return static::$primaryField; } @@ -753,12 +753,12 @@ abstract class DataMapperAbstract implements DataMapperInterface /** * Get main table. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getTable() : \string + public function getTable() : string { return static::$table; } diff --git a/DataStorage/Database/GrammarAbstract.php b/DataStorage/Database/GrammarAbstract.php index 3968882e9..c9cb351df 100644 --- a/DataStorage/Database/GrammarAbstract.php +++ b/DataStorage/Database/GrammarAbstract.php @@ -21,7 +21,7 @@ abstract class GrammarAbstract /** * Comment style. * - * @var \string + * @var string * @since 1.0.0 */ protected $comment = '--'; @@ -29,7 +29,7 @@ abstract class GrammarAbstract /** * String quotes style. * - * @var \string + * @var string * @since 1.0.0 */ protected $valueQuotes = '\''; @@ -37,7 +37,7 @@ abstract class GrammarAbstract /** * System identifier. * - * @var \string + * @var string * @since 1.0.0 */ protected $systemIdentifier = '"'; @@ -45,7 +45,7 @@ abstract class GrammarAbstract /** * And operator. * - * @var \string + * @var string * @since 1.0.0 */ protected $and = 'AND'; @@ -53,7 +53,7 @@ abstract class GrammarAbstract /** * Or operator. * - * @var \string + * @var string * @since 1.0.0 */ protected $or = 'OR'; @@ -65,14 +65,14 @@ abstract class GrammarAbstract * * @param BuilderAbstract $query Builder * - * @return \string + * @return string * * @throws * * @since 1.0.0 * @author Dennis Eichhorn */ - public function compileQuery(BuilderAbstract $query) : \string + public function compileQuery(BuilderAbstract $query) : string { return trim( implode(' ', @@ -92,14 +92,14 @@ abstract class GrammarAbstract * Expressionize elements. * * @param array $elements Elements - * @param \string $prefix Prefix for table + * @param string $prefix Prefix for table * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - protected function expressionizeTableColumn(array $elements, \string $prefix = '') : \string + protected function expressionizeTableColumn(array $elements, string $prefix = '') : string { $expression = ''; @@ -123,15 +123,15 @@ abstract class GrammarAbstract /** * Compile system. * - * @param array|\string $system System - * @param \string $prefix Prefix for table + * @param array|string $system System + * @param string $prefix Prefix for table * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - protected function compileSystem($system, \string $prefix = '') : \string + protected function compileSystem($system, string $prefix = '') : string { if (count($split = explode('.', $system)) == 2) { return $this->compileSystem($prefix . $split[0]) . '.' . $this->compileSystem($split[1]); @@ -140,17 +140,17 @@ abstract class GrammarAbstract } } - public function getDateFormat() : \string + public function getDateFormat() : string { return 'Y-m-d H:i:s'; } - public function getTablePrefix() : \string + public function getTablePrefix() : string { return $this->tablePrefix; } - public function setTablePrefix(\string $prefix) + public function setTablePrefix(string $prefix) { $this->tablePrefix = $prefix; } diff --git a/DataStorage/Database/Pool.php b/DataStorage/Database/Pool.php index 7e4434ca0..86395ab83 100644 --- a/DataStorage/Database/Pool.php +++ b/DataStorage/Database/Pool.php @@ -57,12 +57,12 @@ class Pool * @param mixed $key Database key * @param ConnectionAbstract $db Database * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function add($key = 'core', ConnectionAbstract $db) : \bool + public function add($key = 'core', ConnectionAbstract $db) : bool { if (isset($this->pool[$key])) { return false; @@ -97,12 +97,12 @@ class Pool * * @param mixed $key Database key * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function remove($key) : \bool + public function remove($key) : bool { if (!isset($this->pool[$key])) { return false; @@ -119,12 +119,12 @@ class Pool * @param mixed $key Database key * @param array $config Database config data * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function create($key, array $config) : \bool + public function create($key, array $config) : bool { if (isset($this->pool[$key])) { return false; diff --git a/DataStorage/Database/Query/Builder.php b/DataStorage/Database/Query/Builder.php index 5ea2847e8..3107c6d15 100644 --- a/DataStorage/Database/Query/Builder.php +++ b/DataStorage/Database/Query/Builder.php @@ -69,7 +69,7 @@ class Builder extends BuilderAbstract /** * Distinct. * - * @var \bool + * @var bool * @since 1.0.0 */ public $distinct = false; @@ -149,7 +149,7 @@ class Builder extends BuilderAbstract /** * Lock. * - * @var \bool + * @var bool * @since 1.0.0 */ public $lock = false; @@ -163,7 +163,7 @@ class Builder extends BuilderAbstract /** * Comparison operators. * - * @var \string[] + * @var string[] * @since 1.0.0 */ const operators = [ @@ -242,7 +242,7 @@ class Builder extends BuilderAbstract /** * Bind parameter. * - * @param \string|array|\Closure $binds Binds + * @param string|array|\Closure $binds Binds * * @return Builder * @@ -278,12 +278,12 @@ class Builder extends BuilderAbstract /** * Parsing to string. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function toSql() : \string + public function toSql() : string { return $this->grammar->compileQuery($this); } @@ -291,7 +291,7 @@ class Builder extends BuilderAbstract /** * Make raw column selection. * - * @param \string|\Closure $expression Raw expression + * @param string|\Closure $expression Raw expression * * @return Builder * @@ -346,7 +346,7 @@ class Builder extends BuilderAbstract /** * Make raw from. * - * @param \string|array|\Closure $expression Expression + * @param string|array|\Closure $expression Expression * * @return Builder * @@ -363,16 +363,16 @@ class Builder extends BuilderAbstract /** * Or Where. * - * @param \string|array|\Closure $columns Columns - * @param \string $operator Operator - * @param \string|array|\Closure $values Values + * @param string|array|\Closure $columns Columns + * @param string $operator Operator + * @param string|array|\Closure $values Values * * @return Builder * * @since 1.0.0 * @author Dennis Eichhorn */ - public function orWhere($columns, \string $operator = null, $values = null) : Builder + public function orWhere($columns, string $operator = null, $values = null) : Builder { return $this->where($columns, $operator, $values, 'or'); } @@ -380,10 +380,10 @@ class Builder extends BuilderAbstract /** * Where. * - * @param \string|array|\Closure $columns Columns - * @param \string|array $operator Operator + * @param string|array|\Closure $columns Columns + * @param string|array $operator Operator * @param mixed $values Values - * @param \string|array $boolean Boolean condition + * @param string|array $boolean Boolean condition * * @return Builder * @@ -428,16 +428,16 @@ class Builder extends BuilderAbstract /** * Where in. * - * @param \string|array|\Closure $column Column + * @param string|array|\Closure $column Column * @param mixed $values Values - * @param \string $boolean Boolean condition + * @param string $boolean Boolean condition * * @return Builder * * @since 1.0.0 * @author Dennis Eichhorn */ - public function whereIn($column, $values = null, \string $boolean = 'and') : Builder + public function whereIn($column, $values = null, string $boolean = 'and') : Builder { $this->where($column, 'in', $values, $boolean); @@ -447,15 +447,15 @@ class Builder extends BuilderAbstract /** * Where null. * - * @param \string|array|\Closure $column Column - * @param \string $boolean Boolean condition + * @param string|array|\Closure $column Column + * @param string $boolean Boolean condition * * @return Builder * * @since 1.0.0 * @author Dennis Eichhorn */ - public function whereNull($column, \string $boolean = 'and') : Builder + public function whereNull($column, string $boolean = 'and') : Builder { $this->where($column, '=', null, $boolean); @@ -465,15 +465,15 @@ class Builder extends BuilderAbstract /** * Where not null. * - * @param \string|array|\Closure $column Column - * @param \string $boolean Boolean condition + * @param string|array|\Closure $column Column + * @param string $boolean Boolean condition * * @return Builder * * @since 1.0.0 * @author Dennis Eichhorn */ - public function whereNotNull($column, \string $boolean = 'and') : Builder + public function whereNotNull($column, string $boolean = 'and') : Builder { $this->where($column, '!=', null, $boolean); @@ -483,7 +483,7 @@ class Builder extends BuilderAbstract /** * Group by. * - * @param \string|array|\Closure $columns Grouping result + * @param string|array|\Closure $columns Grouping result * * @return Builder * @@ -506,7 +506,7 @@ class Builder extends BuilderAbstract /** * Order by newest. * - * @param \string|\Closure $column Column + * @param string|\Closure $column Column * * @return Builder * @@ -523,7 +523,7 @@ class Builder extends BuilderAbstract /** * Order by oldest. * - * @param \string|\Closure $column Column + * @param string|\Closure $column Column * * @return Builder * @@ -540,8 +540,8 @@ class Builder extends BuilderAbstract /** * Order by oldest. * - * @param \string|array|\Closure $columns Columns - * @param \string|string[] $order Orders + * @param string|array|\Closure $columns Columns + * @param string|string[] $order Orders * * @return Builder * @@ -566,7 +566,7 @@ class Builder extends BuilderAbstract /** * Offset. * - * @param \int|\Closure $offset Offset + * @param int|\Closure $offset Offset * * @return Builder * @@ -583,7 +583,7 @@ class Builder extends BuilderAbstract /** * Limit. * - * @param \int|\Closure $limit Limit + * @param int|\Closure $limit Limit * * @return Builder * @@ -600,7 +600,7 @@ class Builder extends BuilderAbstract /** * Limit. * - * @param \string|\phpOMS\DataStorage\Database\Query\Builder $query Query + * @param string|\phpOMS\DataStorage\Database\Query\Builder $query Query * * @return Builder * @@ -683,7 +683,7 @@ class Builder extends BuilderAbstract /** * Table to insert into. * - * @param \string|\Closure $table Table + * @param string|\Closure $table Table * * @return Builder * @@ -724,7 +724,7 @@ class Builder extends BuilderAbstract * @since 1.0.0 * @author Dennis Eichhorn */ - public function value($value, \string $type = 'string') : Builder + public function value($value, string $type = 'string') : Builder { end($this->values); $key = key($this->values); diff --git a/DataStorage/Database/Query/Column.php b/DataStorage/Database/Query/Column.php index 67ecb3431..1587e7c2b 100644 --- a/DataStorage/Database/Query/Column.php +++ b/DataStorage/Database/Query/Column.php @@ -41,12 +41,12 @@ class Column /** * Constructor. * - * @param \string $column Column + * @param string $column Column * * @since 1.0.0 * @author Dennis Eichhorn */ - public function __construct(\string $column) + public function __construct(string $column) { $this->column = $column; } @@ -59,12 +59,12 @@ class Column * @since 1.0.0 * @author Dennis Eichhorn */ - public function getColumn() : \string + public function getColumn() : string { return $this->column; } - public function setColumn(\string $column) + public function setColumn(string $column) { $this->column = $column; } diff --git a/DataStorage/Database/Query/Grammar/Grammar.php b/DataStorage/Database/Query/Grammar/Grammar.php index 3eeab852c..cb2a6fe9b 100644 --- a/DataStorage/Database/Query/Grammar/Grammar.php +++ b/DataStorage/Database/Query/Grammar/Grammar.php @@ -38,7 +38,7 @@ class Grammar extends GrammarAbstract /** * Select components. * - * @var \string[] + * @var string[] * @since 1.0.0 */ protected $selectComponents = [ @@ -59,7 +59,7 @@ class Grammar extends GrammarAbstract /** * Insert components. * - * @var \string[] + * @var string[] * @since 1.0.0 */ protected $insertComponents = [ @@ -71,7 +71,7 @@ class Grammar extends GrammarAbstract /** * Update components. * - * @var \string[] + * @var string[] * @since 1.0.0 */ protected $updateComponents = [ @@ -85,7 +85,7 @@ class Grammar extends GrammarAbstract * * @param BuilderAbstract $query Builder * - * @return \string[] + * @return string[] * * @throws * @@ -129,12 +129,12 @@ class Grammar extends GrammarAbstract * @param Builder $query Builder * @param array $columns Columns * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - protected function compileSelects(Builder $query, array $columns) : \string + protected function compileSelects(Builder $query, array $columns) : string { $expression = $this->expressionizeTableColumn($columns, $query->getPrefix()); @@ -151,12 +151,12 @@ class Grammar extends GrammarAbstract * @param Builder $query Builder * @param array $table Tables * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - protected function compileFrom(Builder $query, array $table) : \string + protected function compileFrom(Builder $query, array $table) : string { $expression = $this->expressionizeTableColumn($table, $query->getPrefix()); @@ -172,14 +172,14 @@ class Grammar extends GrammarAbstract * * @param Builder $query Builder * @param array $wheres Where elmenets - * @param \bool $first Is first element (usefull for nesting) + * @param bool $first Is first element (usefull for nesting) * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - protected function compileWheres(Builder $query, array $wheres, \bool $first = true) : \string + protected function compileWheres(Builder $query, array $wheres, bool $first = true) : string { $expression = ''; @@ -222,16 +222,16 @@ class Grammar extends GrammarAbstract * Compile value. * * @param array|string|\Closure $value Value - * @param \string $prefix Prefix in case value is a table + * @param string $prefix Prefix in case value is a table * - * @return \string + * @return string * * @throws \InvalidArgumentException * * @since 1.0.0 * @author Dennis Eichhorn */ - protected function compileValue($value, $prefix = '') : \string + protected function compileValue($value, $prefix = '') : string { if (is_string($value)) { return $this->valueQuotes . $value . $this->valueQuotes; @@ -262,14 +262,14 @@ class Grammar extends GrammarAbstract * Compile limit. * * @param Builder $query Builder - * @param \int $limit Limit + * @param int $limit Limit * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - protected function compileLimit(Builder $query, $limit) : \string + protected function compileLimit(Builder $query, $limit) : string { return 'LIMIT ' . $limit; } @@ -278,14 +278,14 @@ class Grammar extends GrammarAbstract * Compile offset. * * @param Builder $query Builder - * @param \int $offset Offset + * @param int $offset Offset * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - protected function compileOffset(Builder $query, $offset) : \string + protected function compileOffset(Builder $query, $offset) : string { return 'OFFSET ' . $offset; } @@ -301,7 +301,7 @@ class Grammar extends GrammarAbstract * @param Builder $query Builder * @param array $groups Groups * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn @@ -325,12 +325,12 @@ class Grammar extends GrammarAbstract * @param Builder $query Builder * @param array $orders Order * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - private function compileOrders(Builder $query, array $orders) : \string + private function compileOrders(Builder $query, array $orders) : string { $expression = ''; @@ -361,14 +361,14 @@ class Grammar extends GrammarAbstract * Compile insert into table. * * @param Builder $query Builder - * @param \string $table Table + * @param string $table Table * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - protected function compileInto(Builder $query, $table) : \string + protected function compileInto(Builder $query, $table) : string { return 'INSERT INTO ' . $this->compileSystem($table, $query->getPrefix()); } @@ -379,12 +379,12 @@ class Grammar extends GrammarAbstract * @param Builder $query Builder * @param array $columns Columns * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - protected function compileInserts(Builder $query, array $columns) : \string + protected function compileInserts(Builder $query, array $columns) : string { $cols = ''; @@ -405,12 +405,12 @@ class Grammar extends GrammarAbstract * @param Builder $query Builder * @param array $values Values * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - protected function compileValues(Builder $query, array $values) : \string + protected function compileValues(Builder $query, array $values) : string { $vals = ''; diff --git a/DataStorage/Database/Query/Grammar/MysqlGrammar.php b/DataStorage/Database/Query/Grammar/MysqlGrammar.php index 36e82fb19..d777d2174 100644 --- a/DataStorage/Database/Query/Grammar/MysqlGrammar.php +++ b/DataStorage/Database/Query/Grammar/MysqlGrammar.php @@ -22,7 +22,7 @@ class MysqlGrammar extends Grammar /** * System identifier. * - * @var \string + * @var string * @since 1.0.0 */ protected $systemIdentifier = '`'; diff --git a/DataStorage/Database/Query/Grammar/SQLiteGrammar.php b/DataStorage/Database/Query/Grammar/SQLiteGrammar.php index 3e189748b..4525a722d 100644 --- a/DataStorage/Database/Query/Grammar/SQLiteGrammar.php +++ b/DataStorage/Database/Query/Grammar/SQLiteGrammar.php @@ -22,7 +22,7 @@ class SqliteGrammar extends Grammar /** * System identifier. * - * @var \string + * @var string * @since 1.0.0 */ public $systemIdentifier = '`'; diff --git a/DataStorage/Database/Schema/Builder.php b/DataStorage/Database/Schema/Builder.php index 80984e8f4..e1113a6b9 100644 --- a/DataStorage/Database/Schema/Builder.php +++ b/DataStorage/Database/Schema/Builder.php @@ -65,7 +65,7 @@ class Builder extends BuilderAbstract $this->drop = array_unique($this->drop); } - public function create(\string $table) + public function create(string $table) { } @@ -78,12 +78,12 @@ class Builder extends BuilderAbstract /** * Parsing to string. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function toSql() : \string + public function toSql() : string { return $this->grammar->compileQuery($this); } diff --git a/DataStorage/Database/Schema/Grammar/Grammar.php b/DataStorage/Database/Schema/Grammar/Grammar.php index 9f26e12cb..1a01e499c 100644 --- a/DataStorage/Database/Schema/Grammar/Grammar.php +++ b/DataStorage/Database/Schema/Grammar/Grammar.php @@ -37,7 +37,7 @@ class Grammar extends GrammarAbstract /** * Select components. * - * @var \string[] + * @var string[] * @since 1.0.0 */ protected $selectComponents = [ @@ -48,7 +48,7 @@ class Grammar extends GrammarAbstract /** * Select components. * - * @var \string[] + * @var string[] * @since 1.0.0 */ protected $dropComponents = [ @@ -77,7 +77,7 @@ class Grammar extends GrammarAbstract return $sql; } - protected function compileDrop(Builder $query, array $tables) : \string + protected function compileDrop(Builder $query, array $tables) : string { $expression = $this->expressionizeTableColumn($tables, $query->getPrefix()); diff --git a/DataStorage/Database/Schema/Grammar/MysqlGrammar.php b/DataStorage/Database/Schema/Grammar/MysqlGrammar.php index fd632c28b..d7687a140 100644 --- a/DataStorage/Database/Schema/Grammar/MysqlGrammar.php +++ b/DataStorage/Database/Schema/Grammar/MysqlGrammar.php @@ -34,7 +34,7 @@ class MysqlGrammar extends Grammar /** * System identifier. * - * @var \string + * @var string * @since 1.0.0 */ protected $systemIdentifier = '`'; @@ -45,12 +45,12 @@ class MysqlGrammar extends Grammar * @param Builder $query Builder * @param array $columns Columns * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - protected function compileSelects(Builder $query, array $columns) : \string + protected function compileSelects(Builder $query, array $columns) : string { $expression = $this->expressionizeTableColumn($columns); @@ -67,12 +67,12 @@ class MysqlGrammar extends Grammar * @param Builder $query Builder * @param array $table Tables * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - protected function compileFrom(Builder $query, array $table) : \string + protected function compileFrom(Builder $query, array $table) : string { $expression = $this->expressionizeTableColumn('information_schema.tables'); diff --git a/DataStorage/Session/ConsoleSession.php b/DataStorage/Session/ConsoleSession.php index 3c4774a0f..39a143315 100644 --- a/DataStorage/Session/ConsoleSession.php +++ b/DataStorage/Session/ConsoleSession.php @@ -32,7 +32,7 @@ class ConsoleSession implements SessionInterface /** * Session ID. * - * @var \string|\int + * @var string|int * @since 1.0.0 */ private $sid = null; @@ -40,7 +40,7 @@ class ConsoleSession implements SessionInterface /** * Constructor. * - * @param \string|\int $sid Session id + * @param string|int $sid Session id * * @since 1.0.0 * @author Dennis Eichhorn @@ -60,7 +60,7 @@ class ConsoleSession implements SessionInterface /** * {@inheritdoc} */ - public function set($key, $value, \bool $overwrite = true) : \bool + public function set($key, $value, bool $overwrite = true) : bool { return false; } @@ -68,7 +68,7 @@ class ConsoleSession implements SessionInterface /** * {@inheritdoc} */ - public function remove($key) : \bool + public function remove($key) : bool { return false; } diff --git a/DataStorage/Session/HttpSession.php b/DataStorage/Session/HttpSession.php index b3b8288ea..007c06b5f 100644 --- a/DataStorage/Session/HttpSession.php +++ b/DataStorage/Session/HttpSession.php @@ -36,7 +36,7 @@ class HttpSession implements SessionInterface /** * Session ID. * - * @var \string|int + * @var string|int * @since 1.0.0 */ private $sid = null; @@ -44,15 +44,15 @@ class HttpSession implements SessionInterface /** * Constructor. * - * @param \int $liftetime Session life time - * @param \string|int|\bool $sid Session id + * @param int $liftetime Session life time + * @param string|int|bool $sid Session id * * @since 1.0.0 * @author Dennis Eichhorn */ - public function __construct(\int $liftetime = 3600, $sid = false) + public function __construct(int $liftetime = 3600, $sid = false) { - if ($sid !== false) { + if (!is_bool($sid)) { session_id($sid); } @@ -83,7 +83,7 @@ class HttpSession implements SessionInterface /** * {@inheritdoc} */ - public function set($key, $value, \bool $overwrite = true) : \bool + public function set($key, $value, bool $overwrite = true) : bool { if($overwrite || !isset($this->sessionData[$key])) { $this->sessionData[$key] = $value; @@ -105,7 +105,7 @@ class HttpSession implements SessionInterface /** * {@inheritdoc} */ - public function remove($key) : \bool + public function remove($key) : bool { if (isset($this->sessionData[$key])) { unset($this->sessionData[$key]); diff --git a/DataStorage/Session/SessionInterface.php b/DataStorage/Session/SessionInterface.php index c39b223a3..5445d0ca6 100644 --- a/DataStorage/Session/SessionInterface.php +++ b/DataStorage/Session/SessionInterface.php @@ -34,7 +34,7 @@ interface SessionInterface /** * Get session variable by key. * - * @param \string|\int $key Value key + * @param string|int $key Value key * * @return mixed * @@ -46,28 +46,28 @@ interface SessionInterface /** * Store session value by key. * - * @param \string|\int $key Value key + * @param string|int $key Value key * @param mixed $value Value to store - * @param \bool $overwrite Overwrite existing values + * @param bool $overwrite Overwrite existing values * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function set($key, $value, \bool $overwrite = true) : \bool; + public function set($key, $value, bool $overwrite = true) : bool; /** * Remove value from session by key. * - * @param \string|\int $key Value key + * @param string|int $key Value key * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function remove($key) : \bool; + public function remove($key) : bool; /** * Save session. @@ -82,7 +82,7 @@ interface SessionInterface public function save(); /** - * @return \int|\string + * @return int|string * * @since 1.0.0 * @author Dennis Eichhorn @@ -90,7 +90,7 @@ interface SessionInterface public function getSID(); /** - * @param \int|\string $sid + * @param int|string $sid * * @return void * diff --git a/DataStorage/Session/SocketSession.php b/DataStorage/Session/SocketSession.php index 4a0950045..7cd1ea246 100644 --- a/DataStorage/Session/SocketSession.php +++ b/DataStorage/Session/SocketSession.php @@ -32,7 +32,7 @@ class SocketSession implements SessionInterface /** * Session ID. * - * @var \string|\int + * @var string|int * @since 1.0.0 */ private $sid = null; @@ -40,7 +40,7 @@ class SocketSession implements SessionInterface /** * Constructor. * - * @param \string|\int $sid Session id + * @param string|int $sid Session id * * @since 1.0.0 * @author Dennis Eichhorn @@ -60,7 +60,7 @@ class SocketSession implements SessionInterface /** * {@inheritdoc} */ - public function set($key, $value, \bool $overwrite = true) : \bool + public function set($key, $value, bool $overwrite = true) : bool { return false; } @@ -68,7 +68,7 @@ class SocketSession implements SessionInterface /** * {@inheritdoc} */ - public function remove($key) : \bool + public function remove($key) : bool { return false; } diff --git a/Datatypes/Address.php b/Datatypes/Address.php index 3a485dfe1..463adeaeb 100644 --- a/Datatypes/Address.php +++ b/Datatypes/Address.php @@ -34,7 +34,7 @@ class Address implements JsonableInterface /** * Name of the receiver. * - * @var \string + * @var string * @since 1.0.0 */ private $recipient = ''; @@ -42,7 +42,7 @@ class Address implements JsonableInterface /** * Sub of the address. * - * @var \string + * @var string * @since 1.0.0 */ private $fao = ''; @@ -69,12 +69,12 @@ class Address implements JsonableInterface /** * Get recipient. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getRecipient() : \string + public function getRecipient() : string { return $this->recipient; } @@ -82,14 +82,14 @@ class Address implements JsonableInterface /** * Set recipient. * - * @param \string $recipient Recipient + * @param string $recipient Recipient * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setRecipient(\string $recipient) + public function setRecipient(string $recipient) { $this->recipient = $recipient; } @@ -97,12 +97,12 @@ class Address implements JsonableInterface /** * Get FAO. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getFAO() : \string + public function getFAO() : string { return $this->fao; } @@ -110,14 +110,14 @@ class Address implements JsonableInterface /** * Set FAO. * - * @param \string $fao FAO + * @param string $fao FAO * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setFAO(\string $fao) + public function setFAO(string $fao) { $this->fao = $fao; } @@ -161,7 +161,7 @@ class Address implements JsonableInterface /** * {@inheritdoc} */ - public function toJson(\int $option = 0) : \string + public function toJson(int $option = 0) : string { return json_encode($this->toArray()); } diff --git a/Datatypes/Enum.php b/Datatypes/Enum.php index 07201effc..7d33e7771 100644 --- a/Datatypes/Enum.php +++ b/Datatypes/Enum.php @@ -36,14 +36,14 @@ abstract class Enum * * Checking if a certain const name exists (case sensitive) * - * @param \string $name Name of the value (case sensitive) + * @param string $name Name of the value (case sensitive) * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function isValidName(\string $name) : \bool + public static function isValidName(string $name) : bool { $constants = self::getConstants(); @@ -72,12 +72,12 @@ abstract class Enum * * @param mixed $value Value to check * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function isValidValue($value) : \bool + public static function isValidValue($value) : bool { $values = array_values(self::getConstants()); diff --git a/Datatypes/EnumArray.php b/Datatypes/EnumArray.php index 7b98ce84c..407b61b67 100644 --- a/Datatypes/EnumArray.php +++ b/Datatypes/EnumArray.php @@ -36,14 +36,14 @@ abstract class EnumArray * * Checking if a certain const name exists (case sensitive) * - * @param \string $name Name of the value (case sensitive) + * @param string $name Name of the value (case sensitive) * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function isValidName(\string $name) : \bool + public static function isValidName(string $name) : bool { $constants = self::getConstants(); @@ -71,12 +71,12 @@ abstract class EnumArray * * @param mixed $value Value to check * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function isValidValue($value) : \bool + public static function isValidValue($value) : bool { $constants = self::getConstants(); diff --git a/Datatypes/Location.php b/Datatypes/Location.php index 2993fcfdb..ae392fcd5 100644 --- a/Datatypes/Location.php +++ b/Datatypes/Location.php @@ -34,7 +34,7 @@ class Location implements JsonableInterface /** * Zip or postal. * - * @var \string + * @var string * @since 1.0.0 */ private $postal = ''; @@ -42,7 +42,7 @@ class Location implements JsonableInterface /** * Name of city. * - * @var \string + * @var string * @since 1.0.0 */ private $city = ''; @@ -50,7 +50,7 @@ class Location implements JsonableInterface /** * Name of the country. * - * @var \string + * @var string * @since 1.0.0 */ private $country = ''; @@ -58,7 +58,7 @@ class Location implements JsonableInterface /** * Street & district. * - * @var \string + * @var string * @since 1.0.0 */ private $address = ''; @@ -66,7 +66,7 @@ class Location implements JsonableInterface /** * State. * - * @var \string + * @var string * @since 1.0.0 */ private $state = ''; @@ -74,7 +74,7 @@ class Location implements JsonableInterface /** * Geo coordinates. * - * @var \float[] + * @var float[] * @since 1.0.0 */ private $geo = ['lat' => 0, 'long' => 0]; @@ -90,127 +90,127 @@ class Location implements JsonableInterface } /** - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getPostal() : \string + public function getPostal() : string { return $this->postal; } /** - * @param \string $postal + * @param string $postal * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setPostal(\string $postal) + public function setPostal(string $postal) { $this->postal = $postal; } /** - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getCity() : \string + public function getCity() : string { return $this->city; } /** - * @param \string $city + * @param string $city * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setCity(\string $city) + public function setCity(string $city) { $this->city = $city; } /** - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getCountry() : \string + public function getCountry() : string { return $this->country; } /** - * @param \string $country + * @param string $country * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setCountry(\string $country) + public function setCountry(string $country) { $this->country = $country; } /** - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getAddress() : \string + public function getAddress() : string { return $this->address; } /** - * @param \string $address + * @param string $address * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setAddress(\string $address) + public function setAddress(string $address) { $this->address = $address; } /** - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getState() : \string + public function getState() : string { return $this->state; } /** - * @param \string $state + * @param string $state * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setState(\string $state) + public function setState(string $state) { $this->state = $state; } /** - * @return \float[] + * @return float[] * * @since 1.0.0 * @author Dennis Eichhorn @@ -221,7 +221,7 @@ class Location implements JsonableInterface } /** - * @param \float[] $geo + * @param float[] $geo * * @return void * @@ -251,7 +251,7 @@ class Location implements JsonableInterface /** * {@inheritdoc} */ - public function toJson(\int $option = 0) : \string + public function toJson(int $option = 0) : string { return json_encode($this->toArray()); } diff --git a/Datatypes/SmartDateTime.php b/Datatypes/SmartDateTime.php index 24af3cca6..8ce9e779a 100644 --- a/Datatypes/SmartDateTime.php +++ b/Datatypes/SmartDateTime.php @@ -44,17 +44,17 @@ class SmartDateTime extends \DateTime /** * Modify datetime in a smart way. * - * @param \int $y Year - * @param \int $m Month - * @param \int $d Day - * @param \int $calendar Calendar + * @param int $y Year + * @param int $m Month + * @param int $d Day + * @param int $calendar Calendar * * @return SmartDateTime * * @since 1.0.0 * @author Dennis Eichhorn */ - public function createModify(\int $y, \int $m = 0, \int $d = 0, \int $calendar = CAL_GREGORIAN) : SmartDateTime + public function createModify(int $y, int $m = 0, int $d = 0, int $calendar = CAL_GREGORIAN) : SmartDateTime { $dt = clone $this; $dt->smartModify($y, $m, $d, $calendar); @@ -65,17 +65,17 @@ class SmartDateTime extends \DateTime /** * Modify datetime in a smart way. * - * @param \int $y Year - * @param \int $m Month - * @param \int $d Day - * @param \int $calendar Calendar + * @param int $y Year + * @param int $m Month + * @param int $d Day + * @param int $calendar Calendar * * @return SmartDateTime * * @since 1.0.0 * @author Dennis Eichhorn */ - public function smartModify(\int $y, \int $m = 0, \int $d = 0, \int $calendar = CAL_GREGORIAN) : SmartDateTime + public function smartModify(int $y, int $m = 0, int $d = 0, int $calendar = CAL_GREGORIAN) : SmartDateTime { $y_change = floor(((int) $this->format('m') + $m) / 12); $y_change = ((int) $this->format('m') + $m) < 0 && ((int) $this->format('m') + $m) % 12 === 0 ? $y_change - 1 : $y_change; diff --git a/Dispatcher/Dispatcher.php b/Dispatcher/Dispatcher.php index 2d67e0ee9..04d3da311 100644 --- a/Dispatcher/Dispatcher.php +++ b/Dispatcher/Dispatcher.php @@ -70,7 +70,7 @@ class Dispatcher /** * Dispatch controller. * - * @param \string|array|\Closure $controller Controller string + * @param string|array|\Closure $controller Controller string * @param RequestAbstract $request Request * @param ResponseAbstract $response Response * @param mixed $data Data @@ -118,14 +118,14 @@ class Dispatcher /** * Get controller. * - * @param \string $controller Controller string + * @param string $controller Controller string * * @return mixed * * @since 1.0.0 * @author Dennis Eichhorn */ - public function get(\string $controller) + public function get(string $controller) { if (!isset($this->controllers[$controller])) { if (realpath($path = ROOT_PATH . '/' . str_replace('\\', '/', $controller) . '.php') === false) { @@ -142,14 +142,14 @@ class Dispatcher * Set controller by alias. * * @param ModuleAbstract $controller Controller - * @param \string $name Controller string + * @param string $name Controller string * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function set(ModuleAbstract $controller, \string $name) : \bool + public function set(ModuleAbstract $controller, string $name) : bool { if (!isset($this->controllers[$name])) { $this->controllers[$name] = $controller; diff --git a/Event/EventManager.php b/Event/EventManager.php index 3568d0bc6..4429455b8 100644 --- a/Event/EventManager.php +++ b/Event/EventManager.php @@ -51,7 +51,7 @@ class EventManager implements Mediator /** * {@inheritdoc} */ - public function attach(\string $event, \Closure $callback = null, \string $listener = null) : \string + public function attach(string $event, \Closure $callback = null, string $listener = null) : string { $this->events[$event][$listener] = $callback; @@ -61,7 +61,7 @@ class EventManager implements Mediator /** * {@inheritdoc} */ - public function trigger(\string $event, \Closure $callback = null, \string $source = null) : \int + public function trigger(string $event, \Closure $callback = null, string $source = null) : int { $count = 0; foreach ($this->events[$event] as $event) { @@ -82,16 +82,16 @@ class EventManager implements Mediator * * An object fires an event until it's callback returns false * - * @param \string $event Event ID + * @param string $event Event ID * @param \Closure $callback Callback function of the event. This will get triggered after firering all listener callbacks. - * @param \string $source What class is invoking this event + * @param string $source What class is invoking this event * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function triggerUntil(\string $event, \Closure $callback = null, \string $source = null) : \int + public function triggerUntil(string $event, \Closure $callback = null, string $source = null) : int { $run = true; $count = 0; @@ -113,7 +113,7 @@ class EventManager implements Mediator /** * {@inheritdoc} */ - public function detach(\int $event) + public function detach(int $event) { $this->events = ArrayUtils::unsetArray($event, $this->events, '/'); } @@ -121,12 +121,12 @@ class EventManager implements Mediator /** * Count event listenings. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function count() : \int + public function count() : int { return count($this->events); } diff --git a/Localization/L11nManager.php b/Localization/L11nManager.php index 330e3ba93..a1c96ee60 100644 --- a/Localization/L11nManager.php +++ b/Localization/L11nManager.php @@ -32,7 +32,7 @@ class L11nManager /** * Language. * - * @var \string[][] + * @var string[][] * @since 1.0.0 */ private $language = []; @@ -40,14 +40,14 @@ class L11nManager /** * Verify if language is loaded. * - * @param \string $language Language iso code + * @param string $language Language iso code * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function isLanguageLoaded(\string $language) : \bool + public function isLanguageLoaded(string $language) : bool { return isset($this->language[$language]); } @@ -58,9 +58,9 @@ class L11nManager * One module can only be loaded once. Once the module got loaded it's not * possible to load more language files later on. * - * @param \string $language Language iso code - * @param \string $from Module name - * @param \string[][] $files Language files content + * @param string $language Language iso code + * @param string $from Module name + * @param string[][] $files Language files content * * @return void * @@ -69,7 +69,7 @@ class L11nManager * @since 1.0.0 * @author Dennis Eichhorn */ - public function loadLanguage(\string $language, \string $from, array $files) + public function loadLanguage(string $language, string $from, array $files) { if(!isset($files[$from])) { throw new \Exception('Unexpected language key: ' . $from); @@ -86,15 +86,15 @@ class L11nManager /** * Get application language. * - * @param \string $language Language iso code - * @param \string $module Module name + * @param string $language Language iso code + * @param string $module Module name * * @return array * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getLanguage(\string $language, \string $module = null) : array + public function getLanguage(string $language, string $module = null) : array { if (!isset($module) && isset($this->language[$language])) { return $this->language[$language]; diff --git a/Localization/Localization.php b/Localization/Localization.php index 039d8f077..65b0a7cd3 100644 --- a/Localization/Localization.php +++ b/Localization/Localization.php @@ -33,7 +33,7 @@ class Localization /** * Country ID. * - * @var \string + * @var string * @since 1.0.0 */ private $country = ISO3166Enum::_US; @@ -41,7 +41,7 @@ class Localization /** * Timezone. * - * @var \string + * @var string * @since 1.0.0 */ private $timezone = 'America/New_York'; @@ -49,7 +49,7 @@ class Localization /** * Language ISO code. * - * @var \string + * @var string * @since 1.0.0 */ private $language = ISO639x1Enum::_EN; @@ -57,7 +57,7 @@ class Localization /** * Currency. * - * @var \string + * @var string * @since 1.0.0 */ private $currency = ISO4217Enum::C_USD; @@ -65,7 +65,7 @@ class Localization /** * Number format. * - * @var \string + * @var string * @since 1.0.0 */ private $decimal = '.'; @@ -73,7 +73,7 @@ class Localization /** * Number format. * - * @var \string + * @var string * @since 1.0.0 */ private $thousands = ','; @@ -81,7 +81,7 @@ class Localization /** * Time format. * - * @var \string + * @var string * @since 1.0.0 */ private $datetime = 'Y-m-d H:i:s'; @@ -89,7 +89,7 @@ class Localization /** * Language array. * - * @var \string[] + * @var string[] * @since 1.0.0 */ public $lang = []; @@ -105,25 +105,25 @@ class Localization } /** - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getCountry() : \string + public function getCountry() : string { return $this->country; } /** - * @param \string $country + * @param string $country * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setCountry(\string $country) + public function setCountry(string $country) { if(!ISO3166Enum::isValidValue($country)) { throw new InvalidEnumValue($country); @@ -133,25 +133,25 @@ class Localization } /** - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getTimezone() : \string + public function getTimezone() : string { return $this->timezone; } /** - * @param \string $timezone + * @param string $timezone * * @todo: maybe make parameter int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setTimezone(\string $timezone) + public function setTimezone(string $timezone) { if(!TimeZoneEnumArray::isValidValue($timezone)) { throw new InvalidEnumValue($timezone); @@ -161,25 +161,25 @@ class Localization } /** - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getLanguage() : \string + public function getLanguage() : string { return $this->language; } /** - * @param \string $language + * @param string $language * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setLanguage(\string $language) + public function setLanguage(string $language) { if(!ISO639x1Enum::isValidValue($language)) { throw new InvalidEnumValue($language); @@ -213,25 +213,25 @@ class Localization } /** - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getCurrency() : \string + public function getCurrency() : string { return $this->currency; } /** - * @param \string $currency + * @param string $currency * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setCurrency(\string $currency) + public function setCurrency(string $currency) { if(!ISO4217Enum::isValidValue($currency)) { throw new InvalidEnumValue($currency); @@ -241,73 +241,73 @@ class Localization } /** - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getDatetime() : \string + public function getDatetime() : string { return $this->datetime; } /** - * @param \string $datetime + * @param string $datetime * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setDatetime(\string $datetime) + public function setDatetime(string $datetime) { $this->datetime = $datetime; } /** - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getDecimal() : \string + public function getDecimal() : string { return $this->decimal; } /** - * @param \string $decimal + * @param string $decimal * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setDecimal(\string $decimal) + public function setDecimal(string $decimal) { $this->decimal = $decimal; } /** - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getThousands() : \string + public function getThousands() : string { return $this->thousands; } /** - * @param \string $thousands + * @param string $thousands * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setThousands(\string $thousands) + public function setThousands(string $thousands) { $this->thousands = $thousands; } diff --git a/Log/FileLogger.php b/Log/FileLogger.php index 819ff36b7..68cec9476 100644 --- a/Log/FileLogger.php +++ b/Log/FileLogger.php @@ -78,12 +78,12 @@ class FileLogger implements LoggerInterface * * Creates the logging object and overwrites all default values. * - * @param \string $lpath Path for logging + * @param string $lpath Path for logging * * @since 1.0.0 * @author Dennis Eichhorn */ - public function __construct(\string $lpath) + public function __construct(string $lpath) { $path = realpath($lpath); @@ -115,14 +115,14 @@ class FileLogger implements LoggerInterface /** * Returns instance. * - * @param \string $path Logging path + * @param string $path Logging path * * @return self * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getInstance(\string $path = '') + public static function getInstance(string $path = '') { if (self::$instance === null) { self::$instance = new self($path); @@ -159,7 +159,7 @@ class FileLogger implements LoggerInterface /** * Starts the time measurement. * - * @param \string $id the ID by which this time measurement gets identified + * @param string $id the ID by which this time measurement gets identified * * @return void * @@ -177,9 +177,9 @@ class FileLogger implements LoggerInterface /** * Ends the time measurement. * - * @param \string $id the ID by which this time measurement gets identified + * @param string $id the ID by which this time measurement gets identified * - * @return \int the time measurement + * @return int the time measurement * * @since 1.0.0 * @author Dennis Eichhorn @@ -213,16 +213,16 @@ class FileLogger implements LoggerInterface /** * Interpolate context * - * @param \string $message + * @param string $message * @param array $context - * @param \string $level + * @param string $level * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - private function interpolate(\string $message, array $context = [], \string $level = LogLevel::DEBUG) + private function interpolate(string $message, array $context = [], string $level = LogLevel::DEBUG) { $replace = []; foreach ($context as $key => $val) { @@ -257,7 +257,7 @@ class FileLogger implements LoggerInterface * @param array $a * @param array $b * - * @return \bool the comparison + * @return bool the comparison * * @since 1.0.0 * @author Dennis Eichhorn @@ -274,14 +274,14 @@ class FileLogger implements LoggerInterface /** * Write to file. * - * @param \string $message + * @param string $message * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - private function write(\string $message) + private function write(string $message) { $this->fp = fopen($this->path, 'a'); fwrite($this->fp, $message . "\n"); @@ -291,7 +291,7 @@ class FileLogger implements LoggerInterface /** * System is unusable. * - * @param \string $message + * @param string $message * @param array $context * * @return null @@ -299,7 +299,7 @@ class FileLogger implements LoggerInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function emergency(\string $message, array $context = []) + public function emergency(string $message, array $context = []) { $message = $this->interpolate($message, $context, LogLevel::EMERGENCY); $this->write($message); @@ -311,7 +311,7 @@ class FileLogger implements LoggerInterface * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * - * @param \string $message + * @param string $message * @param array $context * * @return void @@ -319,7 +319,7 @@ class FileLogger implements LoggerInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function alert(\string $message, array $context = []) + public function alert(string $message, array $context = []) { $message = $this->interpolate($message, $context, LogLevel::ALERT); $this->write($message); @@ -330,7 +330,7 @@ class FileLogger implements LoggerInterface * * Example: Application component unavailable, unexpected exception. * - * @param \string $message + * @param string $message * @param array $context * * @return void @@ -338,7 +338,7 @@ class FileLogger implements LoggerInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function critical(\string $message, array $context = []) + public function critical(string $message, array $context = []) { $message = $this->interpolate($message, $context, LogLevel::CRITICAL); $this->write($message); @@ -348,7 +348,7 @@ class FileLogger implements LoggerInterface * Runtime errors that do not require immediate action but should typically * be logged and monitored. * - * @param \string $message + * @param string $message * @param array $context * * @return void @@ -356,7 +356,7 @@ class FileLogger implements LoggerInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function error(\string $message, array $context = []) + public function error(string $message, array $context = []) { $message = $this->interpolate($message, $context, LogLevel::ERROR); $this->write($message); @@ -368,7 +368,7 @@ class FileLogger implements LoggerInterface * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * - * @param \string $message + * @param string $message * @param array $context * * @return void @@ -376,7 +376,7 @@ class FileLogger implements LoggerInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function warning(\string $message, array $context = []) + public function warning(string $message, array $context = []) { $message = $this->interpolate($message, $context, LogLevel::WARNING); $this->write($message); @@ -385,7 +385,7 @@ class FileLogger implements LoggerInterface /** * Normal but significant events. * - * @param \string $message + * @param string $message * @param array $context * * @return void @@ -393,7 +393,7 @@ class FileLogger implements LoggerInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function notice(\string $message, array $context = []) + public function notice(string $message, array $context = []) { $message = $this->interpolate($message, $context, LogLevel::NOTICE); $this->write($message); @@ -404,7 +404,7 @@ class FileLogger implements LoggerInterface * * Example: User logs in, SQL logs. * - * @param \string $message + * @param string $message * @param array $context * * @return void @@ -412,7 +412,7 @@ class FileLogger implements LoggerInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function info(\string $message, array $context = []) + public function info(string $message, array $context = []) { $message = $this->interpolate($message, $context, LogLevel::INFO); $this->write($message); @@ -421,7 +421,7 @@ class FileLogger implements LoggerInterface /** * Detailed debug information. * - * @param \string $message + * @param string $message * @param array $context * * @return void @@ -429,7 +429,7 @@ class FileLogger implements LoggerInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function debug(\string $message, array $context = []) + public function debug(string $message, array $context = []) { $message = $this->interpolate($message, $context, LogLevel::DEBUG); $this->write($message); @@ -438,8 +438,8 @@ class FileLogger implements LoggerInterface /** * Logs with an arbitrary level. * - * @param \string $level - * @param \string $message + * @param string $level + * @param string $message * @param array $context * * @return void @@ -447,7 +447,7 @@ class FileLogger implements LoggerInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function log(\string $level, \string $message, array $context = []) + public function log(string $level, string $message, array $context = []) { if (!LogLevel::isValidValue($level)) { throw new InvalidEnumValue($level); @@ -490,11 +490,11 @@ class FileLogger implements LoggerInterface /** * Find cricitcal connections. * - * @param \int $limit Amout of perpetrators + * @param int $limit Amout of perpetrators * * @return array */ - public function getHighestPerpetrator(\int $limit = 10) + public function getHighestPerpetrator(int $limit = 10) { $connection = []; @@ -523,12 +523,12 @@ class FileLogger implements LoggerInterface /** * Get logging messages from file. * - * @param \int $limit Amout of perpetrators - * @param \int $offset Offset + * @param int $limit Amout of perpetrators + * @param int $offset Offset * * @return array */ - public function get(\int $limit = 25, \int $offset = 0) : array + public function get(int $limit = 25, int $offset = 0) : array { $logs = []; $id = 0; @@ -570,11 +570,11 @@ class FileLogger implements LoggerInterface /** * Get single logging message from file. * - * @param \int $id Id/Line number of the logging message + * @param int $id Id/Line number of the logging message * * @return array */ - public function getByLine(\int $id = 1) : array + public function getByLine(int $id = 1) : array { $log = []; $current = 0; diff --git a/Log/LoggerInterface.php b/Log/LoggerInterface.php index e18c14b8a..1bae8ff51 100644 --- a/Log/LoggerInterface.php +++ b/Log/LoggerInterface.php @@ -21,12 +21,12 @@ interface LoggerInterface /** * System is unusable. * - * @param \string $message + * @param string $message * @param array $context * * @return null */ - public function emergency(\string $message, array $context = []); + public function emergency(string $message, array $context = []); /** * Action must be taken immediately. @@ -34,35 +34,35 @@ interface LoggerInterface * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * - * @param \string $message + * @param string $message * @param array $context * * @return null */ - public function alert(\string $message, array $context = []); + public function alert(string $message, array $context = []); /** * Critical conditions. * * Example: Application component unavailable, unexpected exception. * - * @param \string $message + * @param string $message * @param array $context * * @return null */ - public function critical(\string $message, array $context = []); + public function critical(string $message, array $context = []); /** * Runtime errors that do not require immediate action but should typically * be logged and monitored. * - * @param \string $message + * @param string $message * @param array $context * * @return null */ - public function error(\string $message, array $context = []); + public function error(string $message, array $context = []); /** * Exceptional occurrences that are not errors. @@ -70,53 +70,53 @@ interface LoggerInterface * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * - * @param \string $message + * @param string $message * @param array $context * * @return null */ - public function warning(\string $message, array $context = []); + public function warning(string $message, array $context = []); /** * Normal but significant events. * - * @param \string $message + * @param string $message * @param array $context * * @return null */ - public function notice(\string $message, array $context = []); + public function notice(string $message, array $context = []); /** * Interesting events. * * Example: User logs in, SQL logs. * - * @param \string $message + * @param string $message * @param array $context * * @return null */ - public function info(\string $message, array $context = []); + public function info(string $message, array $context = []); /** * Detailed debug information. * - * @param \string $message + * @param string $message * @param array $context * * @return null */ - public function debug(\string $message, array $context = []); + public function debug(string $message, array $context = []); /** * Logs with an arbitrary level. * - * @param \string $level - * @param \string $message + * @param string $level + * @param string $message * @param array $context * * @return null */ - public function log(\string $level, \string $message, array $context = []); + public function log(string $level, string $message, array $context = []); } diff --git a/Math/Algebra/PointPolygonIntersection.php b/Math/Algebra/PointPolygonIntersection.php index 0dec9b40d..8ccd2b589 100644 --- a/Math/Algebra/PointPolygonIntersection.php +++ b/Math/Algebra/PointPolygonIntersection.php @@ -23,7 +23,7 @@ class PointPolygonIntersection { } - public static function pointInPolygon(array $point, array $vertices) : \int + public static function pointInPolygon(array $point, array $vertices) : int { $length = count($vertices); diff --git a/Math/Differential/FiniteDifference.php b/Math/Differential/FiniteDifference.php index cb4b7bd02..32938b145 100644 --- a/Math/Differential/FiniteDifference.php +++ b/Math/Differential/FiniteDifference.php @@ -50,7 +50,7 @@ class FiniteDifference * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getNewtonDifferenceQuotient(\string $formula, array $variable) : \float + public static function getNewtonDifferenceQuotient(string $formula, array $variable) : float { return (Evaluator::evaluate($formula, ['x' => $variable['x'] + self::EPSILON]) - Evaluator::evaluate($formula, ['x' => $variable['x']])) / self::EPSILON; } @@ -68,7 +68,7 @@ class FiniteDifference * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSymmetricDifferenceQuotient(\string $formula, array $variable) : \float + public static function getSymmetricDifferenceQuotient(string $formula, array $variable) : float { return (Evaluator::evaluate($formula, ['x' => $variable['x'] + self::EPSILON]) - Evaluator::evaluate($formula, ['x' => $variable['x'] - self::EPSILON])) / (2 * self::EPSILON); } @@ -89,7 +89,7 @@ class FiniteDifference * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFivePointStencil(\string $formula, array $variable, \int $derivative = 1) : \float + public static function getFivePointStencil(string $formula, array $variable, int $derivative = 1) : float { if ($derivative === 1) { return (-Evaluator::evaluate($formula, ['x' => $variable['x'] + 2 * self::EPSILON]) + 8 * Evaluator::evaluate($formula, ['x' => $variable['x'] + self::EPSILON]) - 8 * Evaluator::evaluate($formula, ['x' => $variable['x'] - self::EPSILON]) + Evaluator::evaluate($formula, ['x' => $variable['x'] - 2 * self::EPSILON])) / (12 * self::EPSILON); diff --git a/Math/Finance/FinanceFormulas.php b/Math/Finance/FinanceFormulas.php index 3fd06b370..46b275db4 100644 --- a/Math/Finance/FinanceFormulas.php +++ b/Math/Finance/FinanceFormulas.php @@ -34,15 +34,15 @@ class FinanceFormulas /** * Annual Percentage Yield * - * @param \float $r Stated annual interest rate - * @param \int $n number of times compounded + * @param float $r Stated annual interest rate + * @param int $n number of times compounded * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getAnnualPercentageYield(\float $r, \int $n) : \float + public static function getAnnualPercentageYield(float $r, int $n) : float { return pow(1 + $r / $n, $n) - 1; } @@ -50,15 +50,15 @@ class FinanceFormulas /** * Annual Percentage Yield * - * @param \float $apy Annual percentage yield - * @param \int $n Number of times compounded + * @param float $apy Annual percentage yield + * @param int $n Number of times compounded * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getStateAnnualInterestRateOfAPY(\float $apy, \int $n) : \float + public static function getStateAnnualInterestRateOfAPY(float $apy, int $n) : float { return (pow($apy + 1, 1 / $n) - 1) * $n; } @@ -66,16 +66,16 @@ class FinanceFormulas /** * Annuity - Future Value * - * @param \float $P Periodic payment - * @param \float $r Stated annual interest rate - * @param \int $n Number of periods + * @param float $P Periodic payment + * @param float $r Stated annual interest rate + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFutureValueOfAnnuity(\float $P, \float $r, \int $n) : \float + public static function getFutureValueOfAnnuity(float $P, float $r, int $n) : float { return $P * (pow(1 + $r, $n) - 1) / $r; } @@ -83,16 +83,16 @@ class FinanceFormulas /** * Annuity - Future Value * - * @param \float $fva Future value annuity - * @param \float $P Periodic payment - * @param \float $r Stated annual interest rate + * @param float $fva Future value annuity + * @param float $P Periodic payment + * @param float $r Stated annual interest rate * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getNumberOfPeriodsOfFVA(\float $fva, \float $P, \float $r) : \int + public static function getNumberOfPeriodsOfFVA(float $fva, float $P, float $r) : int { return (int) round(log($fva / $P * $r + 1) / log(1 + $r)); } @@ -100,16 +100,16 @@ class FinanceFormulas /** * Future Value * - * @param \float $fva Future value annuity - * @param \float $r Stated annual interest rate - * @param \int $n Number of periods + * @param float $fva Future value annuity + * @param float $r Stated annual interest rate + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPeriodicPaymentOfFVA(\float $fva, \float $r, \int $n) : \float + public static function getPeriodicPaymentOfFVA(float $fva, float $r, int $n) : float { return $fva / ((pow(1 + $r, $n) - 1) / $r); } @@ -118,16 +118,16 @@ class FinanceFormulas /** * Annuity - Future Value w/ Continuous Compounding * - * @param \float $cf Cach flow - * @param \float $r Rate - * @param \int $t Time + * @param float $cf Cach flow + * @param float $r Rate + * @param int $t Time * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFutureValueOfAnnuityConinuousCompounding(\float $cf, \float $r, \int $t) : \float + public static function getFutureValueOfAnnuityConinuousCompounding(float $cf, float $r, int $t) : float { return $cf * (exp($r * $t) - 1) / (exp($r) - 1); } @@ -135,16 +135,16 @@ class FinanceFormulas /** * Annuity - Future Value w/ Continuous Compounding * - * @param \float $fvacc Future value annuity continuous compoinding - * @param \float $r Rate - * @param \int $t Time + * @param float $fvacc Future value annuity continuous compoinding + * @param float $r Rate + * @param int $t Time * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCashFlowOfFVACC(\float $fvacc, \float $r, \int $t) : \float + public static function getCashFlowOfFVACC(float $fvacc, float $r, int $t) : float { return $fvacc / ((exp($r * $t) - 1) / (exp($r) - 1)); } @@ -152,16 +152,16 @@ class FinanceFormulas /** * Annuity - Future Value w/ Continuous Compounding * - * @param \float $fvacc Future value annuity continuous compoinding - * @param \float $cf Cach flow - * @param \float $r Rate + * @param float $fvacc Future value annuity continuous compoinding + * @param float $cf Cach flow + * @param float $r Rate * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getTimeOfFVACC(\float $fvacc, \float $cf, \float $r) : \int + public static function getTimeOfFVACC(float $fvacc, float $cf, float $r) : int { return (int) round(log($fvacc / $cf * (exp($r) - 1) + 1) / $r); } @@ -169,16 +169,16 @@ class FinanceFormulas /** * Annuity - Payment (PV) * - * @param \float $pv Present value - * @param \float $r Rate per period - * @param \int $n Number of periods + * @param float $pv Present value + * @param float $r Rate per period + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getAnnuityPaymentPV(\float $pv, \float $r, \int $n) : \float + public static function getAnnuityPaymentPV(float $pv, float $r, int $n) : float { return $r * $pv / (1 - pow(1 + $r, -$n)); } @@ -186,16 +186,16 @@ class FinanceFormulas /** * Annuity - Payment (PV) * - * @param \float $p Payment - * @param \float $pv Present value - * @param \float $r Rate per period + * @param float $p Payment + * @param float $pv Present value + * @param float $r Rate per period * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getNumberOfAPPV(\float $p, \float $pv, \float $r) : \int + public static function getNumberOfAPPV(float $p, float $pv, float $r) : int { return (int) round(-log(-($r * $pv / $p - 1)) / log(1 + $r)); } @@ -203,16 +203,16 @@ class FinanceFormulas /** * Annuity - Payment (PV) * - * @param \float $p Payment - * @param \float $r Rate per period - * @param \int $n Number of periods + * @param float $p Payment + * @param float $r Rate per period + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPresentValueOfAPPV(\float $p, \float $r, \int $n) : \float + public static function getPresentValueOfAPPV(float $p, float $r, int $n) : float { return $p / $r * (1 - pow(1 + $r, -$n)); } @@ -220,16 +220,16 @@ class FinanceFormulas /** * Annuity - Payment (FV) * - * @param \float $fv Present value - * @param \float $r Rate per period - * @param \int $n Number of periods + * @param float $fv Present value + * @param float $r Rate per period + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getAnnuityPaymentFV(\float $fv, \float $r, \int $n) : \float + public static function getAnnuityPaymentFV(float $fv, float $r, int $n) : float { return $r * $fv / (pow(1 + $r, $n) - 1); } @@ -237,16 +237,16 @@ class FinanceFormulas /** * Annuity - Payment (FV) * - * @param \float $p Payment - * @param \float $fv Present value - * @param \float $r Rate per period + * @param float $p Payment + * @param float $fv Present value + * @param float $r Rate per period * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getNumberOfAPFV(\float $p, \float $fv, \float $r) : \int + public static function getNumberOfAPFV(float $p, float $fv, float $r) : int { return (int) round(log($fv * $r / $p + 1) / log(1 + $r)); } @@ -254,16 +254,16 @@ class FinanceFormulas /** * Annuity - Payment (FV) * - * @param \float $p Payment - * @param \float $r Present value - * @param \int $n Rate per period + * @param float $p Payment + * @param float $r Present value + * @param int $n Rate per period * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFutureValueOfAPFV(\float $p, \float $r, \int $n) : \float + public static function getFutureValueOfAPFV(float $p, float $r, int $n) : float { return $p / $r * (pow(1 + $r, $n) - 1); } @@ -271,15 +271,15 @@ class FinanceFormulas /** * Annuity - Payment Factor (PV) * - * @param \float $r Rate per period - * @param \int $n Number of periods + * @param float $r Rate per period + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getAnnutiyPaymentFactorPV(\float $r, \int $n) : \float + public static function getAnnutiyPaymentFactorPV(float $r, int $n) : float { return $r / (1 - pow(1 + $r, -$n)); } @@ -287,15 +287,15 @@ class FinanceFormulas /** * Annuity - Payment Factor (PV) * - * @param \float $p Payment factor - * @param \float $r Rate per period + * @param float $p Payment factor + * @param float $r Rate per period * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getNumberOfAPFPV(\float $p, \float $r) : \int + public static function getNumberOfAPFPV(float $p, float $r) : int { return (int) round(-log(-($r / $p - 1)) / log(1 + $r)); } @@ -303,16 +303,16 @@ class FinanceFormulas /** * Annuity - Present Value * - * @param \float $P Periodic payment - * @param \float $r Stated annual interest rate - * @param \int $n Number of periods + * @param float $P Periodic payment + * @param float $r Stated annual interest rate + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPresentValueOfAnnuity(\float $P, \float $r, \int $n) : \float + public static function getPresentValueOfAnnuity(float $P, float $r, int $n) : float { return $P * (1 - pow(1 + $r, -$n)) / $r; } @@ -320,16 +320,16 @@ class FinanceFormulas /** * Annuity - Present Value * - * @param \float $pva Future value annuity - * @param \float $P Periodic payment - * @param \float $r Stated annual interest rate + * @param float $pva Future value annuity + * @param float $P Periodic payment + * @param float $r Stated annual interest rate * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getNumberOfPeriodsOfPVA(\float $pva, \float $P, \float $r) : \int + public static function getNumberOfPeriodsOfPVA(float $pva, float $P, float $r) : int { return (int) round(-log(-($pva / $P * $r - 1)) / log(1 + $r)); } @@ -337,16 +337,16 @@ class FinanceFormulas /** * Annuity - Present Value * - * @param \float $pva Future value annuity - * @param \float $r Stated annual interest rate - * @param \int $n Number of periods + * @param float $pva Future value annuity + * @param float $r Stated annual interest rate + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPeriodicPaymentOfPVA(\float $pva, \float $r, \int $n) : \float + public static function getPeriodicPaymentOfPVA(float $pva, float $r, int $n) : float { return $pva / ((1 - pow(1 + $r, -$n)) / $r); } @@ -354,15 +354,15 @@ class FinanceFormulas /** * Annuity - PV Factor * - * @param \float $r Rate per period - * @param \int $n Number of periods + * @param float $r Rate per period + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPresentValueAnnuityFactor(\float $r, \int $n) : \float + public static function getPresentValueAnnuityFactor(float $r, int $n) : float { return (1 - pow(1 + $r, -$n)) / $r; } @@ -370,15 +370,15 @@ class FinanceFormulas /** * Annuity - PV Factor * - * @param \float $p Payment factor - * @param \float $r Rete per period + * @param float $p Payment factor + * @param float $r Rete per period * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPeriodsOfPVAF(\float $p, \float $r) : \int + public static function getPeriodsOfPVAF(float $p, float $r) : int { return (int) round(-log(-($p * $r - 1)) / log(1 + $r)); } @@ -386,16 +386,16 @@ class FinanceFormulas /** * Annuity Due - Present Value * - * @param \float $P Periodic payment - * @param \float $r Rate per period - * @param \int $n Number of periods + * @param float $P Periodic payment + * @param float $r Rate per period + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPresentValueOfAnnuityDue(\float $P, \float $r, \int $n) : \float + public static function getPresentValueOfAnnuityDue(float $P, float $r, int $n) : float { return $P + $P * ((1 - pow(1 + $r, -($n - 1))) / $r); } @@ -405,16 +405,16 @@ class FinanceFormulas * * Using alternative formula for PV * - * @param \float $PV Present value - * @param \float $r Rate per period - * @param \int $n Number of periods + * @param float $PV Present value + * @param float $r Rate per period + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPeriodicPaymentOfPVAD(\float $PV, \float $r, \int $n) : \float + public static function getPeriodicPaymentOfPVAD(float $PV, float $r, int $n) : float { return $PV * $r / (1 - pow(1 + $r, -$n)) * 1 / (1 + $r); } @@ -422,16 +422,16 @@ class FinanceFormulas /** * Annuity Due - Present Value * - * @param \float $PV Present value - * @param \float $P Periodic payment - * @param \float $r Rate per period + * @param float $PV Present value + * @param float $P Periodic payment + * @param float $r Rate per period * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPeriodsOfPVAD(\float $PV, \float $P, \float $r) : \int + public static function getPeriodsOfPVAD(float $PV, float $P, float $r) : int { return (int) round((($PV - $P) / $P * $r - 1) / log(1 + $r) + 1); } @@ -439,16 +439,16 @@ class FinanceFormulas /** * Annuity Due - Future Value * - * @param \float $P Periodic payment - * @param \float $r Rate per period - * @param \int $n Number of periods + * @param float $P Periodic payment + * @param float $r Rate per period + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFutureValueOfAnnuityDue(\float $P, \float $r, \int $n) : \float + public static function getFutureValueOfAnnuityDue(float $P, float $r, int $n) : float { return (1 + $r) * $P * (pow(1 + $r, $n) - 1) / $r; } @@ -456,16 +456,16 @@ class FinanceFormulas /** * Annuity Due - Future Value * - * @param \float $FV Future value - * @param \float $r Rate per period - * @param \int $n Number of periods + * @param float $FV Future value + * @param float $r Rate per period + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPeriodicPaymentOfFVAD(\float $FV, \float $r, \int $n) : \float + public static function getPeriodicPaymentOfFVAD(float $FV, float $r, int $n) : float { return $FV / ((1 + $r) * ((pow(1 + $r, $n) - 1) / $r)); } @@ -473,16 +473,16 @@ class FinanceFormulas /** * Annuity Due - Future Value * - * @param \float $FV Future value - * @param \float $P Periodic payment - * @param \float $r Rate per period + * @param float $FV Future value + * @param float $P Periodic payment + * @param float $r Rate per period * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPeriodsOfFVAD(\float $FV, \float $P, \float $r) : \int + public static function getPeriodsOfFVAD(float $FV, float $P, float $r) : int { return (int) round(log($FV / (1 + $r) / $P * $r + 1) / log(1 + $r)); } @@ -490,15 +490,15 @@ class FinanceFormulas /** * Asset to Sales Ratio * - * @param \float $assets Assets - * @param \float $revenue Revenue + * @param float $assets Assets + * @param float $revenue Revenue * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getAssetToSalesRatio(\float $assets, \float $revenue) : \float + public static function getAssetToSalesRatio(float $assets, float $revenue) : float { return $assets / $revenue; } @@ -506,15 +506,15 @@ class FinanceFormulas /** * Asset Turnover Ratio * - * @param \float $assets Assets - * @param \float $revenue Revenue + * @param float $assets Assets + * @param float $revenue Revenue * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getAssetTurnoverRatio(\float $assets, \float $revenue) : \float + public static function getAssetTurnoverRatio(float $assets, float $revenue) : float { return $revenue / $assets; } @@ -522,15 +522,15 @@ class FinanceFormulas /** * Average Collection Period * - * @param \float $receivables Receivables turnover (use getReceivablesTurnover) - * @param \int $period Period + * @param float $receivables Receivables turnover (use getReceivablesTurnover) + * @param int $period Period * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getAverageCollectionPeriod(\float $receivables, \int $period = 365) : \float + public static function getAverageCollectionPeriod(float $receivables, int $period = 365) : float { return $period / $receivables; } @@ -538,15 +538,15 @@ class FinanceFormulas /** * Receivables Turnover * - * @param \float $sales Sales in period - * @param \float $receivables Avg. account receivables + * @param float $sales Sales in period + * @param float $receivables Avg. account receivables * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getReceivablesTurnover(\float $sales, \float $receivables) : \float + public static function getReceivablesTurnover(float $sales, float $receivables) : float { return $sales / $receivables; } @@ -554,16 +554,16 @@ class FinanceFormulas /** * Compound Interest * - * @param \float $P Principal - * @param \float $r Rate per period - * @param \int $n Number of periods + * @param float $P Principal + * @param float $r Rate per period + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCompoundInterest(\float $P, \float $r, \int $n) : \float + public static function getCompoundInterest(float $P, float $r, int $n) : float { return $P * (pow(1 + $r, $n) - 1); } @@ -571,16 +571,16 @@ class FinanceFormulas /** * Continuous Compounding * - * @param \float $P Principal - * @param \float $r Rate per period - * @param \int $t Time + * @param float $P Principal + * @param float $r Rate per period + * @param int $t Time * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getContinuousCompounding(\float $P, \float $r, \int $t) : \float + public static function getContinuousCompounding(float $P, float $r, int $t) : float { return $P * exp($r * $t); } @@ -588,15 +588,15 @@ class FinanceFormulas /** * Current Ratio * - * @param \float $assets Assets - * @param \float $liabilities Liabilities + * @param float $assets Assets + * @param float $liabilities Liabilities * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCurrentRaio(\float $assets, \float $liabilities) : \float + public static function getCurrentRaio(float $assets, float $liabilities) : float { return $assets / $liabilities; } @@ -604,14 +604,14 @@ class FinanceFormulas /** * Days in Inventory * - * @param \float $inventory Inventory turnover + * @param float $inventory Inventory turnover * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getDaysInInventory(\float $inventory) : \float + public static function getDaysInInventory(float $inventory) : float { return 365 / $inventory; } @@ -619,15 +619,15 @@ class FinanceFormulas /** * Debt Coverage Ratio * - * @param \float $income Net operating income - * @param \float $service Debt service + * @param float $income Net operating income + * @param float $service Debt service * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getDebtCoverageRatio(\float $income, \float $service) : \float + public static function getDebtCoverageRatio(float $income, float $service) : float { return $income / $service; } @@ -635,15 +635,15 @@ class FinanceFormulas /** * Debt Ratio * - * @param \float $liabilities Total liabilities - * @param \float $assets Total assets + * @param float $liabilities Total liabilities + * @param float $assets Total assets * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getDebtRatio(\float $liabilities, \float $assets) : \float + public static function getDebtRatio(float $liabilities, float $assets) : float { return $liabilities / $assets; } @@ -651,15 +651,15 @@ class FinanceFormulas /** * Debt to Equity Ratio (D/E) * - * @param \float $liabilities Total liabilities - * @param \float $equity Total assets + * @param float $liabilities Total liabilities + * @param float $equity Total assets * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getDebtToEquityRatio(\float $liabilities, \float $equity) : \float + public static function getDebtToEquityRatio(float $liabilities, float $equity) : float { return $liabilities / $equity; } @@ -667,15 +667,15 @@ class FinanceFormulas /** * Debt to Income Ratio (D/I) * - * @param \float $payments Periodic payments - * @param \float $income Periodic income + * @param float $payments Periodic payments + * @param float $income Periodic income * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getDebtToIncomeRatio(\float $payments, \float $income) : \float + public static function getDebtToIncomeRatio(float $payments, float $income) : float { return $payments / $income; } @@ -683,16 +683,16 @@ class FinanceFormulas /** * Discounted Payback Period * - * @param \float $CF Periodic cash flow - * @param \float $O1 Initial Investment (Outflow) - * @param \float $r Rate + * @param float $CF Periodic cash flow + * @param float $O1 Initial Investment (Outflow) + * @param float $r Rate * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getDiscountedPaybackPeriod(\float $CF, \float $O1, \float $r) : \float + public static function getDiscountedPaybackPeriod(float $CF, float $O1, float $r) : float { return log(1 / (1 - $O1 * $r / $CF)) / log(1 + $r); } @@ -700,14 +700,14 @@ class FinanceFormulas /** * Doubling Time * - * @param \float $r Rate of return + * @param float $r Rate of return * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getDoublingTime(\float $r) : \float + public static function getDoublingTime(float $r) : float { return log(2) / log(1 + $r); } @@ -715,14 +715,14 @@ class FinanceFormulas /** * Doubling Time - Continuous Compounding * - * @param \float $r Rate of return + * @param float $r Rate of return * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getDoublingTimeContinuousCompounding(\float $r) : \float + public static function getDoublingTimeContinuousCompounding(float $r) : float { return log(2) / $r; } @@ -730,16 +730,16 @@ class FinanceFormulas /** * Equivalent Annual Annuity * - * @param \float $NPV Net present value - * @param \float $r Rate per period - * @param \int $n Number of periods + * @param float $NPV Net present value + * @param float $r Rate per period + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getEquivalentAnnualAnnuity(\float $NPV, \float $r, \int $n) : \float + public static function getEquivalentAnnualAnnuity(float $NPV, float $r, int $n) : float { return $r * $NPV / (1 - pow(1 + $r, -$n)); } @@ -747,16 +747,16 @@ class FinanceFormulas /** * Equivalent Annual Annuity * - * @param \float $C Equivalent annuity cash flow - * @param \float $NPV Net present value - * @param \float $r Rate per period + * @param float $C Equivalent annuity cash flow + * @param float $NPV Net present value + * @param float $r Rate per period * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPeriodsOfEAA(\float $C, \float $NPV, \float $r) : \int + public static function getPeriodsOfEAA(float $C, float $NPV, float $r) : int { return (int) round(log(-$r * $NPV / $C + 1) / log(1 + $r)); } @@ -764,16 +764,16 @@ class FinanceFormulas /** * Equivalent Annual Annuity * - * @param \float $C Net present value - * @param \float $r Rate per period - * @param \int $n Number of periods + * @param float $C Net present value + * @param float $r Rate per period + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getNetPresentValueOfEAA(\float $C, \float $r, \int $n) : \float + public static function getNetPresentValueOfEAA(float $C, float $r, int $n) : float { return $C / $r * (1 - pow(1 + $r, -$n)); } @@ -781,18 +781,18 @@ class FinanceFormulas /** * Free Cash Flow to Equity (FCFE) * - * @param \float $income Net income - * @param \float $depamo Depreciation & amortisation - * @param \float $capital Capital expenses - * @param \float $wc Change in working capital - * @param \float $borrowing Net Borrowing + * @param float $income Net income + * @param float $depamo Depreciation & amortisation + * @param float $capital Capital expenses + * @param float $wc Change in working capital + * @param float $borrowing Net Borrowing * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFreeCashFlowToEquity(\float $income, \float $depamo, \float $capital, \float $wc, \float $borrowing) : \float + public static function getFreeCashFlowToEquity(float $income, float $depamo, float $capital, float $wc, float $borrowing) : float { return $income + $depamo - $capital - $wc + $borrowing; } @@ -800,18 +800,18 @@ class FinanceFormulas /** * Free Cash Flow to Firm (FCFF) * - * @param \float $ebit EBIT - * @param \float $t Tax rate - * @param \float $depamo Depreciation & amortisation - * @param \float $capital Capital expenses - * @param \float $wc Change in working capital + * @param float $ebit EBIT + * @param float $t Tax rate + * @param float $depamo Depreciation & amortisation + * @param float $capital Capital expenses + * @param float $wc Change in working capital * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFreeCashFlowToFirm(\float $ebit, \float $t, \float $depamo, \float $capital, \float $wc) : \float + public static function getFreeCashFlowToFirm(float $ebit, float $t, float $depamo, float $capital, float $wc) : float { return $ebit * (1 - $t) + $depamo - $capital - $wc; } @@ -819,16 +819,16 @@ class FinanceFormulas /** * Future Value * - * @param \float $C Cash flow at period 0 - * @param \float $r Rate of return - * @param \int $n Numbers of periods + * @param float $C Cash flow at period 0 + * @param float $r Rate of return + * @param int $n Numbers of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFutureValue(\float $C, \float $r, \int $n) : \float + public static function getFutureValue(float $C, float $r, int $n) : float { return $C * pow(1 + $r, $n); } @@ -836,16 +836,16 @@ class FinanceFormulas /** * Future Value - Continuous Compounding * - * @param \float $PV Present value - * @param \float $r Rate of return - * @param \int $t Time + * @param float $PV Present value + * @param float $r Rate of return + * @param int $t Time * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFutureValueContinuousCompounding(\float $PV, \float $r, \int $t) : \float + public static function getFutureValueContinuousCompounding(float $PV, float $r, int $t) : float { return $PV * exp($r * $t); } @@ -853,15 +853,15 @@ class FinanceFormulas /** * Future Value Factor * - * @param \float $r Rate of return - * @param \int $n Number of periods + * @param float $r Rate of return + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFutureValueFactor(\float $r, \int $n) : \float + public static function getFutureValueFactor(float $r, int $n) : float { return pow(1 + $r, $n); } @@ -871,12 +871,12 @@ class FinanceFormulas * * @param array $r Rate of return * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getGeometricMeanReturn(array $r) : \float + public static function getGeometricMeanReturn(array $r) : float { return Average::geometricMean($r) - 1; } @@ -884,17 +884,17 @@ class FinanceFormulas /** * Growing Annuity - Future Value * - * @param \float $P First payment - * @param \float $r Rate of return - * @param \float $g Growth rate - * @param \int $n Number of periods + * @param float $P First payment + * @param float $r Rate of return + * @param float $g Growth rate + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getGrowingAnnuityFV(\float $P, \float $r, \float $g, \int $n) : \float + public static function getGrowingAnnuityFV(float $P, float $r, float $g, int $n) : float { return $P * (pow(1 + $r, $n) - pow(1 + $g, $n)) / ($r - $g); } @@ -902,17 +902,17 @@ class FinanceFormulas /** * Growing Annuity - Payment (PV) * - * @param \float $PV Present value - * @param \float $r Rate of return - * @param \float $g Growth rate - * @param \int $n Number of periods + * @param float $PV Present value + * @param float $r Rate of return + * @param float $g Growth rate + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getGrowingAnnuityPaymentPV(\float $PV, \float $r, \float $g, \int $n) : \float + public static function getGrowingAnnuityPaymentPV(float $PV, float $r, float $g, int $n) : float { return $PV * ($r - $g) / (1 - pow((1 + $g) / (1 + $r), $n)); } @@ -920,17 +920,17 @@ class FinanceFormulas /** * Growing Annuity - Payment (FV) * - * @param \float $FV Present value - * @param \float $r Rate of return - * @param \float $g Growth rate - * @param \int $n Number of periods + * @param float $FV Present value + * @param float $r Rate of return + * @param float $g Growth rate + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getGrowingAnnuityPaymentFV(\float $FV, \float $r, \float $g, \int $n) : \float + public static function getGrowingAnnuityPaymentFV(float $FV, float $r, float $g, int $n) : float { return $FV * ($r - $g) / (pow(1 + $r, $n) - pow(1 + $g, $n)); } @@ -938,17 +938,17 @@ class FinanceFormulas /** * Growing Annuity - Present Value * - * @param \float $P First payment - * @param \float $r Rate of return - * @param \float $g Growth rate - * @param \int $n Number of periods + * @param float $P First payment + * @param float $r Rate of return + * @param float $g Growth rate + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getGrowingAnnuityPV(\float $P, \float $r, \float $g, \int $n) : \float + public static function getGrowingAnnuityPV(float $P, float $r, float $g, int $n) : float { return $P / ($r - $g) * (1 - pow((1 + $g) / (1 + $r), $n)); } @@ -956,16 +956,16 @@ class FinanceFormulas /** * Growing Perpetuity - Present Value * - * @param \float $D Dividend or coupon at period 1 - * @param \float $r Rate of return - * @param \float $g Growth rate + * @param float $D Dividend or coupon at period 1 + * @param float $r Rate of return + * @param float $g Growth rate * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getGrowingPerpetuityPV(\float $D, \float $r, \float $g) : \float + public static function getGrowingPerpetuityPV(float $D, float $r, float $g) : float { return $D / ($r - $g); } @@ -973,15 +973,15 @@ class FinanceFormulas /** * Interest Coverage Ratio * - * @param \float $ebit EBIT - * @param \float $expense Interest expense + * @param float $ebit EBIT + * @param float $expense Interest expense * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getInterestCoverageRatio(\float $ebit, \float $expense) : \float + public static function getInterestCoverageRatio(float $ebit, float $expense) : float { return $ebit / $expense; } @@ -989,15 +989,15 @@ class FinanceFormulas /** * Inventory Turnover Ratio * - * @param \float $sales Sales - * @param \float $inventory Inventory + * @param float $sales Sales + * @param float $inventory Inventory * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getInventoryTurnoverRatio(\float $sales, \float $inventory) : \float + public static function getInventoryTurnoverRatio(float $sales, float $inventory) : float { return $sales / $inventory; } @@ -1006,16 +1006,16 @@ class FinanceFormulas * Net Present Value * * @param array $C Cash flow ($C[0] = initial investment) - * @param \float $r Discount rate + * @param float $r Discount rate * - * @return \float + * @return float * * @throws * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getNetPresentValue(array $C, \float $r) : \float + public static function getNetPresentValue(array $C, float $r) : float { $count = count($C); @@ -1035,15 +1035,15 @@ class FinanceFormulas /** * Net Profit Margin * - * @param \float $income Net income - * @param \float $sales Sales revenue + * @param float $income Net income + * @param float $sales Sales revenue * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getNetProfitMargin(\float $income, \float $sales) : \float + public static function getNetProfitMargin(float $income, float $sales) : float { return $income / $sales; } @@ -1051,15 +1051,15 @@ class FinanceFormulas /** * Net Working Capital * - * @param \float $assets Current assets - * @param \float $liabilities Current liabilities + * @param float $assets Current assets + * @param float $liabilities Current liabilities * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getNetWorkingCapital(\float $assets, \float $liabilities) : \float + public static function getNetWorkingCapital(float $assets, float $liabilities) : float { return $assets - $liabilities; } @@ -1067,16 +1067,16 @@ class FinanceFormulas /** * Number of Periods - PV & FV * - * @param \float $FV Future value - * @param \float $PV Present value - * @param \float $r Rate per period + * @param float $FV Future value + * @param float $PV Present value + * @param float $r Rate per period * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getNumberOfPeriodsPVFV(\float $FV, \float $PV, \float $r) : \float + public static function getNumberOfPeriodsPVFV(float $FV, float $PV, float $r) : float { return log($FV / $PV) / log(1 + $r); } @@ -1084,15 +1084,15 @@ class FinanceFormulas /** * Payback Period * - * @param \float $investment Initial investment - * @param \float $cash Periodic cash flow + * @param float $investment Initial investment + * @param float $cash Periodic cash flow * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPaybackPeriod(\float $investment, \float $cash) : \float + public static function getPaybackPeriod(float $investment, float $cash) : float { return $investment / $cash; } @@ -1100,15 +1100,15 @@ class FinanceFormulas /** * Perpetuity * - * @param \float $D Dividend or coupon per period - * @param \float $r Discount rate + * @param float $D Dividend or coupon per period + * @param float $r Discount rate * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPresentValueOfPerpetuity(\float $D, \float $r) : \float + public static function getPresentValueOfPerpetuity(float $D, float $r) : float { return $D / $r; } @@ -1116,16 +1116,16 @@ class FinanceFormulas /** * Number of Periods - PV & FV * - * @param \float $C Cash flow at period 1 - * @param \float $r Rate of return - * @param \int $n Number of periods + * @param float $C Cash flow at period 1 + * @param float $r Rate of return + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPresentValue(\float $C, \float $r, \int $n) : \float + public static function getPresentValue(float $C, float $r, int $n) : float { return $C / pow(1 + $r, $n); } @@ -1133,16 +1133,16 @@ class FinanceFormulas /** * PV - Continuous Compounding * - * @param \float $C Cash flow - * @param \float $r Rate of return - * @param \int $t Time + * @param float $C Cash flow + * @param float $r Rate of return + * @param int $t Time * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPresentValueContinuousCompounding(\float $C, \float $r, \int $t) : \float + public static function getPresentValueContinuousCompounding(float $C, float $r, int $t) : float { return $C / exp($r * $t); } @@ -1150,15 +1150,15 @@ class FinanceFormulas /** * Present Value Factor * - * @param \float $r Rate of return - * @param \int $n Number of periods + * @param float $r Rate of return + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPresentValueFactor(\float $r, \int $n) : \float + public static function getPresentValueFactor(float $r, int $n) : float { return 1 / pow(1 + $r, $n); } @@ -1166,15 +1166,15 @@ class FinanceFormulas /** * Quick Ratio * - * @param \float $assets Quick assets (current assets - inventory) - * @param \float $liabilities Current liabilities + * @param float $assets Quick assets (current assets - inventory) + * @param float $liabilities Current liabilities * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getQuickRatio(\float $assets, \float $liabilities) : \float + public static function getQuickRatio(float $assets, float $liabilities) : float { return $assets / $liabilities; } @@ -1182,15 +1182,15 @@ class FinanceFormulas /** * Rate of Inflation * - * @param \float $oldCPI Consumer price index old - * @param \float $newCPI Consumer price index new + * @param float $oldCPI Consumer price index old + * @param float $newCPI Consumer price index new * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getRateOfOnflation(\float $oldCPI, \float $newCPI) : \float + public static function getRateOfOnflation(float $oldCPI, float $newCPI) : float { return $newCPI / $oldCPI - 1; } @@ -1198,15 +1198,15 @@ class FinanceFormulas /** * Real Rate of Return * - * @param \float $nominal Nominal rate - * @param \float $inflation Inflation rate + * @param float $nominal Nominal rate + * @param float $inflation Inflation rate * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getRealRateOfReturn(\float $nominal, \float $inflation) : \float + public static function getRealRateOfReturn(float $nominal, float $inflation) : float { return (1 + $nominal) / (1 + $inflation) - 1; } @@ -1214,15 +1214,15 @@ class FinanceFormulas /** * Receivables Turnover Ratio * - * @param \float $sales Sales revenue - * @param \float $receivable Avg. accounts receivable + * @param float $sales Sales revenue + * @param float $receivable Avg. accounts receivable * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getReceivablesTurnoverRatio(\float $sales, \float $receivable) : \float + public static function getReceivablesTurnoverRatio(float $sales, float $receivable) : float { return $sales / $receivable; } @@ -1230,15 +1230,15 @@ class FinanceFormulas /** * Receivables Turnover Ratio * - * @param \float $income Net income - * @param \float $dividends Dividends + * @param float $income Net income + * @param float $dividends Dividends * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getRetentionRatio(\float $income, \float $dividends) : \float + public static function getRetentionRatio(float $income, float $dividends) : float { return ($income - $dividends) / $income; } @@ -1246,15 +1246,15 @@ class FinanceFormulas /** * Return on Assets (ROA) * - * @param \float $income Net income - * @param \float $assets Avg. total assets + * @param float $income Net income + * @param float $assets Avg. total assets * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getReturnOnAssets(\float $income, \float $assets) : \float + public static function getReturnOnAssets(float $income, float $assets) : float { return $income / $assets; } @@ -1262,15 +1262,15 @@ class FinanceFormulas /** * Return on Equity (ROE) * - * @param \float $income Net income - * @param \float $equity Avg. stockholder's equity + * @param float $income Net income + * @param float $equity Avg. stockholder's equity * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getReturnOnEquity(\float $income, \float $equity) : \float + public static function getReturnOnEquity(float $income, float $equity) : float { return $income / $equity; } @@ -1278,15 +1278,15 @@ class FinanceFormulas /** * Return on Investment (ROI) * - * @param \float $earnings Earnings - * @param \float $investment Initial investment + * @param float $earnings Earnings + * @param float $investment Initial investment * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getReturnOnInvestment(\float $earnings, \float $investment) : \float + public static function getReturnOnInvestment(float $earnings, float $investment) : float { return $earnings / $investment - 1; } @@ -1294,16 +1294,16 @@ class FinanceFormulas /** * Simple Interest * - * @param \float $P Principal - * @param \float $r Rate - * @param \int $t Time + * @param float $P Principal + * @param float $r Rate + * @param int $t Time * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSimpleInterest(\float $P, \float $r, \int $t) : \float + public static function getSimpleInterest(float $P, float $r, int $t) : float { return $P * $r * $t; } diff --git a/Math/Finance/Loan.php b/Math/Finance/Loan.php index f7feb613a..4eae42d68 100644 --- a/Math/Finance/Loan.php +++ b/Math/Finance/Loan.php @@ -31,17 +31,17 @@ class Loan /** * Balloon Loan - Payments * - * @param \float $PV Present value - * @param \float $r Rate per period - * @param \int $n Number of periods - * @param \float $balloon Balloon balance + * @param float $PV Present value + * @param float $r Rate per period + * @param int $n Number of periods + * @param float $balloon Balloon balance * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPaymentsOnBalloonLoan(\float $PV, \float $r, \int $n, \float $balloon = 0) : \float + public static function getPaymentsOnBalloonLoan(float $PV, float $r, int $n, float $balloon = 0) : float { return ($PV - $balloon / pow(1 + $r, $n)) * $r / (1 - pow(1 + $r, -$n)); } @@ -49,17 +49,17 @@ class Loan /** * Loan - Balloon Balance * - * @param \float $PV Present value (original balance) - * @param \float $P Payment - * @param \float $r Rate per payment - * @param \int $n Number of payments + * @param float $PV Present value (original balance) + * @param float $P Payment + * @param float $r Rate per payment + * @param int $n Number of payments * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getBalloonBalanceOfLoan(\float $PV, \float $P, \float $r, \int $n) : \float + public static function getBalloonBalanceOfLoan(float $PV, float $P, float $r, int $n) : float { return $PV * pow(1 + $r, $n) - $P * (pow(1 + $r, $n) - 1) / $r; } @@ -67,16 +67,16 @@ class Loan /** * Loan - Payment * - * @param \float $PV Present value (original balance) - * @param \float $r Rate per period - * @param \int $n Number of periods + * @param float $PV Present value (original balance) + * @param float $r Rate per period + * @param int $n Number of periods * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getLoanPayment(\float $PV, \float $r, \int $n) : \float + public static function getLoanPayment(float $PV, float $r, int $n) : float { return $r * $PV / (1 - pow(1 + $r, -$n)); } @@ -84,17 +84,17 @@ class Loan /** * Loan - Remaining Balance * - * @param \float $PV Present value (original balance) - * @param \float $P Payment - * @param \float $r Rate per payment - * @param \int $n Number of payments + * @param float $PV Present value (original balance) + * @param float $P Payment + * @param float $r Rate per payment + * @param int $n Number of payments * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getRemainingBalanceLoan(\float $PV, \float $P, \float $r, \int $n) : \float + public static function getRemainingBalanceLoan(float $PV, float $P, float $r, int $n) : float { return $PV * pow(1 + $r, $n) - $P * (pow(1 + $r, $n) - 1) / $r; } @@ -102,15 +102,15 @@ class Loan /** * Loan to Deposit Ratio * - * @param \float $loans Loans - * @param \float $deposits Deposits + * @param float $loans Loans + * @param float $deposits Deposits * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getLoanToDepositRatio(\float $loans, \float $deposits) : \float + public static function getLoanToDepositRatio(float $loans, float $deposits) : float { return $loans / $deposits; } @@ -118,15 +118,15 @@ class Loan /** * Loan to Value (LTV) * - * @param \float $loan Loan amount - * @param \float $collateral Value of collateral + * @param float $loan Loan amount + * @param float $collateral Value of collateral * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getLoanToValueRatio(\float $loan, \float $collateral) : \float + public static function getLoanToValueRatio(float $loan, float $collateral) : float { return $loan / $collateral; } diff --git a/Math/Finance/StockBonds.php b/Math/Finance/StockBonds.php index 9c37ee61c..53250bb66 100644 --- a/Math/Finance/StockBonds.php +++ b/Math/Finance/StockBonds.php @@ -31,16 +31,16 @@ class StockBonds /** * Bond Equivalent Yield * - * @param \float $fv Face value - * @param \float $price Price - * @param \int $days Days to maturity + * @param float $fv Face value + * @param float $price Price + * @param int $days Days to maturity * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getBondEquivalentYield(\float $fv, \float $price, \int $days) : \float + public static function getBondEquivalentYield(float $fv, float $price, int $days) : float { return ($fv - $price) / $price * 365 / $days; } @@ -48,15 +48,15 @@ class StockBonds /** * Book Value per Share * - * @param \float $total Total common stockholder's Equity - * @param \int $common Number of common shares + * @param float $total Total common stockholder's Equity + * @param int $common Number of common shares * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getBookValuePerShare(\float $total, \int $common) : \float + public static function getBookValuePerShare(float $total, int $common) : float { return $total / $common; } @@ -64,16 +64,16 @@ class StockBonds /** * Capital Asset Pricing Model (CAPM) * - * @param \float $rf Risk free rate - * @param \float $beta Risk to invest in a stock relative to the risk of the market - * @param \float $r Return on the market + * @param float $rf Risk free rate + * @param float $beta Risk to invest in a stock relative to the risk of the market + * @param float $r Return on the market * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getExpectedReturnCAPM(\float $rf, \float $beta, \float $r) : \float + public static function getExpectedReturnCAPM(float $rf, float $beta, float $r) : float { return $rf + $beta * ($r - $rf); } @@ -81,15 +81,15 @@ class StockBonds /** * Capital Gains Yield * - * @param \float $P0 Old stock price - * @param \float $P1 New stock price + * @param float $P0 Old stock price + * @param float $P1 New stock price * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCapitalGainsYield(\float $P0, \float $P1) : \float + public static function getCapitalGainsYield(float $P0, float $P1) : float { return $P1 / $P0 - 1; } @@ -97,15 +97,15 @@ class StockBonds /** * Current Yield * - * @param \float $coupons Annual coupons - * @param \float $price Current bond price + * @param float $coupons Annual coupons + * @param float $price Current bond price * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCurrentYield(\float $coupons, \float $price) : \float + public static function getCurrentYield(float $coupons, float $price) : float { return $coupons / $price; } @@ -113,16 +113,16 @@ class StockBonds /** * Diluted Earnings per Share * - * @param \float $income Net Income - * @param \float $avg Avg. shares - * @param \float $other Other convertible instruments + * @param float $income Net Income + * @param float $avg Avg. shares + * @param float $other Other convertible instruments * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getDilutedEarningsPerShare(\float $income, \float $avg, \float $other) : \float + public static function getDilutedEarningsPerShare(float $income, float $avg, float $other) : float { return $income / ($avg + $other); } @@ -130,15 +130,15 @@ class StockBonds /** * Dividend Payout Ratio * - * @param \float $dividends Dividends - * @param \float $income Net income + * @param float $dividends Dividends + * @param float $income Net income * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getDividendPayoutRatio(\float $dividends, \float $income) : \float + public static function getDividendPayoutRatio(float $dividends, float $income) : float { return $dividends / $income; } @@ -146,15 +146,15 @@ class StockBonds /** * Dividend Yield * - * @param \float $dividends Dividends - * @param \float $price Initial price for the period + * @param float $dividends Dividends + * @param float $price Initial price for the period * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getDividendYield(\float $dividends, \float $price) : \float + public static function getDividendYield(float $dividends, float $price) : float { return $dividends / $price; } @@ -162,15 +162,15 @@ class StockBonds /** * Dividend Yield * - * @param \float $dividends Dividends - * @param \int $shares Initial price for the period + * @param float $dividends Dividends + * @param int $shares Initial price for the period * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getDividendsPerShare(\float $dividends, \int $shares) : \float + public static function getDividendsPerShare(float $dividends, int $shares) : float { return $dividends / $shares; } @@ -178,15 +178,15 @@ class StockBonds /** * Earnings Per Share * - * @param \float $income Net income - * @param \float $shares Weighted avg. outstanding shares + * @param float $income Net income + * @param float $shares Weighted avg. outstanding shares * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getEarningsPerShare(\float $income, \float $shares) : \float + public static function getEarningsPerShare(float $income, float $shares) : float { return $income / $shares; } @@ -194,15 +194,15 @@ class StockBonds /** * Equity Multiplier * - * @param \float $assets Total assets - * @param \float $equity Stockholder's equity + * @param float $assets Total assets + * @param float $equity Stockholder's equity * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getEquityMultiplier(\float $assets, \float $equity) : \float + public static function getEquityMultiplier(float $assets, float $equity) : float { return $assets / $equity; } @@ -212,12 +212,12 @@ class StockBonds * * @param array $r Rate of return * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getHoldingPeriodReturn(array $r) : \float + public static function getHoldingPeriodReturn(array $r) : float { $hpr = 1.0; @@ -231,16 +231,16 @@ class StockBonds /** * Net Asset Value * - * @param \float $assets Fund assets - * @param \float $liabilities Fund liabilities - * @param \int $shares Outstanding shares + * @param float $assets Fund assets + * @param float $liabilities Fund liabilities + * @param int $shares Outstanding shares * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getNetAssetValue(\float $assets, \float $liabilities, \int $shares) : \float + public static function getNetAssetValue(float $assets, float $liabilities, int $shares) : float { return ($assets - $liabilities) / $shares; } @@ -248,15 +248,15 @@ class StockBonds /** * Price to Book Value * - * @param \float $market Market price per share - * @param \float $book Book value per share + * @param float $market Market price per share + * @param float $book Book value per share * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPriceToBookValue(\float $market, \float $book) : \float + public static function getPriceToBookValue(float $market, float $book) : float { return $market / $book; } @@ -264,15 +264,15 @@ class StockBonds /** * Price to Earnings (P/E Ratio) * - * @param \float $price Price per share - * @param \float $earnings Earnings per share + * @param float $price Price per share + * @param float $earnings Earnings per share * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPriceEarningsRatio(\float $price, \float $earnings) : \float + public static function getPriceEarningsRatio(float $price, float $earnings) : float { return $price / $earnings; } @@ -280,15 +280,15 @@ class StockBonds /** * Price to Sales (P/S Ratio) * - * @param \float $price Price per share - * @param \float $sales Sales per share + * @param float $price Price per share + * @param float $sales Sales per share * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPriceToSalesRatio(\float $price, \float $sales) : \float + public static function getPriceToSalesRatio(float $price, float $sales) : float { return $price / $sales; } @@ -296,16 +296,16 @@ class StockBonds /** * Stock - PV with Constant Growth * - * @param \float $dividend Estimated dividends for next period - * @param \float $r Required rate of return - * @param \float $g Growth rate + * @param float $dividend Estimated dividends for next period + * @param float $r Required rate of return + * @param float $g Growth rate * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPresentValueOfStockConstantGrowth(\float $dividend, \float $r, \float $g = 0.0) : \float + public static function getPresentValueOfStockConstantGrowth(float $dividend, float $r, float $g = 0.0) : float { return $dividend / ($r - $g); } @@ -313,15 +313,15 @@ class StockBonds /** * Tax Equivalent Yield * - * @param \float $free Tax free yield - * @param \float $tax Tax rate + * @param float $free Tax free yield + * @param float $tax Tax rate * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getTaxEquivalentYield(\float $free, \float $tax) : \float + public static function getTaxEquivalentYield(float $free, float $tax) : float { return $free / (1 - $tax); } @@ -329,16 +329,16 @@ class StockBonds /** * Total Stock Return * - * @param \float $P0 Initial stock price - * @param \float $P1 Ending stock price - * @param \float $D Dividends + * @param float $P0 Initial stock price + * @param float $P1 Ending stock price + * @param float $D Dividends * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getTotalStockReturn(\float $P0, \float $P1, \float $D) : \float + public static function getTotalStockReturn(float $P0, float $P1, float $D) : float { return ($P1 - $P0 + $D) / $P0; } @@ -346,17 +346,17 @@ class StockBonds /** * Yield to Maturity * - * @param \float $C Coupon/interest payment - * @param \float $F Face value - * @param \float $P Price - * @param \int $n Years to maturity + * @param float $C Coupon/interest payment + * @param float $F Face value + * @param float $P Price + * @param int $n Years to maturity * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getYieldToMaturity(\float $C, \float $F, \float $P, \int $n) : \float + public static function getYieldToMaturity(float $C, float $F, float $P, int $n) : float { return ($C + ($F - $P) / $n) / (($F + $P) / 2); } @@ -364,16 +364,16 @@ class StockBonds /** * Zero Coupon Bond Value * - * @param \float $F Face value - * @param \float $r Rate or yield - * @param \int $t Time to maturity + * @param float $F Face value + * @param float $r Rate or yield + * @param int $t Time to maturity * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getZeroCouponBondValue(\float $F, \float $r, \int $t) : \float + public static function getZeroCouponBondValue(float $F, float $r, int $t) : float { return $F / pow(1 + $r, $t); } @@ -381,16 +381,16 @@ class StockBonds /** * Zero Coupon Bond Effective Yield * - * @param \float $F Face value - * @param \float $PV Present value - * @param \int $n Time to maturity + * @param float $F Face value + * @param float $PV Present value + * @param int $n Time to maturity * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getZeroCouponBondEffectiveYield(\float $F, \float $PV, \int $n) : \float + public static function getZeroCouponBondEffectiveYield(float $F, float $PV, int $n) : float { return pow($F / $PV, 1 / $n) - 1; } diff --git a/Math/Functions.php b/Math/Functions.php index a8a2f0613..66d38c14d 100644 --- a/Math/Functions.php +++ b/Math/Functions.php @@ -41,7 +41,7 @@ class Functions * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getGammaInteger(\int $k) : \int + public static function getGammaInteger(int $k) : int { return self::fact($k - 1); } @@ -59,7 +59,7 @@ class Functions * @since 1.0.0 * @author Dennis Eichhorn */ - public static function fact(\int $n, \int $start = 1) : \int + public static function fact(int $n, int $start = 1) : int { $fact = 1; @@ -85,7 +85,7 @@ class Functions * @since 1.0.0 * @author Dennis Eichhorn */ - public static function binomialCoefficient(\int $n, \int $k) : \int + public static function binomialCoefficient(int $n, int $k) : int { $max = max([$k, $n - $k]); $min = min([$k, $n - $k]); diff --git a/Math/Optimization/TSP/BruteForce.php b/Math/Optimization/TSP/BruteForce.php index 8fec7c267..e2ee6f89a 100644 --- a/Math/Optimization/TSP/BruteForce.php +++ b/Math/Optimization/TSP/BruteForce.php @@ -74,7 +74,7 @@ class BruteForce * @since 1.0.0 * @author Dennis Eichhorn */ - public function getSolution(\int $limit = 1) : Population + public function getSolution(int $limit = 1) : Population { $population = new Population($this->cityPool, $limit, true); $cities = $this->cityPool->getCities(); diff --git a/Math/Optimization/TSP/City.php b/Math/Optimization/TSP/City.php index cece23c4b..62e32accd 100644 --- a/Math/Optimization/TSP/City.php +++ b/Math/Optimization/TSP/City.php @@ -64,7 +64,7 @@ class City * @since 1.0.0 * @author Dennis Eichhorn */ - public function __construct(\float $lat, \float $long, \string $name) + public function __construct(float $lat, float $long, string $name) { $this->long = $long; $this->lat = $lat; @@ -79,7 +79,7 @@ class City * @since 1.0.0 * @author Dennis Eichhorn */ - public function getLongitude() : \float + public function getLongitude() : float { return $this->long; } @@ -92,7 +92,7 @@ class City * @since 1.0.0 * @author Dennis Eichhorn */ - public function getLatitude() : \float + public function getLatitude() : float { return $this->lat; } @@ -105,7 +105,7 @@ class City * @since 1.0.0 * @author Dennis Eichhorn */ - public function getName() : \string + public function getName() : string { return $this->name; } @@ -120,7 +120,7 @@ class City * @since 1.0.0 * @author Dennis Eichhorn */ - public function equals(City $city) : \bool + public function equals(City $city) : bool { return $this->name === $city->getName() && $this->lat === $city->getLatitude() && $this->long === $city->getLatitude(); } @@ -135,7 +135,7 @@ class City * @since 1.0.0 * @author Dennis Eichhorn */ - public function getDistanceTo(City $city) : \float + public function getDistanceTo(City $city) : float { return Sphere::distance2PointsOnSphere($this->lat, $this->long, $city->getLatitude(), $city->getLongitude()); } diff --git a/Math/Optimization/TSP/CityPool.php b/Math/Optimization/TSP/CityPool.php index 18a72cd88..b77fb6bda 100644 --- a/Math/Optimization/TSP/CityPool.php +++ b/Math/Optimization/TSP/CityPool.php @@ -73,7 +73,7 @@ class CityPool implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function getCity(\int $index) : City + public function getCity(int $index) : City { return array_values($this->cities)[$index]; } @@ -96,12 +96,12 @@ class CityPool implements \Countable * * @param City $city City * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function hasCity(City $city) : \bool + public function hasCity(City $city) : bool { foreach ($this->cities as $c) { if ($c->equals($city)) { @@ -115,12 +115,12 @@ class CityPool implements \Countable /** * Count cities * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function count() : \int + public function count() : int { return count($this->cities); } diff --git a/Math/Optimization/TSP/Population.php b/Math/Optimization/TSP/Population.php index d1866b6a1..a7b1eeb1c 100644 --- a/Math/Optimization/TSP/Population.php +++ b/Math/Optimization/TSP/Population.php @@ -47,7 +47,7 @@ class Population implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function __construct(CityPool $pool, \int $size, \bool $initialize = false) + public function __construct(CityPool $pool, int $size, bool $initialize = false) { if ($initialize) { for ($i = 0; $i < $size; $i++) { @@ -65,7 +65,7 @@ class Population implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function insertTourAt(\int $index, Tour $tour) + public function insertTourAt(int $index, Tour $tour) { $this->tours = array_slice($this->tours, 0, $index) + [$tour] + array_slice($this->tours, $index); } @@ -79,7 +79,7 @@ class Population implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function setTour(\int $index, Tour $tour) + public function setTour(int $index, Tour $tour) { $this->tours[$index] = $tour; asort($this->tours); @@ -108,7 +108,7 @@ class Population implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function getTour(\int $index) + public function getTour(int $index) { return $this->tours[$index] ?? null; } @@ -165,7 +165,7 @@ class Population implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function count() : \int + public function count() : int { return count($this->tours); } diff --git a/Math/Optimization/TSP/Tour.php b/Math/Optimization/TSP/Tour.php index 10baf8a8e..4c8ed6afd 100644 --- a/Math/Optimization/TSP/Tour.php +++ b/Math/Optimization/TSP/Tour.php @@ -70,7 +70,7 @@ class Tour implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function __construct(CityPool $pool, \bool $initialize = false) + public function __construct(CityPool $pool, bool $initialize = false) { $this->cityPool = $pool; @@ -103,7 +103,7 @@ class Tour implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function getFitness() : \float + public function getFitness() : float { if ($this->fitness === 0.0 && ($distance = $this->getDistance()) !== 0.0) { $this->fitness = 1 / $distance; @@ -137,7 +137,7 @@ class Tour implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function setCity(\int $index, City $city) + public function setCity(int $index, City $city) { $this->cities[$index] = $city; asort($this->cities); @@ -154,7 +154,7 @@ class Tour implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function getDistance() : \float + public function getDistance() : float { if ($this->distance === 0.0) { $distance = 0.0; @@ -178,12 +178,12 @@ class Tour implements \Countable * * @param City $city City * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function hasCity(City $city) : \bool + public function hasCity(City $city) : bool { foreach ($this->cities as $c) { if ($c->equals($city)) { @@ -202,7 +202,7 @@ class Tour implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function count() : \int + public function count() : int { return count($this->cities); } diff --git a/Math/Shape/D2/Circle.php b/Math/Shape/D2/Circle.php index fac109eb8..259d37d70 100644 --- a/Math/Shape/D2/Circle.php +++ b/Math/Shape/D2/Circle.php @@ -39,7 +39,7 @@ class Circle * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getArea(\float $r) + public static function getArea(float $r) { return pi() * $r ** 2; } @@ -54,7 +54,7 @@ class Circle * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCircumference(\float $r) + public static function getCircumference(float $r) { return 2 * pi() * $r; } @@ -69,7 +69,7 @@ class Circle * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getRadiusByArea(\float $area) + public static function getRadiusByArea(float $area) { return sqrt($area / pi()); } @@ -84,7 +84,7 @@ class Circle * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getRadiusByCircumference(\float $C) + public static function getRadiusByCircumference(float $C) { return $C / (2 * pi()); } diff --git a/Math/Shape/D2/Ellipse.php b/Math/Shape/D2/Ellipse.php index 2b5f32c22..b8153ce28 100644 --- a/Math/Shape/D2/Ellipse.php +++ b/Math/Shape/D2/Ellipse.php @@ -45,7 +45,7 @@ class Ellipse * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getArea(\float $a, \float $b) + public static function getArea(float $a, float $b) { return pi() * $a * $b; } @@ -66,7 +66,7 @@ class Ellipse * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCircumference(\float $a, \float $b) + public static function getCircumference(float $a, float $b) { return pi() * ($a + $b) * (3 * ($a - $b) ** 2 / (($a + $b) ** 2 * (sqrt(-3 * ($a - $b) ** 2 / (($a + $b) ** 2) + 4) + 10)) + 1); } diff --git a/Math/Shape/D2/Polygon.php b/Math/Shape/D2/Polygon.php index 516d20c71..f9848c150 100644 --- a/Math/Shape/D2/Polygon.php +++ b/Math/Shape/D2/Polygon.php @@ -44,7 +44,7 @@ class Polygon implements Shape2DInterface /** * Polygon perimeter. * - * @var \float + * @var float * @since 1.0.0 */ private $perimeter = null; @@ -52,7 +52,7 @@ class Polygon implements Shape2DInterface /** * Polygon surface. * - * @var \float + * @var float * @since 1.0.0 */ private $surface = null; @@ -60,7 +60,7 @@ class Polygon implements Shape2DInterface /** * Interior angle sum of the polygon. * - * @var \float + * @var float * @since 1.0.0 */ private $interiorAngleSum = null; @@ -68,7 +68,7 @@ class Polygon implements Shape2DInterface /** * Exterior angle sum of the polygon. * - * @var \float + * @var float * @since 1.0.0 */ private $exteriorAngleSum = null; @@ -76,7 +76,7 @@ class Polygon implements Shape2DInterface /** * Polygon barycenter. * - * @var \float[] + * @var float[] * @since 1.0.0 */ private $barycenter = null; @@ -84,7 +84,7 @@ class Polygon implements Shape2DInterface /** * Polygon edge length. * - * @var \float + * @var float * @since 1.0.0 */ private $edgeLength = []; @@ -92,7 +92,7 @@ class Polygon implements Shape2DInterface /** * Polygon inner length. * - * @var \float + * @var float * @since 1.0.0 */ private $innerLength = null; @@ -100,7 +100,7 @@ class Polygon implements Shape2DInterface /** * Polygon inner edge angular. * - * @var \float + * @var float * @since 1.0.0 */ private $innerEdgeAngular = null; @@ -133,9 +133,9 @@ class Polygon implements Shape2DInterface /** * Set polygon coordinate. * - * @param \int $i Index - * @param \int|\float $x X coordinate - * @param \int|\float $y Y coordinate + * @param int $i Index + * @param int|float $x X coordinate + * @param int|float $y Y coordinate * * @return void * diff --git a/Math/Shape/D2/Rectangle.php b/Math/Shape/D2/Rectangle.php index 3cbc1c1e3..755714e90 100644 --- a/Math/Shape/D2/Rectangle.php +++ b/Math/Shape/D2/Rectangle.php @@ -40,7 +40,7 @@ class Rectangle * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getArea(\float $a, \float $b) + public static function getArea(float $a, float $b) { return $a * $b; } @@ -56,7 +56,7 @@ class Rectangle * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPerimeter(\float $a, \float $b) + public static function getPerimeter(float $a, float $b) { return 2 * ($a + $b); } @@ -72,7 +72,7 @@ class Rectangle * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getDiagonal(\float $a, \float $b) + public static function getDiagonal(float $a, float $b) { return sqrt($a * $a + $b * $b); } diff --git a/Math/Shape/D2/Trapezoid.php b/Math/Shape/D2/Trapezoid.php index 56a864023..66d96a2c3 100644 --- a/Math/Shape/D2/Trapezoid.php +++ b/Math/Shape/D2/Trapezoid.php @@ -47,7 +47,7 @@ class Trapezoid * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getArea(\float $a, \float $b, \float $h) + public static function getArea(float $a, float $b, float $h) { return ($a + $b) / 2 * $h; } @@ -71,7 +71,7 @@ class Trapezoid * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPerimeter(\float $a, \float $b, \float $c, \float $d) + public static function getPerimeter(float $a, float $b, float $c, float $d) { return $a + $b + $c + $d; } @@ -94,7 +94,7 @@ class Trapezoid * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getHeight(\float $area, \float $a, \float $b) + public static function getHeight(float $area, float $a, float $b) { return 2 * $area / ($a + $b); } @@ -117,7 +117,7 @@ class Trapezoid * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getA(\float $area, \float $h, \float $b) + public static function getA(float $area, float $h, float $b) { return 2 * $area / $h - $b; } @@ -140,7 +140,7 @@ class Trapezoid * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getB(\float $area, \float $h, \float $a) + public static function getB(float $area, float $h, float $a) { return 2 * $area / $h - $a; } @@ -164,7 +164,7 @@ class Trapezoid * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getC(\float $perimeter, \float $a, \float $b, \float $d) + public static function getC(float $perimeter, float $a, float $b, float $d) { return $perimeter - $a - $b - $d; } @@ -188,7 +188,7 @@ class Trapezoid * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getD(\float $perimeter, \float $a, \float $b, \float $c) + public static function getD(float $perimeter, float $a, float $b, float $c) { return $perimeter - $a - $b - $c; } diff --git a/Math/Shape/D2/Triangle.php b/Math/Shape/D2/Triangle.php index 3a8ed435a..66ea404c1 100644 --- a/Math/Shape/D2/Triangle.php +++ b/Math/Shape/D2/Triangle.php @@ -46,7 +46,7 @@ class Triangle * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getArea(\float $b, \float $h) + public static function getArea(float $b, float $h) { return $h * $b / 2; } @@ -63,7 +63,7 @@ class Triangle * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPerimeter(\float $a, \float $b, \float $c) + public static function getPerimeter(float $a, float $b, float $c) { return $a + $b + $c; } @@ -79,7 +79,7 @@ class Triangle * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getHeight(\float $area, \float $b) + public static function getHeight(float $area, float $b) { return 2 * $area / $b; } diff --git a/Math/Shape/D3/Cone.php b/Math/Shape/D3/Cone.php index 5e3baa7b2..20e66952a 100644 --- a/Math/Shape/D3/Cone.php +++ b/Math/Shape/D3/Cone.php @@ -40,7 +40,7 @@ class Cone * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVolume(\float $r, \float $h) + public static function getVolume(float $r, float $h) { return pi() * $r ** 2 * $h / 3; } @@ -56,7 +56,7 @@ class Cone * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSurface(\float $r, \float $h) + public static function getSurface(float $r, float $h) { return pi() * $r * ($r + sqrt($h ** 2 + $r ** 2)); } @@ -72,7 +72,7 @@ class Cone * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSlantHeight(\float $r, \float $h) + public static function getSlantHeight(float $r, float $h) { return sqrt($h ** 2 + $r ** 2); } @@ -88,7 +88,7 @@ class Cone * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getHeight(\float $V, \float $r) + public static function getHeight(float $V, float $r) { return 4 * $V / (pi() * $r ** 2); } diff --git a/Math/Shape/D3/Cuboid.php b/Math/Shape/D3/Cuboid.php index f54216b6c..62330bfea 100644 --- a/Math/Shape/D3/Cuboid.php +++ b/Math/Shape/D3/Cuboid.php @@ -41,7 +41,7 @@ class Cuboid * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVolume(\float $a, \float $b, \float $h) + public static function getVolume(float $a, float $b, float $h) { return $a * $b * $h; } @@ -58,7 +58,7 @@ class Cuboid * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSurface(\float $a, \float $b, \float $h) + public static function getSurface(float $a, float $b, float $h) { return 2 * ($a * $b + $a * $h + $b * $h); } diff --git a/Math/Shape/D3/Cylinder.php b/Math/Shape/D3/Cylinder.php index 8ece0463d..eccf0571c 100644 --- a/Math/Shape/D3/Cylinder.php +++ b/Math/Shape/D3/Cylinder.php @@ -40,7 +40,7 @@ class Cylinder * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVolume(\float $r, \float $h) + public static function getVolume(float $r, float $h) { return pi() * $r ** 2 * $h; } @@ -56,7 +56,7 @@ class Cylinder * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSurface(\float $r, \float $h) + public static function getSurface(float $r, float $h) { return 2 * pi() * ($r * $h + $r ** 2); } @@ -72,7 +72,7 @@ class Cylinder * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getLateralSurface(\float $r, \float $h) + public static function getLateralSurface(float $r, float $h) { return 2 * pi() * $r * $h; } diff --git a/Math/Shape/D3/RectangularPyramid.php b/Math/Shape/D3/RectangularPyramid.php index 4d0d19be1..695d0ccb6 100644 --- a/Math/Shape/D3/RectangularPyramid.php +++ b/Math/Shape/D3/RectangularPyramid.php @@ -41,7 +41,7 @@ class RectangularPyramid * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVolume(\float $a, \float $b, \float $h) + public static function getVolume(float $a, float $b, float $h) { return $a * $b * $h / 3; } @@ -58,7 +58,7 @@ class RectangularPyramid * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSurface(\float $a, \float $b, \float $h) + public static function getSurface(float $a, float $b, float $h) { return $a * $b + $a * sqrt(($b / 2) ** 2 + $h ** 2) + $b * sqrt(($a / 2) ** 2 + $h ** 2); } @@ -75,7 +75,7 @@ class RectangularPyramid * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getLateralSurface(\float $a, \float $b, \float $h) + public static function getLateralSurface(float $a, float $b, float $h) { return $a * sqrt(($b / 2) ** 2 + $h ** 2) + $b * sqrt(($a / 2) ** 2 + $h ** 2); } diff --git a/Math/Shape/D3/Sphere.php b/Math/Shape/D3/Sphere.php index 020335e52..cece3c0e0 100644 --- a/Math/Shape/D3/Sphere.php +++ b/Math/Shape/D3/Sphere.php @@ -43,7 +43,7 @@ class Sphere * @since 1.0.0 * @author Dennis Eichhorn */ - public static function distance2PointsOnSphere(\float $latStart, \float $longStart, \float $latEnd, \float $longEnd, \float $radius = 6371000.0) : \float + public static function distance2PointsOnSphere(float $latStart, float $longStart, float $latEnd, float $longEnd, float $radius = 6371000.0) : float { $latFrom = deg2rad($latStart); $lonFrom = deg2rad($longStart); @@ -73,7 +73,7 @@ class Sphere * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVolume(\float $r) + public static function getVolume(float $r) { return 4 / 3 * pi() * $r ** 3; } @@ -88,7 +88,7 @@ class Sphere * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getRadiusByVolume(\float $V) + public static function getRadiusByVolume(float $V) { return pow($V * 3 / (4 * pi()), 1 / 3); } @@ -103,7 +103,7 @@ class Sphere * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSurface(\float $r) + public static function getSurface(float $r) { return 4 * pi() * $r ** 2; } @@ -118,7 +118,7 @@ class Sphere * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getRadiusBySurface(\float $S) + public static function getRadiusBySurface(float $S) { return sqrt($S / (4 * pi())); } diff --git a/Math/Shape/D3/Tetrahedron.php b/Math/Shape/D3/Tetrahedron.php index 2db2df22d..b69800d2a 100644 --- a/Math/Shape/D3/Tetrahedron.php +++ b/Math/Shape/D3/Tetrahedron.php @@ -39,7 +39,7 @@ class Tetrahedron * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVolume(\float $a) + public static function getVolume(float $a) { return $a ** 3 / (6 * sqrt(2)); } @@ -54,7 +54,7 @@ class Tetrahedron * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSurface(\float $a) + public static function getSurface(float $a) { return sqrt(3) * $a ** 2; } @@ -69,7 +69,7 @@ class Tetrahedron * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFaceArea(\float $a) + public static function getFaceArea(float $a) { return sqrt(3) / 4 * $a ** 2; } diff --git a/Math/Statistic/Average.php b/Math/Statistic/Average.php index c820f21f9..80c905796 100644 --- a/Math/Statistic/Average.php +++ b/Math/Statistic/Average.php @@ -45,7 +45,7 @@ class Average * @since 1.0.0 * @author Dennis Eichhorn */ - public static function weightedAverage(array $values, array $weight) : \float + public static function weightedAverage(array $values, array $weight) : float { if (($count = count($values)) !== count($weight)) { throw new \Exception('Dimension'); @@ -93,7 +93,7 @@ class Average * @since 1.0.0 * @author Dennis Eichhorn */ - public static function median(array $values) : \float + public static function median(array $values) : float { sort($values); $count = count($values); @@ -116,7 +116,7 @@ class Average * Example: ([1, 2, 2, 3, 4, 4, 2]) * * @param array $values Values - * @param \int $offset Offset for outlier + * @param int $offset Offset for outlier * * @return float * @@ -125,7 +125,7 @@ class Average * @since 1.0.0 * @author Dennis Eichhorn */ - public static function arithmeticMean(array $values, \int $offset = 0) + public static function arithmeticMean(array $values, int $offset = 0) { sort($values); @@ -148,7 +148,7 @@ class Average * Example: ([1, 2, 2, 3, 4, 4, 2]) * * @param array $values Values - * @param \int $offset Offset for outlier + * @param int $offset Offset for outlier * * @return float * @@ -157,7 +157,7 @@ class Average * @since 1.0.0 * @author Dennis Eichhorn */ - public static function geometricMean(array $values, \int $offset = 0) + public static function geometricMean(array $values, int $offset = 0) { sort($values); @@ -180,7 +180,7 @@ class Average * Example: ([1, 2, 2, 3, 4, 4, 2]) * * @param array $values Values - * @param \int $offset Offset for outlier + * @param int $offset Offset for outlier * * @return float * @@ -189,7 +189,7 @@ class Average * @since 1.0.0 * @author Dennis Eichhorn */ - public static function harmonicMean(array $values, \int $offset = 0) + public static function harmonicMean(array $values, int $offset = 0) { sort($values); @@ -217,14 +217,14 @@ class Average * Example: ([1, 2, 2, 3, 4, 4, 2]) * * @param array $angles Angles - * @param \int $offset Offset for outlier + * @param int $offset Offset for outlier * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function angleMean($angles, \int $offset = 0) + public static function angleMean($angles, int $offset = 0) { sort($angles); @@ -260,7 +260,7 @@ class Average * @since 1.0.0 * @author Dennis Eichhorn */ - public static function timeToAngle(\string $time) : \float + public static function timeToAngle(string $time) : float { $parts = explode(':', $time); @@ -288,7 +288,7 @@ class Average * @since 1.0.0 * @author Dennis Eichhorn */ - public static function angleToTime(\float $angle) : \string + public static function angleToTime(float $angle) : string { $sec = 86400.0 * $angle / 360.0; $time = sprintf('%02d:%02d:%02d', floor($sec / 3600), floor(($sec % 3600) / 60), $sec % 60); @@ -302,14 +302,14 @@ class Average * Example: ([1, 2, 2, 3, 4, 4, 2]) * * @param array $angles Angles - * @param \int $offset Offset for outlier + * @param int $offset Offset for outlier * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function angleMean2(array $angles, \int $offset = 0) + public static function angleMean2(array $angles, int $offset = 0) { sort($angles); diff --git a/Math/Statistic/MeasureOfDispersion.php b/Math/Statistic/MeasureOfDispersion.php index d77615da4..585f9aae7 100644 --- a/Math/Statistic/MeasureOfDispersion.php +++ b/Math/Statistic/MeasureOfDispersion.php @@ -42,7 +42,7 @@ class MeasureOfDispersion * @since 1.0.0 * @author Dennis Eichhorn */ - public static function range(array $values) : \float + public static function range(array $values) : float { sort($values); $end = end($values); @@ -65,7 +65,7 @@ class MeasureOfDispersion * @since 1.0.0 * @author Dennis Eichhorn */ - public static function empiricalVariance(array $values) : \float + public static function empiricalVariance(array $values) : float { $count = count($values); @@ -97,7 +97,7 @@ class MeasureOfDispersion * @since 1.0.0 * @author Dennis Eichhorn */ - public static function sampleVariance(array $values) : \float + public static function sampleVariance(array $values) : float { $count = count($values); @@ -120,7 +120,7 @@ class MeasureOfDispersion * @since 1.0.0 * @author Dennis Eichhorn */ - public static function standardDeviation(array $values) : \float + public static function standardDeviation(array $values) : float { return sqrt(self::sampleVariance($values)); } @@ -139,7 +139,7 @@ class MeasureOfDispersion * @since 1.0.0 * @author Dennis Eichhorn */ - public static function empiricalVariationcoefficient(array $values) : \float + public static function empiricalVariationcoefficient(array $values) : float { $mean = Average::arithmeticMean($values); @@ -165,7 +165,7 @@ class MeasureOfDispersion * @since 1.0.0 * @author Dennis Eichhorn */ - public static function empiricalCovariance(array $x, array $y) : \float + public static function empiricalCovariance(array $x, array $y) : float { $count = count($x); @@ -202,7 +202,7 @@ class MeasureOfDispersion * @since 1.0.0 * @author Dennis Eichhorn */ - public static function bravaisPersonCorrelationcoefficient(array $x, array $y) : \float + public static function bravaisPersonCorrelationcoefficient(array $x, array $y) : float { return self::empiricalCovariance($x, $y) / sqrt(self::empiricalCovariance($x, $x) * self::empiricalCovariance($y, $y)); } diff --git a/Math/Stochastic/Distribution/BernoulliDistribution.php b/Math/Stochastic/Distribution/BernoulliDistribution.php index 8739ffe6e..9542a83ed 100644 --- a/Math/Stochastic/Distribution/BernoulliDistribution.php +++ b/Math/Stochastic/Distribution/BernoulliDistribution.php @@ -42,7 +42,7 @@ class BernulliDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPmf(\float $p, \int $k) : \float + public static function getPmf(float $p, int $k) : float { if ($k === 0) { return 1 - $p; @@ -56,14 +56,14 @@ class BernulliDistribution /** * Get mode. * - * @param \float $p + * @param float $p * * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMode(\float $p) : \int + public static function getMode(float $p) : int { if ($p === 0.5) { return 0; @@ -77,14 +77,14 @@ class BernulliDistribution /** * Get expected value. * - * @param \float $p + * @param float $p * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMean(\float $p) : \float + public static function getMean(float $p) : float { return $p; } @@ -92,14 +92,14 @@ class BernulliDistribution /** * Get expected value. * - * @param \float $p + * @param float $p * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMedian(\float $p) : \float + public static function getMedian(float $p) : float { if ($p === 0.5) { return 0.5; @@ -113,14 +113,14 @@ class BernulliDistribution /** * Get variance. * - * @param \float $p + * @param float $p * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVariance(\float $p) : \float + public static function getVariance(float $p) : float { return $p * (1 - $p); } @@ -136,7 +136,7 @@ class BernulliDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMgf(\float $p, \float $t) : \float + public static function getMgf(float $p, float $t) : float { return (1 - $p) + $p * exp($t); } @@ -151,7 +151,7 @@ class BernulliDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSkewness(\float $p) : \float + public static function getSkewness(float $p) : float { return (1 - 2 * $p) / sqrt($p * (1 - $p)); } @@ -166,7 +166,7 @@ class BernulliDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFisherInformation(\float $p) : \float + public static function getFisherInformation(float $p) : float { return 1 / ($p * (1 - $p)); } @@ -181,7 +181,7 @@ class BernulliDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getExKurtosis(\float $p) : \float + public static function getExKurtosis(float $p) : float { return (1 - 6 * $p * (1 - $p)) / ($p * (1 - $p)); } diff --git a/Math/Stochastic/Distribution/BinomialDistribution.php b/Math/Stochastic/Distribution/BinomialDistribution.php index 7547cc149..bd82c4892 100644 --- a/Math/Stochastic/Distribution/BinomialDistribution.php +++ b/Math/Stochastic/Distribution/BinomialDistribution.php @@ -44,7 +44,7 @@ class BinomialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMode(\int $n, \float $p) : \float + public static function getMode(int $n, float $p) : float { if (($temp = ($n + 1) * $p) === 0 || !is_int($temp)) { return floor($temp); @@ -71,7 +71,7 @@ class BinomialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPmf(\int $n, \int $k, \float $p) : \float + public static function getPmf(int $n, int $k, float $p) : float { return Functions::binomialCoefficient($n, $k) * pow($p, $k) * pow(1 - $p, $n - $k); } @@ -88,7 +88,7 @@ class BinomialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMgf(\int $n, \float $t, \float $p) : \float + public static function getMgf(int $n, float $t, float $p) : float { return pow(1 - $p + $p * exp($t), $n); } @@ -104,7 +104,7 @@ class BinomialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSkewness(\int $n, \float $p) : \float + public static function getSkewness(int $n, float $p) : float { return (1 - 2 * $p) / sqrt($n * $p * (1 - $p)); } @@ -120,7 +120,7 @@ class BinomialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFisherInformation(\int $n, \float $p) : \float + public static function getFisherInformation(int $n, float $p) : float { return $n / ($p * (1 - $p)); } @@ -136,7 +136,7 @@ class BinomialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getExKurtosis(\int $n, \float $p) : \float + public static function getExKurtosis(int $n, float $p) : float { return (1 - 6 * $p * (1 - $p)) / ($n * $p * (1 - $p)); } @@ -153,7 +153,7 @@ class BinomialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCdf(\int $n, \int $x, \float $p) : \float + public static function getCdf(int $n, int $x, float $p) : float { $sum = 0.0; @@ -175,7 +175,7 @@ class BinomialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMedian(\int $n, \float $p) : \float + public static function getMedian(int $n, float $p) : float { return floor($n * $p); } @@ -191,7 +191,7 @@ class BinomialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMean(\int $n, \float $p) : \float + public static function getMean(int $n, float $p) : float { return $n * $p; } @@ -207,7 +207,7 @@ class BinomialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVariance(\int $n, \float $p) : \float + public static function getVariance(int $n, float $p) : float { return $n * $p * (1 - $p); } diff --git a/Math/Stochastic/Distribution/CauchyDistribution.php b/Math/Stochastic/Distribution/CauchyDistribution.php index 01efe7e27..5f313bf38 100644 --- a/Math/Stochastic/Distribution/CauchyDistribution.php +++ b/Math/Stochastic/Distribution/CauchyDistribution.php @@ -41,7 +41,7 @@ class CauchyDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPdf(\float $x, \float $x0, \float $gamma) : \float + public static function getPdf(float $x, float $x0, float $gamma) : float { return 1 / (pi() * $gamma * (1 + (($x - $x0) / $gamma) ** 2)); } @@ -58,7 +58,7 @@ class CauchyDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCdf(\float $x, \float $x0, \float $gamma) : \float + public static function getCdf(float $x, float $x0, float $gamma) : float { return 1 / pi() * atan(($x - $x0) / $gamma) + 0.5; } @@ -73,7 +73,7 @@ class CauchyDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMode($x0) : \float + public static function getMode($x0) : float { return $x0; } @@ -81,14 +81,14 @@ class CauchyDistribution /** * Get expected value. * - * @param \float $x0 + * @param float $x0 * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMedian(\float $x0) : \float + public static function getMedian(float $x0) : float { return $x0; } diff --git a/Math/Stochastic/Distribution/ChiSquaredDistribution.php b/Math/Stochastic/Distribution/ChiSquaredDistribution.php index e140ae6ca..e0522942e 100644 --- a/Math/Stochastic/Distribution/ChiSquaredDistribution.php +++ b/Math/Stochastic/Distribution/ChiSquaredDistribution.php @@ -87,7 +87,7 @@ class ChiSquaredDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getDegreesOfFreedom(array $values) : \int + public static function getDegreesOfFreedom(array $values) : int { if (is_array($first = reset($values))) { return (count($values) - 1) * (count($first) - 1); @@ -111,7 +111,7 @@ class ChiSquaredDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function testHypothesis(array $dataset, array $expected, \float $significance = 0.05, \int $df = 0) : array + public static function testHypothesis(array $dataset, array $expected, float $significance = 0.05, int $df = 0) : array { if (($count = count($dataset)) !== count($expected)) { throw new \Exception('Dimension'); @@ -158,7 +158,7 @@ class ChiSquaredDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPdf(\float $x, \int $df) : \float + public static function getPdf(float $x, int $df) : float { if ($x < 0) { throw new \Exception('Out of bounds'); @@ -170,14 +170,14 @@ class ChiSquaredDistribution /** * Get mode. * - * @param \int $df Degrees of freedom + * @param int $df Degrees of freedom * * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMode(\int $df) : \int + public static function getMode(int $df) : int { return max([$df - 2, 0]); } @@ -185,14 +185,14 @@ class ChiSquaredDistribution /** * Get expected value. * - * @param \int $df Degrees of freedom + * @param int $df Degrees of freedom * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMean(\int $df) : \float + public static function getMean(int $df) : float { return $df; } @@ -200,14 +200,14 @@ class ChiSquaredDistribution /** * Get expected value. * - * @param \int $df Degrees of freedom + * @param int $df Degrees of freedom * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMedian(\int $df) : \float + public static function getMedian(int $df) : float { return $df * (1 - 2 / (9 * $df)) ** 3; } @@ -215,14 +215,14 @@ class ChiSquaredDistribution /** * Get variance. * - * @param \int $df Degrees of freedom + * @param int $df Degrees of freedom * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVariance(\int $df) : \float + public static function getVariance(int $df) : float { return 2 * $df; } @@ -240,7 +240,7 @@ class ChiSquaredDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMgf(\int $df, \float $t) : \float + public static function getMgf(int $df, float $t) : float { if ($t > 0.5) { throw new \Exception('Out of bounds'); @@ -259,7 +259,7 @@ class ChiSquaredDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSkewness(\int $df) : \float + public static function getSkewness(int $df) : float { return sqrt(8 / $df); } @@ -274,7 +274,7 @@ class ChiSquaredDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getExKurtosis(\int $df) : \float + public static function getExKurtosis(int $df) : float { return 12 / $df; } diff --git a/Math/Stochastic/Distribution/ExponentialDistribution.php b/Math/Stochastic/Distribution/ExponentialDistribution.php index a70fd3f89..630c10452 100644 --- a/Math/Stochastic/Distribution/ExponentialDistribution.php +++ b/Math/Stochastic/Distribution/ExponentialDistribution.php @@ -40,7 +40,7 @@ class ExponentialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPdf(\float $x, \float $lambda) : \float + public static function getPdf(float $x, float $lambda) : float { return $x >= 0 ? $lambda * exp(-$lambda * $x) : 0; } @@ -56,7 +56,7 @@ class ExponentialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCdf(\float $x, \float $lambda) : \float + public static function getCdf(float $x, float $lambda) : float { return $x >= 0 ? 1 - exp($lambda * $x) : 0; } @@ -69,7 +69,7 @@ class ExponentialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMode() : \float + public static function getMode() : float { return 0; } @@ -77,14 +77,14 @@ class ExponentialDistribution /** * Get expected value. * - * @param \float $lambda + * @param float $lambda * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMean(\float $lambda) : \float + public static function getMean(float $lambda) : float { return 1 / $lambda; } @@ -92,14 +92,14 @@ class ExponentialDistribution /** * Get expected value. * - * @param \float $lambda + * @param float $lambda * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMedian(\float $lambda) : \float + public static function getMedian(float $lambda) : float { return 1 / $lambda; } @@ -107,14 +107,14 @@ class ExponentialDistribution /** * Get variance. * - * @param \float $lambda + * @param float $lambda * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVariance(\float $lambda) : \float + public static function getVariance(float $lambda) : float { return pow($lambda, -2); } @@ -132,7 +132,7 @@ class ExponentialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMgf(\float $t, \float $lambda) : \float + public static function getMgf(float $t, float $lambda) : float { if ($t >= $lambda) { throw new \Exception('Out of bounds'); @@ -149,7 +149,7 @@ class ExponentialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSkewness() : \float + public static function getSkewness() : float { return 2; } @@ -162,7 +162,7 @@ class ExponentialDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getExKurtosis() : \float + public static function getExKurtosis() : float { return 6; } diff --git a/Math/Stochastic/Distribution/GeometricDistribution.php b/Math/Stochastic/Distribution/GeometricDistribution.php index 6a8da8186..8ce1fd3b6 100644 --- a/Math/Stochastic/Distribution/GeometricDistribution.php +++ b/Math/Stochastic/Distribution/GeometricDistribution.php @@ -42,7 +42,7 @@ class GeometricDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPmf(\float $p, \int $k) : \float + public static function getPmf(float $p, int $k) : float { return pow(1 - $p, $k - 1) * $p; } @@ -60,7 +60,7 @@ class GeometricDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCdf(\float $p, \int $k) : \float + public static function getCdf(float $p, int $k) : float { return 1 - pow(1 - $p, $k); } @@ -73,7 +73,7 @@ class GeometricDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMode() : \int + public static function getMode() : int { return 1; } @@ -81,14 +81,14 @@ class GeometricDistribution /** * Get expected value. * - * @param \float $p + * @param float $p * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMean(\float $p) : \float + public static function getMean(float $p) : float { return 1 / $p; } @@ -96,14 +96,14 @@ class GeometricDistribution /** * Get expected value. * - * @param \float $p + * @param float $p * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMedian(\float $p) : \float + public static function getMedian(float $p) : float { return ceil(-1 / (log(1 - $p, 2))); } @@ -111,14 +111,14 @@ class GeometricDistribution /** * Get variance. * - * @param \float $p + * @param float $p * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVariance(\float $p) : \float + public static function getVariance(float $p) : float { return (1 - $p) / $p ** 2; } @@ -134,7 +134,7 @@ class GeometricDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMgf(\float $p, \float $t) : \float + public static function getMgf(float $p, float $t) : float { return $p * exp($t) / (1 - (1 - $p) * exp($t)); } @@ -149,7 +149,7 @@ class GeometricDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSkewness(\float $lambda) : \float + public static function getSkewness(float $lambda) : float { return (2 - $p) / sqrt(1 - $p); } @@ -164,7 +164,7 @@ class GeometricDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getExKurtosis(\float $lambda) : \float + public static function getExKurtosis(float $lambda) : float { return 6 + $p ** 2 / (1 - $p); } diff --git a/Math/Stochastic/Distribution/LaplaceDistribution.php b/Math/Stochastic/Distribution/LaplaceDistribution.php index e77998ba9..cab2beac8 100644 --- a/Math/Stochastic/Distribution/LaplaceDistribution.php +++ b/Math/Stochastic/Distribution/LaplaceDistribution.php @@ -41,7 +41,7 @@ class LaplaceDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPdf(\float $x, \float $mu, \float $b) : \float + public static function getPdf(float $x, float $mu, float $b) : float { return 1 / (2 * $b) * exp(-abs($x - $mu) / $b); } @@ -58,7 +58,7 @@ class LaplaceDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCdf(\float $x, \float $mu, \float $b) : \float + public static function getCdf(float $x, float $mu, float $b) : float { return $x < $mu ? exp(($x - $mu) / $b) / 2 : 1 - exp(-($x - $mu) / $b) / 2; } @@ -66,14 +66,14 @@ class LaplaceDistribution /** * Get mode. * - * @param \float $mu + * @param float $mu * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMode(\float $mu) : \float + public static function getMode(float $mu) : float { return $mu; } @@ -81,14 +81,14 @@ class LaplaceDistribution /** * Get expected value. * - * @param \float $mu + * @param float $mu * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMean(\float $mu) : \float + public static function getMean(float $mu) : float { return $mu; } @@ -96,14 +96,14 @@ class LaplaceDistribution /** * Get expected value. * - * @param \float $mu + * @param float $mu * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMedian(\float $mu) : \float + public static function getMedian(float $mu) : float { return $mu; } @@ -111,14 +111,14 @@ class LaplaceDistribution /** * Get variance. * - * @param \float $b + * @param float $b * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVariance(\float $b) : \float + public static function getVariance(float $b) : float { return 2 * $b ** 2; } @@ -137,7 +137,7 @@ class LaplaceDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMgf(\float $t, \float $mu, \float $b) : \float + public static function getMgf(float $t, float $mu, float $b) : float { if ($t >= 1 / $b) { throw new \Exception('Out of bounds'); @@ -154,7 +154,7 @@ class LaplaceDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSkewness() : \float + public static function getSkewness() : float { return 0; } @@ -167,7 +167,7 @@ class LaplaceDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getExKurtosis() : \float + public static function getExKurtosis() : float { return 3; } diff --git a/Math/Stochastic/Distribution/NormalDistribution.php b/Math/Stochastic/Distribution/NormalDistribution.php index c0e2988a0..4b0757707 100644 --- a/Math/Stochastic/Distribution/NormalDistribution.php +++ b/Math/Stochastic/Distribution/NormalDistribution.php @@ -42,7 +42,7 @@ class NormalDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPdf(\float $x, \float $mu, \float $sig) : \float + public static function getPdf(float $x, float $mu, float $sig) : float { return 1 / ($sig * sqrt(2 * pi())) * exp(-($x - $mu) ** 2 / (2 * $sig ** 2)); } @@ -50,14 +50,14 @@ class NormalDistribution /** * Get mode. * - * @param \float $mu + * @param float $mu * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMode(\float $mu) : \float + public static function getMode(float $mu) : float { return $mu; } @@ -65,14 +65,14 @@ class NormalDistribution /** * Get expected value. * - * @param \float $mu + * @param float $mu * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMean(\float $mu) : \float + public static function getMean(float $mu) : float { return $mu; } @@ -80,14 +80,14 @@ class NormalDistribution /** * Get expected value. * - * @param \float $mu + * @param float $mu * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMedian(\float $mu) : \float + public static function getMedian(float $mu) : float { return $mu; } @@ -95,14 +95,14 @@ class NormalDistribution /** * Get variance. * - * @param \float $sig + * @param float $sig * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVariance(\float $sig) : \float + public static function getVariance(float $sig) : float { return $sig ** 2; } @@ -119,7 +119,7 @@ class NormalDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMgf(\float $t, \float $mu, \float $sig) : \float + public static function getMgf(float $t, float $mu, float $sig) : float { return exp($mu * $t + ($sig ** 2 * $t ** 2) / 2); } @@ -132,7 +132,7 @@ class NormalDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSkewness() : \float + public static function getSkewness() : float { return 0; } @@ -147,7 +147,7 @@ class NormalDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFisherInformation(\float $sig) : \float + public static function getFisherInformation(float $sig) : float { return [[1 / $sig ** 2, 0], [0, 1 / (2 * $sig ** 4)]]; } @@ -160,7 +160,7 @@ class NormalDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getExKurtosis() : \float + public static function getExKurtosis() : float { return 0; } diff --git a/Math/Stochastic/Distribution/PoissonDistribution.php b/Math/Stochastic/Distribution/PoissonDistribution.php index 90866df31..dc29d759a 100644 --- a/Math/Stochastic/Distribution/PoissonDistribution.php +++ b/Math/Stochastic/Distribution/PoissonDistribution.php @@ -43,7 +43,7 @@ class PoissonDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPmf(\int $k, \float $lambda) : \float + public static function getPmf(int $k, float $lambda) : float { return exp($k * log($lambda) - $lambda - log(Functions::getGammaInteger($k + 1))); } @@ -59,7 +59,7 @@ class PoissonDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCdf(\int $k, \float $lambda) : \float + public static function getCdf(int $k, float $lambda) : float { $sum = 0.0; @@ -73,14 +73,14 @@ class PoissonDistribution /** * Get mode. * - * @param \float $lambda Lambda + * @param float $lambda Lambda * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMode(\float $lambda) : \float + public static function getMode(float $lambda) : float { return floor($lambda); } @@ -88,14 +88,14 @@ class PoissonDistribution /** * Get expected value. * - * @param \float $lambda Lambda + * @param float $lambda Lambda * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMean(\float $lambda) : \float + public static function getMean(float $lambda) : float { return $lambda; } @@ -103,14 +103,14 @@ class PoissonDistribution /** * Get expected value. * - * @param \float $lambda Lambda + * @param float $lambda Lambda * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMedian(\float $lambda) : \float + public static function getMedian(float $lambda) : float { return floor($lambda + 1 / 3 - 0.02 / $lambda); } @@ -118,14 +118,14 @@ class PoissonDistribution /** * Get variance. * - * @param \float $lambda Lambda + * @param float $lambda Lambda * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVariance(\float $lambda) : \float + public static function getVariance(float $lambda) : float { return $lambda; } @@ -141,7 +141,7 @@ class PoissonDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMgf(\float $lambda, \float $t) : \float + public static function getMgf(float $lambda, float $t) : float { return exp($lambda * (exp($t) - 1)); } @@ -156,7 +156,7 @@ class PoissonDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSkewness(\float $lambda) : \float + public static function getSkewness(float $lambda) : float { return pow($lambda, -1 / 2); } @@ -171,7 +171,7 @@ class PoissonDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFisherInformation(\float $lambda) : \float + public static function getFisherInformation(float $lambda) : float { return pow($lambda, -1); } @@ -186,7 +186,7 @@ class PoissonDistribution * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getExKurtosis(\float $lambda) : \float + public static function getExKurtosis(float $lambda) : float { return pow($lambda, -1); } diff --git a/Math/Stochastic/Distribution/UniformDistributionContinuous.php b/Math/Stochastic/Distribution/UniformDistributionContinuous.php index 280a8e1b8..07a61623f 100644 --- a/Math/Stochastic/Distribution/UniformDistributionContinuous.php +++ b/Math/Stochastic/Distribution/UniformDistributionContinuous.php @@ -43,7 +43,7 @@ class UniformDistributionContinuous * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMode(\float $a, \float $b) : \float + public static function getMode(float $a, float $b) : float { return ($a + $b) / 2; } @@ -62,7 +62,7 @@ class UniformDistributionContinuous * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPdf(\float $x, \float $a, \float $b) : \float + public static function getPdf(float $x, float $a, float $b) : float { return $x > $a && $x < $b ? 1 / ($b - $a) : 0; } @@ -81,7 +81,7 @@ class UniformDistributionContinuous * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCdf(\float $x, \float $a, \float $b) : \float + public static function getCdf(float $x, float $a, float $b) : float { if ($x < $a) { return 0; @@ -104,7 +104,7 @@ class UniformDistributionContinuous * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMgf(\int $t, \float $a, \float $b) : \float + public static function getMgf(int $t, float $a, float $b) : float { return $t === 0 ? 1 : (exp($t * $b) - exp($t * $a)) / ($t * ($b - $a)); } @@ -117,7 +117,7 @@ class UniformDistributionContinuous * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSkewness() : \float + public static function getSkewness() : float { return 0.0; } @@ -130,7 +130,7 @@ class UniformDistributionContinuous * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getExKurtosis() : \float + public static function getExKurtosis() : float { return -6 / 5; } @@ -146,7 +146,7 @@ class UniformDistributionContinuous * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMedian(\float $a, \float $b) : \float + public static function getMedian(float $a, float $b) : float { return ($a + $b) / 2; } @@ -162,7 +162,7 @@ class UniformDistributionContinuous * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMean(\float $a, \float $b) : \float + public static function getMean(float $a, float $b) : float { return ($a + $b) / 2; } @@ -178,7 +178,7 @@ class UniformDistributionContinuous * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVariance(\float $a, \float $b) : \float + public static function getVariance(float $a, float $b) : float { return 1 / 12 * ($b - $a) ** 2; } diff --git a/Math/Stochastic/Distribution/UniformDistributionDiscrete.php b/Math/Stochastic/Distribution/UniformDistributionDiscrete.php index 3b6fb1ae2..081be4a17 100644 --- a/Math/Stochastic/Distribution/UniformDistributionDiscrete.php +++ b/Math/Stochastic/Distribution/UniformDistributionDiscrete.php @@ -33,7 +33,7 @@ class UniformDistributionDiscrete /** * Get probability mass function. * - * @param \float $a + * @param float $a * @param float $b * * @return float @@ -41,7 +41,7 @@ class UniformDistributionDiscrete * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getPmf(\float $a, \float $b) : \float + public static function getPmf(float $a, float $b) : float { return 1 / ($b - $a + 1); } @@ -60,7 +60,7 @@ class UniformDistributionDiscrete * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCdf(\float $k, \float $a, \float $b) : \float + public static function getCdf(float $k, float $a, float $b) : float { if ($k > $b || $k < $a) { throw new \Exception('Out of bounds'); @@ -81,7 +81,7 @@ class UniformDistributionDiscrete * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMgf(\int $t, \float $a, \float $b) : \float + public static function getMgf(int $t, float $a, float $b) : float { return (exp($a * $t) - exp(($b + 1) * $t)) / (($b - $a + 1) * (1 - exp($t))); } @@ -94,7 +94,7 @@ class UniformDistributionDiscrete * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getSkewness() : \float + public static function getSkewness() : float { return 0.0; } @@ -110,7 +110,7 @@ class UniformDistributionDiscrete * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getExKurtosis(\float $a, \float $b) : \float + public static function getExKurtosis(float $a, float $b) : float { $n = ($b - $a + 1); @@ -128,7 +128,7 @@ class UniformDistributionDiscrete * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMedian(\float $a, \float $b) : \float + public static function getMedian(float $a, float $b) : float { return ($a + $b) / 2; } @@ -144,7 +144,7 @@ class UniformDistributionDiscrete * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getMean(\float $a, \float $b) : \float + public static function getMean(float $a, float $b) : float { return ($a + $b) / 2; } @@ -160,7 +160,7 @@ class UniformDistributionDiscrete * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getVariance(\float $a, \float $b) : \float + public static function getVariance(float $a, float $b) : float { return (($b - $a + 1) ** 2 - 1) / 12; } diff --git a/Message/Http/Request.php b/Message/Http/Request.php index 51e153428..e343dff90 100644 --- a/Message/Http/Request.php +++ b/Message/Http/Request.php @@ -72,7 +72,7 @@ class Request extends RequestAbstract /** * Request information. * - * @var \string[] + * @var string[] * @since 1.0.0 */ private $info = null; @@ -80,12 +80,12 @@ class Request extends RequestAbstract /** * Constructor. * - * @param \string $rootPath relative installation path + * @param string $rootPath relative installation path * * @since 1.0.0 * @author Dennis Eichhorn */ - public function __construct(\string $rootPath) + public function __construct(string $rootPath) { $this->uri = new Http($rootPath); $this->l11n = new Localization(); @@ -97,7 +97,7 @@ class Request extends RequestAbstract * * This is used in order to either initialize the current http request or a batch of GET requests * - * @param \string $uri URL + * @param string $uri URL * * @return void * @@ -106,7 +106,7 @@ class Request extends RequestAbstract * @since 1.0.0 * @author Dennis Eichhorn */ - public function init(\string $uri = null) + public function init(string $uri = null) { if ($uri === null) { $this->data = $_GET ?? []; @@ -165,7 +165,7 @@ class Request extends RequestAbstract * @since 1.0.0 * @author Dennis Eichhorn */ - public function isMobile() : \bool + public function isMobile() : bool { // TODO: maybe replace this with smart media queries... checked gets handled in reverse!!! $useragent = $_SERVER['HTTP_USER_AGENT']; @@ -197,12 +197,12 @@ class Request extends RequestAbstract * * @param array $request Request array * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - private function hashRequest(array $request) : \string + private function hashRequest(array $request) : string { return sha1(implode('', $request)); } @@ -284,7 +284,7 @@ class Request extends RequestAbstract /** * {@inheritdoc} */ - public function getOrigin() : \string + public function getOrigin() : string { return $_SERVER['REMOTE_ADDR']; } @@ -292,14 +292,14 @@ class Request extends RequestAbstract /** * Is request made via https. * - * @param \int $port Secure port + * @param int $port Secure port * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function isHttps(\int $port = 443) : \bool + public function isHttps(int $port = 443) : bool { if ($port < 1 || $port > 65535) { throw new \OutOfRangeException('Value "' . $port . '" is out of range.'); @@ -315,7 +315,7 @@ class Request extends RequestAbstract /** * Stringify request. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn @@ -331,12 +331,12 @@ class Request extends RequestAbstract /** * Get request type. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getMethod() : \string + public function getMethod() : string { if (!isset($this->type)) { $this->type = $_SERVER['REQUEST_METHOD']; @@ -348,7 +348,7 @@ class Request extends RequestAbstract /** * {@inheritdoc} */ - public function getProtocolVersion() : \string + public function getProtocolVersion() : string { return $_SERVER['SERVER_PROTOCOL']; } @@ -364,7 +364,7 @@ class Request extends RequestAbstract /** * {@inheritdoc} */ - public function hasHeader(\string $name) : \bool + public function hasHeader(string $name) : bool { return array_key_exists($name, getallheaders()); } @@ -372,7 +372,7 @@ class Request extends RequestAbstract /** * {@inheritdoc} */ - public function getHeader(\string $name) : \string + public function getHeader(string $name) : string { return getallheaders()[$name]; } @@ -380,7 +380,7 @@ class Request extends RequestAbstract /** * {@inheritdoc} */ - public function getBody() : \string + public function getBody() : string { return file_get_contents('php://input'); } @@ -388,7 +388,7 @@ class Request extends RequestAbstract /** * {@inheritdoc} */ - public function getRequestTarget() : \string + public function getRequestTarget() : string { return '/'; } @@ -406,7 +406,7 @@ class Request extends RequestAbstract return $this->files; } - public function setHeader($key, \string $header, \bool $overwrite = true) + public function setHeader($key, string $header, bool $overwrite = true) { // NOT Required for Http request } @@ -419,7 +419,7 @@ class Request extends RequestAbstract * @since 1.0.0 * @author Dennis Eichhorn */ - public function getRoutify() : \string + public function getRoutify() : string { return $this->uri->__toString(); } diff --git a/Message/Http/Response.php b/Message/Http/Response.php index edce72435..3317972ba 100644 --- a/Message/Http/Response.php +++ b/Message/Http/Response.php @@ -38,7 +38,7 @@ class Response extends ResponseAbstract implements RenderableInterface /** * Header. * - * @var \string[][] + * @var string[][] * @since 1.0.0 */ private $header = []; @@ -83,14 +83,14 @@ class Response extends ResponseAbstract implements RenderableInterface /** * Remove header by ID. * - * @param \int $key Header key + * @param int $key Header key * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function removeHeader(\int $key) : \bool + public function removeHeader(int $key) : bool { if (isset($this->header[$key])) { unset($this->header[$key]); @@ -104,14 +104,14 @@ class Response extends ResponseAbstract implements RenderableInterface /** * Generate header automatically based on code. * - * @param \int $code HTTP status code + * @param int $code HTTP status code * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function generateHeader(\int $code) + public function generateHeader(int $code) { if ($code === 403) { $this->setHeader('HTTP', 'HTTP/1.0 403 Forbidden'); @@ -129,14 +129,14 @@ class Response extends ResponseAbstract implements RenderableInterface /** * Set response. * - * @param \string $response Response to set + * @param string $response Response to set * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setResponse(\string $response) + public function setResponse(string $response) { $this->response = $response; } @@ -144,14 +144,14 @@ class Response extends ResponseAbstract implements RenderableInterface /** * Push a specific response ID. * - * @param \int $id Response ID + * @param int $id Response ID * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function pushResponseId(\int $id) + public function pushResponseId(int $id) { ob_start(); echo $this->response[$id]; @@ -193,14 +193,14 @@ class Response extends ResponseAbstract implements RenderableInterface /** * Remove response by ID. * - * @param \int $id Response ID + * @param int $id Response ID * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function remove(\int $id) : \bool + public function remove(int $id) : bool { if (isset($this->response[$id])) { unset($this->response[$id]); @@ -222,7 +222,7 @@ class Response extends ResponseAbstract implements RenderableInterface /** * {@inheritdoc} */ - public function getProtocolVersion() : \string + public function getProtocolVersion() : string { return '1.0'; } @@ -238,7 +238,7 @@ class Response extends ResponseAbstract implements RenderableInterface /** * {@inheritdoc} */ - public function hasHeader(\string $name) : \bool + public function hasHeader(string $name) : bool { return array_key_exists($name, $this->header); } @@ -246,7 +246,7 @@ class Response extends ResponseAbstract implements RenderableInterface /** * {@inheritdoc} */ - public function getBody() : \string + public function getBody() : string { return $this->render(); } @@ -254,14 +254,14 @@ class Response extends ResponseAbstract implements RenderableInterface /** * Generate response. * - * @return \string + * @return string * * @throws \Exception * * @since 1.0.0 * @author Dennis Eichhorn */ - public function render() : \string + public function render() : string { $render = $this->head->render(); @@ -284,7 +284,7 @@ class Response extends ResponseAbstract implements RenderableInterface /** * {@inheritdoc} */ - public function toCsv() : \string + public function toCsv() : string { return ArrayUtils::arrayToCSV($this->toArray()); } @@ -310,7 +310,7 @@ class Response extends ResponseAbstract implements RenderableInterface /** * {@inheritdoc} */ - public function getReasonPhrase() : \string + public function getReasonPhrase() : string { return $this->getHeader('Status'); } @@ -318,7 +318,7 @@ class Response extends ResponseAbstract implements RenderableInterface /** * {@inheritdoc} */ - public function getHeader(\string $name) + public function getHeader(string $name) { if (isset($this->header[$name])) { return $this->header[$name]; @@ -330,7 +330,7 @@ class Response extends ResponseAbstract implements RenderableInterface /** * {@inheritdoc} */ - public function setHeader($key, \string $header, \bool $overwrite = false) : \bool + public function setHeader($key, string $header, bool $overwrite = false) : bool { if (!$overwrite && isset($this->header[$key])) { return false; diff --git a/Message/Http/Rest.php b/Message/Http/Rest.php index a1d813e3b..bf38f3a64 100644 --- a/Message/Http/Rest.php +++ b/Message/Http/Rest.php @@ -51,12 +51,12 @@ class Rest /** * Set url. * - * @param \string $url Url + * @param string $url Url * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setUrl(\string $url) { + public function setUrl(string $url) { if (filter_var($url, FILTER_VALIDATE_URL) === false) { throw new InvalidUriException('$url'); } @@ -67,12 +67,12 @@ class Rest /** * Set method. * - * @param \string $method Method + * @param string $method Method * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setMethod(\string $method) { + public function setMethod(string $method) { if(!RequestMethod::isValidValue($method)) { throw new InvalidEnumValue($method); } @@ -85,12 +85,12 @@ class Rest * * @param mixed $data Data to pass * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function callApi($data = false) : \string + public function callApi($data = false) : string { $curl = curl_init(); diff --git a/Message/Mail/Imap.php b/Message/Mail/Imap.php index 851282863..fac8dcc50 100644 --- a/Message/Mail/Imap.php +++ b/Message/Mail/Imap.php @@ -48,7 +48,7 @@ class Imap extends Mail return imap_get_quotaroot($this->inbox, "INBOX"); } - public function getInbox(\string $option = 'ALL') : array + public function getInbox(string $option = 'ALL') : array { $ids = imap_search($this->inbox, $option, SE_FREE, 'UTF-8'); @@ -74,22 +74,22 @@ class Imap extends Mail return $this->getInbox('NEW'); } - public function getInboxFrom(\string $from) + public function getInboxFrom(string $from) { return $this->getInbox('FROM "' . $from . '"'); } - public function getInboxTo(\string $to) + public function getInboxTo(string $to) { return $this->getInbox('TO "' . $to . '"'); } - public function getInboxCc(\string $cc) + public function getInboxCc(string $cc) { return $this->getInbox('CC "' . $cc . '"'); } - public function getInboxBcc(\string $bcc) + public function getInboxBcc(string $bcc) { return $this->getInbox('BCC "' . $bcc . '"'); } @@ -99,7 +99,7 @@ class Imap extends Mail return $this->getInbox('ANSWERED'); } - public function getInboxSubject(\string $subject) + public function getInboxSubject(string $subject) { return $this->getInbox('SUBJECT "' . $subject . '"'); } @@ -124,7 +124,7 @@ class Imap extends Mail return $this->getInbox('DELETED'); } - public function getInboxText(\string $text) + public function getInboxText(string $text) { return $this->getInbox('TEXT "' . $text . '"'); } diff --git a/Message/Mail/Mail.php b/Message/Mail/Mail.php index ccba84e52..c5b2aa891 100644 --- a/Message/Mail/Mail.php +++ b/Message/Mail/Mail.php @@ -39,7 +39,7 @@ abstract class Mail protected $mailer = null; - public function __construct(\int $type) + public function __construct(int $type) { $this->type = $type; diff --git a/Message/MessageInterface.php b/Message/MessageInterface.php index a4173cb8a..ad0984cb2 100644 --- a/Message/MessageInterface.php +++ b/Message/MessageInterface.php @@ -50,92 +50,92 @@ interface MessageInterface /** * Checks if a header exists by the given case-insensitive name. * - * @param \string $name Header name + * @param string $name Header name * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function hasHeader(\string $name) : \bool; + public function hasHeader(string $name) : bool; /** * Retrieves a message header value by the given case-insensitive name. * - * @param \string $name Header name + * @param string $name Header name * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getHeader(\string $name); + public function getHeader(string $name); /** * Add header by ID. * * @param mixed $key Header ID - * @param \string $header Header string - * @param \bool $overwrite Overwrite existing headers + * @param string $header Header string + * @param bool $overwrite Overwrite existing headers * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setHeader($key, \string $header, \bool $overwrite = true); + public function setHeader($key, string $header, bool $overwrite = true); /** * Gets the body of the message. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getBody() : \string; + public function getBody() : string; /** * Set status code. * - * @param \string $status Status code + * @param string $status Status code * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setStatusCode(\string $status); + public function setStatusCode(string $status); /** * Get status code. * - * @return \string Status code + * @return string Status code * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getStatusCode() : \string; + public function getStatusCode() : string; /** * Get account id. * - * @return \int Account id + * @return int Account id * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getAccount() : \int; + public function getAccount() : int; /** * Set account id. * - * @param \int $account Account id + * @param int $account Account id * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setAccount(\int $account); + public function setAccount(int $account); } diff --git a/Message/RequestAbstract.php b/Message/RequestAbstract.php index 57afe0266..92bc9b1e9 100644 --- a/Message/RequestAbstract.php +++ b/Message/RequestAbstract.php @@ -78,7 +78,7 @@ abstract class RequestAbstract implements RequestInterface /** * Account. * - * @var \int + * @var int * @since 1.0.0 */ protected $account = null; @@ -94,7 +94,7 @@ abstract class RequestAbstract implements RequestInterface /** * Request status. * - * @var \string + * @var string * @since 1.0.0 */ private $status = RequestStatus::R_200; @@ -156,7 +156,7 @@ abstract class RequestAbstract implements RequestInterface /** * {@inheritdoc} */ - abstract public function getMethod() : \string; + abstract public function getMethod() : string; /** * {@inheritdoc} @@ -209,7 +209,7 @@ abstract class RequestAbstract implements RequestInterface /** * {@inheritdoc} */ - public function getAccount() : \int + public function getAccount() : int { return $this->account; } @@ -217,7 +217,7 @@ abstract class RequestAbstract implements RequestInterface /** * {@inheritdoc} */ - public function setAccount(\int $account) + public function setAccount(int $account) { $this->account = $account; } @@ -225,7 +225,7 @@ abstract class RequestAbstract implements RequestInterface /** * {@inheritdoc} */ - public function setStatusCode(\string $status) + public function setStatusCode(string $status) { $this->status = $status; } @@ -233,7 +233,7 @@ abstract class RequestAbstract implements RequestInterface /** * {@inheritdoc} */ - public function getStatusCode() : \string + public function getStatusCode() : string { return $this->status; } @@ -241,7 +241,7 @@ abstract class RequestAbstract implements RequestInterface /** * {@inheritdoc} */ - public abstract function getOrigin() : \string; + public abstract function getOrigin() : string; /** * {@inheritdoc} diff --git a/Message/RequestInterface.php b/Message/RequestInterface.php index b7c893fdc..5d421b74c 100644 --- a/Message/RequestInterface.php +++ b/Message/RequestInterface.php @@ -34,22 +34,22 @@ interface RequestInterface extends MessageInterface /** * Get request target. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getRequestTarget() : \string; + public function getRequestTarget() : string; /** * Get request method. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getMethod() : \string; + public function getMethod() : string; /** * Get request uri. @@ -64,7 +64,7 @@ interface RequestInterface extends MessageInterface /** * Get request hash. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn diff --git a/Message/ResponseAbstract.php b/Message/ResponseAbstract.php index bdae53801..4da687024 100644 --- a/Message/ResponseAbstract.php +++ b/Message/ResponseAbstract.php @@ -45,7 +45,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface /** * Responses. * - * @var \string[] + * @var string[] * @since 1.0.0 */ protected $response = []; @@ -53,7 +53,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface /** * Response status. * - * @var \int + * @var int * @since 1.0.0 */ protected $status = 200; @@ -61,7 +61,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface /** * Account. * - * @var \int + * @var int * @since 1.0.0 */ protected $account = null; @@ -69,7 +69,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface /** * {@inheritdoc} */ - abstract public function setHeader($key, \string $header, \bool $overwrite = true); + abstract public function setHeader($key, string $header, bool $overwrite = true); /** * {@inheritdoc} @@ -107,14 +107,14 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface * * @param mixed $key Response id * @param mixed $response Response to add - * @param \bool $overwrite Overwrite + * @param bool $overwrite Overwrite * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function set($key, $response, \bool $overwrite = true) + public function set($key, $response, bool $overwrite = true) { $this->response = ArrayUtils::setArray($key, $this->response, $response, ':', $overwrite); } @@ -122,7 +122,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface /** * {@inheritdoc} */ - public function setStatusCode(\string $status) + public function setStatusCode(string $status) { $this->status = $status; $this->generateHeader($status); @@ -131,7 +131,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface /** * {@inheritdoc} */ - public function getStatusCode() : \string + public function getStatusCode() : string { return $this->status; } @@ -139,7 +139,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface /** * {@inheritdoc} */ - public function getAccount() : \int + public function getAccount() : int { return $this->account; } @@ -147,7 +147,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface /** * {@inheritdoc} */ - public function setAccount(\int $account) + public function setAccount(int $account) { $this->account = $account; } @@ -155,7 +155,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface /** * {@inheritdoc} */ - public function toJson(\int $options = 0) : \string + public function toJson(int $options = 0) : string { return json_encode($this->toArray()); } diff --git a/Message/ResponseInterface.php b/Message/ResponseInterface.php index d09806726..407d57d29 100644 --- a/Message/ResponseInterface.php +++ b/Message/ResponseInterface.php @@ -32,12 +32,12 @@ interface ResponseInterface extends MessageInterface /** * Generate header automatically based on code. * - * @param \int $code HTTP status code + * @param int $code HTTP status code * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function generateHeader(\int $code); + public function generateHeader(int $code); } diff --git a/Message/UploadedFileInterface.php b/Message/UploadedFileInterface.php index fe09738d1..7e4591fdc 100644 --- a/Message/UploadedFileInterface.php +++ b/Message/UploadedFileInterface.php @@ -40,14 +40,14 @@ interface UploadedFileInterface /** * Move the uploaded file to a new location. * - * @param \string $targetPath Path to new location + * @param string $targetPath Path to new location * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function moveTo(\string $targetPath); + public function moveTo(string $targetPath); /** * Retrieve the file size. diff --git a/Model/Html/Head.php b/Model/Html/Head.php index 4f9ae285b..2a89e331a 100644 --- a/Model/Html/Head.php +++ b/Model/Html/Head.php @@ -38,7 +38,7 @@ class Head implements RenderableInterface /** * Page language. * - * @var \string + * @var string * @since 1.0.0 */ private $language = ''; @@ -46,7 +46,7 @@ class Head implements RenderableInterface /** * Page title. * - * @var \string + * @var string * @since 1.0.0 */ private $title = ''; @@ -62,7 +62,7 @@ class Head implements RenderableInterface /** * Is the header set? * - * @var \bool + * @var bool * @since 1.0.0 */ private $hasContent = false; @@ -118,12 +118,12 @@ class Head implements RenderableInterface /** * Set page title. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getTitle() : \string + public function getTitle() : string { return $this->title; } @@ -131,14 +131,14 @@ class Head implements RenderableInterface /** * Set page title. * - * @param \string $title Page title + * @param string $title Page title * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setTitle(\string $title) + public function setTitle(string $title) { $this->title = $title; } @@ -146,15 +146,15 @@ class Head implements RenderableInterface /** * Set page title. * - * @param \string $type Asset type - * @param \string $uri Asset uri + * @param string $type Asset type + * @param string $uri Asset uri * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function addAsset(\string $type, \string $uri) + public function addAsset(string $type, string $uri) { $this->assets[$uri] = $type; } @@ -162,14 +162,14 @@ class Head implements RenderableInterface /** * Set page language. * - * @param \string $language language string + * @param string $language language string * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setLanguage(\string $language) + public function setLanguage(string $language) { $this->language = $language; } @@ -177,12 +177,12 @@ class Head implements RenderableInterface /** * Get the evaluated contents of the object. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function render() : \string + public function render() : string { $head = ''; if ($this->hasContent) { @@ -197,12 +197,12 @@ class Head implements RenderableInterface /** * Render style. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function renderStyle() : \string + public function renderStyle() : string { $style = ''; foreach ($this->style as $css) { @@ -215,12 +215,12 @@ class Head implements RenderableInterface /** * Render script. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function renderScript() : \string + public function renderScript() : string { $script = ''; foreach ($this->script as $js) { @@ -233,16 +233,16 @@ class Head implements RenderableInterface /** * Set a style. * - * @param \string $key Style key - * @param \string $style Style source - * @param \bool $overwrite Overwrite if already existing + * @param string $key Style key + * @param string $style Style source + * @param bool $overwrite Overwrite if already existing * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setStyle(\string $key, \string $style, \bool $overwrite = true) + public function setStyle(string $key, string $style, bool $overwrite = true) { if ($overwrite || !isset($this->script[$key])) { $this->style[$key] = $style; @@ -252,16 +252,16 @@ class Head implements RenderableInterface /** * Set a script. * - * @param \string $key Script key - * @param \string $script Script source - * @param \bool $overwrite Overwrite if already existing + * @param string $key Script key + * @param string $script Script source + * @param bool $overwrite Overwrite if already existing * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setScript(\string $key, \string $script, \bool $overwrite = true) + public function setScript(string $key, string $script, bool $overwrite = true) { if ($overwrite || !isset($this->script[$key])) { $this->script[$key] = $script; @@ -297,12 +297,12 @@ class Head implements RenderableInterface /** * Render assets. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function renderAssets() : \string + public function renderAssets() : string { $asset = ''; foreach ($this->assets as $uri => $type) { @@ -319,12 +319,12 @@ class Head implements RenderableInterface /** * Render assets. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function renderAssetsLate() : \string + public function renderAssetsLate() : string { $asset = ''; foreach ($this->assets as $uri => $type) { diff --git a/Model/Html/Meta.php b/Model/Html/Meta.php index 6cd4079ff..ead989119 100644 --- a/Model/Html/Meta.php +++ b/Model/Html/Meta.php @@ -34,7 +34,7 @@ class Meta implements RenderableInterface /** * Keywords. * - * @var \string[] + * @var string[] * @since 1.0.0 */ private $keywords = []; @@ -42,7 +42,7 @@ class Meta implements RenderableInterface /** * Author. * - * @var \string + * @var string * @since 1.0.0 */ private $author = null; @@ -50,7 +50,7 @@ class Meta implements RenderableInterface /** * Charset. * - * @var \string + * @var string * @since 1.0.0 */ private $charset = null; @@ -58,7 +58,7 @@ class Meta implements RenderableInterface /** * Description. * - * @var \string + * @var string * @since 1.0.0 */ private $description = null; @@ -66,7 +66,7 @@ class Meta implements RenderableInterface /** * Language. * - * @var \string + * @var string * @since 1.0.0 */ private $language = 'en'; @@ -74,14 +74,14 @@ class Meta implements RenderableInterface /** * Add keyword. * - * @param \string $keyword Keyword + * @param string $keyword Keyword * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function addKeyword(\string $keyword) + public function addKeyword(string $keyword) { if (!in_array($keyword, $this->keywords)) { $this->keywords[] = $keyword; @@ -91,7 +91,7 @@ class Meta implements RenderableInterface /** * Get keywords. * - * @return \string[] Keywords + * @return string[] Keywords * * @since 1.0.0 * @author Dennis Eichhorn @@ -104,12 +104,12 @@ class Meta implements RenderableInterface /** * Get author. * - * @return \string Author + * @return string Author * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getAuthor() : \string + public function getAuthor() : string { return $this->author; } @@ -117,14 +117,14 @@ class Meta implements RenderableInterface /** * Set author. * - * @param \string $author Author + * @param string $author Author * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setAuthor(\string $author) + public function setAuthor(string $author) { $this->author = $author; } @@ -132,12 +132,12 @@ class Meta implements RenderableInterface /** * Get charset. * - * @return \string Charset + * @return string Charset * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getCharset() : \string + public function getCharset() : string { return $this->charset; } @@ -145,14 +145,14 @@ class Meta implements RenderableInterface /** * Set charset. * - * @param \string $charset Charset + * @param string $charset Charset * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setCharset(\string $charset) + public function setCharset(string $charset) { $this->charset = $charset; } @@ -160,12 +160,12 @@ class Meta implements RenderableInterface /** * Get description. * - * @return \string Descritpion + * @return string Descritpion * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getDescription() : \string + public function getDescription() : string { return $this->description; } @@ -173,14 +173,14 @@ class Meta implements RenderableInterface /** * Set description. * - * @param \string Descritpion + * @param string Descritpion * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setDescription(\string $description) + public function setDescription(string $description) { $this->description = $description; } @@ -188,12 +188,12 @@ class Meta implements RenderableInterface /** * Get language. * - * @return \string Language + * @return string Language * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getLanguage() : \string + public function getLanguage() : string { return $this->language; } @@ -201,14 +201,14 @@ class Meta implements RenderableInterface /** * Set language. * - * @param \string $language Language + * @param string $language Language * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setLanguage(\string $language) + public function setLanguage(string $language) { $this->language = $language; } @@ -216,7 +216,7 @@ class Meta implements RenderableInterface /** * {@inheritdoc} */ - public function render() : \string + public function render() : string { return (count($this->keywords) > 0 ? '"' : '') . (isset($this->author) ? '' : '') diff --git a/Module/InfoManager.php b/Module/InfoManager.php index a8193a182..44b661b68 100644 --- a/Module/InfoManager.php +++ b/Module/InfoManager.php @@ -44,7 +44,7 @@ class InfoManager /** * Module path. * - * @var \string + * @var string * @since 1.0.0 */ const MODULE_PATH = __DIR__ . '/../../Modules/'; @@ -52,12 +52,12 @@ class InfoManager /** * Object constructor. * - * @param \string $module Module name + * @param string $module Module name * * @since 1.0.0 * @author Dennis Eichhorn */ - public function __construct(\string $module) + public function __construct(string $module) { if (($path = realpath($oldPath = self::MODULE_PATH . $module . '/info.json')) === false || Validator::startsWith($path, self::MODULE_PATH)) { throw new FilePathException($oldPath); diff --git a/Module/ModuleAbstract.php b/Module/ModuleAbstract.php index 8526eaf7f..4c723fef0 100644 --- a/Module/ModuleAbstract.php +++ b/Module/ModuleAbstract.php @@ -34,7 +34,7 @@ abstract class ModuleAbstract /** * Receiving modules from? * - * @var \string[] + * @var string[] * @since 1.0.0 */ protected $receiving = []; @@ -42,7 +42,7 @@ abstract class ModuleAbstract /** * Receiving modules from? * - * @var \string[] + * @var string[] * @since 1.0.0 */ protected static $providing = []; @@ -50,7 +50,7 @@ abstract class ModuleAbstract /** * Module name. * - * @var \string + * @var string * @since 1.0.0 */ const MODULE_NAME = ''; @@ -74,7 +74,7 @@ abstract class ModuleAbstract /** * Dependencies. * - * @var \string + * @var string * @since 1.0.0 */ protected static $dependencies = []; @@ -120,15 +120,15 @@ abstract class ModuleAbstract /** * Get language files. * - * @param \string $language Language key - * @param \string $destination Application destination (e.g. Backend) + * @param string $language Language key + * @param string $destination Application destination (e.g. Backend) * * @return array * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getLocalization(\string $language, \string $destination) : array + public function getLocalization(string $language, string $destination) : array { $lang = []; if (isset(static::$localization[$destination])) { @@ -150,7 +150,7 @@ abstract class ModuleAbstract /** * {@inheritdoc} */ - public function addReceiving(\string $module) + public function addReceiving(string $module) { $this->receiving[] = $module; } @@ -167,7 +167,7 @@ abstract class ModuleAbstract /** * {@inheritdoc} */ - public function getName() : \string + public function getName() : string { /** @noinspection PhpUndefinedFieldInspection */ return static::MODULE_NAME; diff --git a/Module/ModuleFactory.php b/Module/ModuleFactory.php index 51577e5fc..167e77cb3 100644 --- a/Module/ModuleFactory.php +++ b/Module/ModuleFactory.php @@ -47,7 +47,7 @@ class ModuleFactory /** * Unassigned providing. * - * @var \string[][] + * @var string[][] * @since 1.0.0 */ public static $providing = []; @@ -65,7 +65,7 @@ class ModuleFactory /** * Gets and initializes modules. * - * @param \string $module Module ID + * @param string $module Module ID * @param ApplicationAbstract $app Application * * @return ModuleAbstract @@ -73,7 +73,7 @@ class ModuleFactory * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getInstance(\string $module, ApplicationAbstract $app) : ModuleAbstract + public static function getInstance(string $module, ApplicationAbstract $app) : ModuleAbstract { if (!isset(self::$loaded[$module])) { $class = '\\Modules\\' . $module . '\\Controller'; diff --git a/Module/ModuleManager.php b/Module/ModuleManager.php index 65e3177dd..9b8112452 100644 --- a/Module/ModuleManager.php +++ b/Module/ModuleManager.php @@ -41,7 +41,7 @@ class ModuleManager /** * Module path. * - * @var \string + * @var string * @since 1.0.0 */ const MODULE_PATH = ROOT_PATH . DIRECTORY_SEPARATOR . 'Modules'; @@ -277,14 +277,14 @@ class ModuleManager /** * Install module. * - * @param \string $module Module name + * @param string $module Module name * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function install(\string $module) + public function install(string $module) { $installed = $this->getInstalledModules(); @@ -398,15 +398,15 @@ class ModuleManager * * Installing additional functionality for another module * - * @param \string $from From module - * @param \string $for For module + * @param string $from From module + * @param string $for For module * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function installProviding(\string $from, \string $for) + public function installProviding(string $from, string $for) { if (file_exists(self::MODULE_PATH . '/' . $from . '/Admin/Install/' . $for . '.php')) { $class = '\\Modules\\' . $from . '\\Admin\\Install\\' . $for; @@ -418,7 +418,7 @@ class ModuleManager /** * Initialize module. * - * @param \string|array $module Module name + * @param string|array $module Module name * * @throws \InvalidArgumentException * @@ -442,14 +442,14 @@ class ModuleManager /** * Get module instance. * - * @param \string $module Module name + * @param string $module Module name * * @return \phpOMS\Module\ModuleAbstract * * @since 1.0.0 * @author Dennis Eichhorn */ - public function get(\string $module) + public function get(string $module) { if (!isset($this->running[$module])) { $this->initModule($module); @@ -461,15 +461,15 @@ class ModuleManager /** * Load module language. * - * @param \string $language Langauge - * @param \string $destination Destination + * @param string $language Langauge + * @param string $destination Destination * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function loadLanguage(\string $language, \string $destination) + public function loadLanguage(string $language, string $destination) { foreach ($this->running as $name => $module) { /** @var ModuleAbstract $module */ diff --git a/Pattern/Mediator.php b/Pattern/Mediator.php index 2f516a77c..7f99b8ec0 100644 --- a/Pattern/Mediator.php +++ b/Pattern/Mediator.php @@ -34,42 +34,42 @@ interface Mediator extends \Countable * * Listeners will get called if a certain event gets triggered * - * @param \string $event Event ID + * @param string $event Event ID * @param \Closure $callback Function to call if the event gets triggered - * @param \string $listener What class is attaching this listener + * @param string $listener What class is attaching this listener * - * @return \string UID for the listener + * @return string UID for the listener * * @since 1.0.0 * @author Dennis Eichhorn */ - public function attach(\string $event, \Closure $callback = null, \string $listener = null) : \string; + public function attach(string $event, \Closure $callback = null, string $listener = null) : string; /** * Removing a listener. * - * @param \int $event ID of the listener + * @param int $event ID of the listener * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function detach(\int $event); + public function detach(int $event); /** * Trigger event. * * An object fires an event * - * @param \string $event Event ID + * @param string $event Event ID * @param \Closure $callback Callback function of the event. This will get triggered after firering all listener callbacks. - * @param \string $source What class is invoking this event + * @param string $source What class is invoking this event * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function trigger(\string $event, \Closure $callback = null, \string $source = null) : \int; + public function trigger(string $event, \Closure $callback = null, string $source = null) : int; } diff --git a/Router/Router.php b/Router/Router.php index 8df71165f..41594f3e8 100644 --- a/Router/Router.php +++ b/Router/Router.php @@ -53,17 +53,17 @@ class Router /** * Add route. * - * @param \string $route Route regex + * @param string $route Route regex * @param mixed $destination Destination e.g. Module:function & method - * @param \string $method Request method - * @param \int $type Result type + * @param string $method Request method + * @param int $type Result type * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function add(\string $route, $destination, \string $method = RequestMethod::GET, \int $type = ViewLayout::MAIN) + public function add(string $route, $destination, string $method = RequestMethod::GET, int $type = ViewLayout::MAIN) { $this->routes[$route][] = [ 'dest' => $destination, @@ -75,15 +75,15 @@ class Router /** * Route uri. * - * @param \string $uri Uri to route - * @param \string $remoteMethod GET/POST etc. + * @param string $uri Uri to route + * @param string $remoteMethod GET/POST etc. * - * @return \string[] + * @return string[] * * @since 1.0.0 * @author Dennis Eichhorn */ - public function route(\string $uri, \string $remoteMethod = RequestMethod::GET) : array + public function route(string $uri, string $remoteMethod = RequestMethod::GET) : array { $bound = []; foreach ($this->routes as $route => $destination) { @@ -100,17 +100,17 @@ class Router /** * Match route and uri. * - * @param \string $route Route - * @param \string $method GET,POST for this route - * @param \string $uri Uri - * @param \string $remoteMethod Method this request is using + * @param string $route Route + * @param string $method GET,POST for this route + * @param string $uri Uri + * @param string $remoteMethod Method this request is using * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - private function match(\string $route, \string $method, \string $uri, \string $remoteMethod = RequestMethod::GET) : \bool + private function match(string $route, string $method, string $uri, string $remoteMethod = RequestMethod::GET) : bool { return (bool) preg_match('~^' . $route . '$~', $uri) && ($method == 'any' || $remoteMethod == $method); } diff --git a/Security/Encryption/Encryption.php b/Security/Encryption/Encryption.php index f98751dd9..f334fc683 100644 --- a/Security/Encryption/Encryption.php +++ b/Security/Encryption/Encryption.php @@ -42,7 +42,7 @@ class Encryption /** * Algorithm for encryption. * - * @var \string + * @var string * @since 1.0.0 */ private $cipher = null; @@ -50,7 +50,7 @@ class Encryption /** * Block size. * - * @var \int + * @var int * @since 1.0.0 */ private $block = 16; @@ -58,7 +58,7 @@ class Encryption /** * Encryption mode. * - * @var \string + * @var string * @since 1.0.0 */ private $mode = MCRYPT_MODE_CBC; @@ -66,13 +66,13 @@ class Encryption /** * Constructor. * - * @param \string $key Encryption key - * @param \string $cipher Encryption algorithm + * @param string $key Encryption key + * @param string $cipher Encryption algorithm * * @since 1.0.0 * @author Dennis Eichhorn */ - public function __construct(\string $key, \string $cipher = MCRYPT_RIJNDAEL_128) + public function __construct(string $key, string $cipher = MCRYPT_RIJNDAEL_128) { $this->key = $key; $this->cipher = $cipher; @@ -81,12 +81,12 @@ class Encryption /** * Get encryption key. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getKey() : \string + public function getKey() : string { return $this->key; } @@ -94,14 +94,14 @@ class Encryption /** * Set encryption key. * - * @param \string $key Encryption key + * @param string $key Encryption key * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setKey(\string $key) + public function setKey(string $key) { $this->key = $key; } @@ -109,12 +109,12 @@ class Encryption /** * Get encryption cipher. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getCipher() : \string + public function getCipher() : string { return $this->key; } @@ -122,14 +122,14 @@ class Encryption /** * Set encryption cipher. * - * @param \string $key Encryption key + * @param string $key Encryption key * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setCipher(\string $key) + public function setCipher(string $key) { $this->key = $key; } @@ -137,12 +137,12 @@ class Encryption /** * Get block size. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getBlock() : \int + public function getBlock() : int { return $this->block; } @@ -150,14 +150,14 @@ class Encryption /** * Set block size. * - * @param \int $block + * @param int $block * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setBlock(\int $block) + public function setBlock(int $block) { $this->block = $block; } @@ -165,12 +165,12 @@ class Encryption /** * Get encryption mode. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getMode() : \string + public function getMode() : string { return $this->mode; } @@ -178,14 +178,14 @@ class Encryption /** * Set encryption mode. * - * @param \string $mode + * @param string $mode * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setMode(\string $mode) + public function setMode(string $mode) { $this->mode = $mode; } @@ -193,12 +193,12 @@ class Encryption /** * Get input vector size. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - private function getIvSize() : \int + private function getIvSize() : int { return mcrypt_get_iv_size($this->cipher, $this->mode); } @@ -206,12 +206,12 @@ class Encryption /** * Get random data source. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - private function getRandomizer() : \int + private function getRandomizer() : int { if (defined('MCRYPT_DEV_URANDOM')) { return MCRYPT_DEV_URANDOM; @@ -229,15 +229,15 @@ class Encryption /** * Mcrypt padding. * - * @param \string $value Value to encrypt - * @param \string $iv Input vector + * @param string $value Value to encrypt + * @param string $iv Input vector * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - private function padAndMcrypt(\string $value, \string $iv) : \string + private function padAndMcrypt(string $value, string $iv) : string { $value = $this->addPadding(serialize($value)); @@ -247,14 +247,14 @@ class Encryption /** * Add padding. * - * @param \string $value Value to encrypt + * @param string $value Value to encrypt * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - private function addPadding(\string $value) : \string + private function addPadding(string $value) : string { $pad = $this->block - (strlen($value) % $this->block); @@ -264,15 +264,15 @@ class Encryption /** * Create hash of value. * - * @param \string $value Value to encrypt - * @param \string $iv Input vector + * @param string $value Value to encrypt + * @param string $iv Input vector * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - private function hash(\string $value, \string $iv) : \string + private function hash(string $value, string $iv) : string { return hash_hmac('sha256', $iv . $value, $this->key); } @@ -280,14 +280,14 @@ class Encryption /** * Encrypt value. * - * @param \string $value Value to encrypt + * @param string $value Value to encrypt * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function encrpyt(\string $value) : \string + public function encrpyt(string $value) : string { $iv = mcrypt_create_iv($this->getIvSize(), $this->getRandomizer()); $value = base64_encode($this->padAndMcrypt($value, $iv)); @@ -299,14 +299,14 @@ class Encryption /** * Decrypt value. * - * @param \string $payload Payload to decrypt + * @param string $payload Payload to decrypt * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function decrypt(\string $payload) : \string + public function decrypt(string $payload) : string { $payload = $this->getJsonPayload($payload); $value = base64_decode($payload['value']); @@ -322,14 +322,14 @@ class Encryption /** * Get json from payload. * - * @param \string $payload Payload to decrypt + * @param string $payload Payload to decrypt * - * @return \string|false + * @return string|false * * @since 1.0.0 * @author Dennis Eichhorn */ - private function getJsonPayload(\string $payload) + private function getJsonPayload(string $payload) { $payload = json_decode(base64_decode($payload), true); @@ -349,12 +349,12 @@ class Encryption * * @param mixed $payload Payload data * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - private function validMac($payload) : \bool + private function validMac($payload) : bool { return $this->hash($payload['value'], $payload['iv']) == $payload['mac']; } @@ -364,12 +364,12 @@ class Encryption * * @param mixed $payload Payload data * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - private function invalidPayload($payload) : \bool + private function invalidPayload($payload) : bool { return !is_array($payload) || !isset($payload['iv']) || !isset($payload['value']) || !isset($payload['mac']); } @@ -377,14 +377,14 @@ class Encryption /** * Remove padding. * - * @param \string $value Value to decrypt + * @param string $value Value to decrypt * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - private function stripPadding(\string $value) : \string + private function stripPadding(string $value) : string { $pad = ord($value[($len = strlen($value)) - 1]); @@ -394,15 +394,15 @@ class Encryption /** * Check if padding is valid. * - * @param \string $pad Padding to check - * @param \string $value Value with padding + * @param string $pad Padding to check + * @param string $value Value with padding * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - private function paddingIsValid(\string $pad, \string $value) : \bool + private function paddingIsValid(string $pad, string $value) : bool { $beforePad = strlen($value) - $pad; @@ -412,15 +412,15 @@ class Encryption /** * Decrypt. * - * @param \string $value Value to decrypt - * @param \string $iv Input vector + * @param string $value Value to decrypt + * @param string $iv Input vector * - * @return \string|false + * @return string|false * * @since 1.0.0 * @author Dennis Eichhorn */ - private function mcryptDecrypt(\string $value, \string $iv) + private function mcryptDecrypt(string $value, string $iv) { try { return mcrypt_decrypt($this->cipher, $this->key, $value, $this->mode, $iv); diff --git a/Socket/Client/Client.php b/Socket/Client/Client.php index b1ecb41fe..4be78e03c 100644 --- a/Socket/Client/Client.php +++ b/Socket/Client/Client.php @@ -62,7 +62,7 @@ class Client extends SocketAbstract /** * {@inheritdoc} */ - public function create(\string $ip, \int $port) + public function create(string $ip, int $port) { parent::create($ip, $port); } diff --git a/Socket/CommandManager.php b/Socket/CommandManager.php index aba898a41..87d015d99 100644 --- a/Socket/CommandManager.php +++ b/Socket/CommandManager.php @@ -38,7 +38,7 @@ class CommandManager implements \Countable /** * Commands. * - * @var \int + * @var int * @since 1.0.0 */ private $count = 0; @@ -56,7 +56,7 @@ class CommandManager implements \Countable /** * Attach new command. * - * @param \string $cmd Command ID + * @param string $cmd Command ID * @param mixed $callback Function callback * @param mixed $source Provider * @@ -65,7 +65,7 @@ class CommandManager implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function attach(\string $cmd, $callback, $source) + public function attach(string $cmd, $callback, $source) { $this->commands[$cmd] = [$callback, $source]; $this->count++; @@ -74,7 +74,7 @@ class CommandManager implements \Countable /** * Detach existing command. * - * @param \string $cmd Command ID + * @param string $cmd Command ID * @param mixed $source Provider * * @return void @@ -82,7 +82,7 @@ class CommandManager implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function detach(\string $cmd, $source) + public function detach(string $cmd, $source) { if (array_key_exists($cmd, $this->commands)) { unset($this->commands[$cmd]); @@ -93,7 +93,7 @@ class CommandManager implements \Countable /** * Trigger command. * - * @param \string $cmd Command ID + * @param string $cmd Command ID * @param mixed $conn Client ID * @param mixed $para Parameters to pass * @@ -102,7 +102,7 @@ class CommandManager implements \Countable * @since 1.0.0 * @author Dennis Eichhorn */ - public function trigger(\string $cmd, $conn, $para) + public function trigger(string $cmd, $conn, $para) { if (array_key_exists($cmd, $this->commands)) { return $this->commands[$cmd][0]($conn, $para); @@ -114,12 +114,12 @@ class CommandManager implements \Countable /** * Count commands. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function count() : \int + public function count() : int { return $this->count; } diff --git a/Socket/Packets/Header.php b/Socket/Packets/Header.php index 509a63932..7a1936882 100644 --- a/Socket/Packets/Header.php +++ b/Socket/Packets/Header.php @@ -37,7 +37,7 @@ class Header implements \Serializable /** * Packet size. * - * @var \int + * @var int * @since 1.0.0 */ private $length = 0; @@ -53,7 +53,7 @@ class Header implements \Serializable /** * Packet subtype. * - * @var \int + * @var int * @since 1.0.0 */ private $subtype = 0; @@ -79,7 +79,7 @@ class Header implements \Serializable } /** - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn @@ -90,7 +90,7 @@ class Header implements \Serializable } /** - * @param \int $length + * @param int $length * * @return void * @@ -103,7 +103,7 @@ class Header implements \Serializable } /** - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn @@ -114,7 +114,7 @@ class Header implements \Serializable } /** - * @param \int $type + * @param int $type * * @return void * @@ -127,7 +127,7 @@ class Header implements \Serializable } /** - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn @@ -138,7 +138,7 @@ class Header implements \Serializable } /** - * @param \int $subtype + * @param int $subtype * * @return void * @@ -153,7 +153,7 @@ class Header implements \Serializable /** * Serializing header. * - * @return \string Json serialization + * @return string Json serialization * * @since 1.0.0 * @author Dennis Eichhorn @@ -166,7 +166,7 @@ class Header implements \Serializable /** * Jsonfy object. * - * @return \string Json serialization + * @return string Json serialization * * @since 1.0.0 * @author Dennis Eichhorn @@ -179,7 +179,7 @@ class Header implements \Serializable /** * Unserializing json string. * - * @param \string $string String to unserialize + * @param string $string String to unserialize * * @return void * diff --git a/Socket/Packets/PacketAbstract.php b/Socket/Packets/PacketAbstract.php index 52b6d0952..68eb639a2 100644 --- a/Socket/Packets/PacketAbstract.php +++ b/Socket/Packets/PacketAbstract.php @@ -56,7 +56,7 @@ abstract class PacketAbstract implements \Serializable * * This is using a json format * - * @return \string Json string + * @return string Json string * * @var Header * @since 1.0.0 @@ -68,7 +68,7 @@ abstract class PacketAbstract implements \Serializable * * This is using a json format * - * @param \string $string Json string + * @param string $string Json string * * @var Header * @since 1.0.0 diff --git a/Socket/Packets/PacketManager.php b/Socket/Packets/PacketManager.php index 97f68fdc3..ac1ee2465 100644 --- a/Socket/Packets/PacketManager.php +++ b/Socket/Packets/PacketManager.php @@ -68,7 +68,7 @@ class PacketManager /** * Handle package. * - * @param \string $data Package data + * @param string $data Package data * @param mixed $key Client Id * * @return void @@ -76,7 +76,7 @@ class PacketManager * @since 1.0.0 * @author Dennis Eichhorn */ - public function handle(\string $data, $key) + public function handle(string $data, $key) { /* if (!empty($data)) { diff --git a/Socket/Server/Server.php b/Socket/Server/Server.php index 7ee604b81..d374dcf59 100644 --- a/Socket/Server/Server.php +++ b/Socket/Server/Server.php @@ -37,7 +37,7 @@ class Server extends SocketAbstract /** * Socket connection limit. * - * @var \int + * @var int * @since 1.0.0 */ private $limit = 10; @@ -66,7 +66,7 @@ class Server extends SocketAbstract */ private $app = null; - public static function hasInternet() : \bool + public static function hasInternet() : bool { $connected = @fsockopen("www.google.com", 80); @@ -95,7 +95,7 @@ class Server extends SocketAbstract /** * {@inheritdoc} */ - public function create(\string $ip, \int $port) + public function create(string $ip, int $port) { parent::create($ip, $port); socket_bind($this->sock, $this->ip, $this->port); @@ -104,14 +104,14 @@ class Server extends SocketAbstract /** * Set connection limit. * - * @param \int $limit Connection limit + * @param int $limit Connection limit * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setLimit(\int $limit) + public function setLimit(int $limit) { $this->limit = $limit; } @@ -171,12 +171,12 @@ class Server extends SocketAbstract * * @param mixed $key Client key * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - private function clientReadError($key) : \bool + private function clientReadError($key) : bool { if (socket_last_error() === 10054) { socket_clear_error(); diff --git a/Socket/SocketAbstract.php b/Socket/SocketAbstract.php index 2db8e3a2a..160fcfeb0 100644 --- a/Socket/SocketAbstract.php +++ b/Socket/SocketAbstract.php @@ -32,7 +32,7 @@ abstract class SocketAbstract implements SocketInterface /** * Socket ip. * - * @var \string + * @var string * @since 1.0.0 */ protected $ip = null; @@ -40,7 +40,7 @@ abstract class SocketAbstract implements SocketInterface /** * Socket port. * - * @var \int + * @var int * @since 1.0.0 */ protected $port = null; @@ -48,7 +48,7 @@ abstract class SocketAbstract implements SocketInterface /** * Socket running? * - * @var \bool + * @var bool * @since 1.0.0 */ protected $run = true; @@ -64,7 +64,7 @@ abstract class SocketAbstract implements SocketInterface /** * {@inheritdoc} */ - public function create(\string $ip, \int $port) + public function create(string $ip, int $port) { $this->ip = $ip; $this->port = $port; diff --git a/Socket/SocketInterface.php b/Socket/SocketInterface.php index a4218e0dd..cb49e5145 100644 --- a/Socket/SocketInterface.php +++ b/Socket/SocketInterface.php @@ -32,13 +32,13 @@ interface SocketInterface /** * Create the socket. * - * @param \string $ip IP address - * @param \int $port Port + * @param string $ip IP address + * @param int $port Port * * @since 1.0.0 * @author Dennis Eichhorn */ - public function create(\string $ip, \int $port); + public function create(string $ip, int $port); /** * Close socket. diff --git a/Stdlib/PriorityQueue.php b/Stdlib/PriorityQueue.php index adc730820..ad65be1cd 100644 --- a/Stdlib/PriorityQueue.php +++ b/Stdlib/PriorityQueue.php @@ -30,7 +30,7 @@ class PriorityQueue implements \Countable, \Serializable /** * Queue elements. * - * @var \int + * @var int * @since 1.0.0 */ private $count = 0; @@ -57,14 +57,14 @@ class PriorityQueue implements \Countable, \Serializable * Insert element into queue. * * @param mixed $data Queue element - * @param \float $priority Priority of this element + * @param float $priority Priority of this element * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function insert($data, \float $priority = 0.0) : \int + public function insert($data, float $priority = 0.0) : int { do { $key = rand(); @@ -91,14 +91,14 @@ class PriorityQueue implements \Countable, \Serializable /** * Increase all queue priorities. * - * @param \float $increase Value to increase every element + * @param float $increase Value to increase every element * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function increaseAll(\float $increase) + public function increaseAll(float $increase) { foreach ($this->queue as $key => &$ele) { $ele['priority'] += $increase; @@ -122,14 +122,14 @@ class PriorityQueue implements \Countable, \Serializable /** * Delete element. * - * @param \int $id Element to delete + * @param int $id Element to delete * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function delete(\int $id = null) + public function delete(int $id = null) { if ($id === null) { $this->remove(); @@ -152,15 +152,15 @@ class PriorityQueue implements \Countable, \Serializable /** * Set element priority. * - * @param \int $id Element ID - * @param \float $priority Element priority + * @param int $id Element ID + * @param float $priority Element priority * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setPriority(\int $id, \float $priority) + public function setPriority(int $id, float $priority) { $this->queue[$id]['priority'] = $priority; } @@ -168,14 +168,14 @@ class PriorityQueue implements \Countable, \Serializable /** * Set element priority. * - * @param \int $id Element ID + * @param int $id Element ID * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getPriority(\int $id) : \float + public function getPriority(int $id) : float { return $this->queue[$id]['priority']; } @@ -183,7 +183,7 @@ class PriorityQueue implements \Countable, \Serializable /** * {@inheritdoc} */ - public function count() : \int + public function count() : int { return $this->count; } @@ -191,7 +191,7 @@ class PriorityQueue implements \Countable, \Serializable /** * {@inheritdoc} */ - public function serialize() : \string + public function serialize() : string { return json_encode($this->queue); } diff --git a/System/ArrayParser.php b/System/ArrayParser.php index 0cd77ea49..230b2c9c5 100644 --- a/System/ArrayParser.php +++ b/System/ArrayParser.php @@ -34,7 +34,7 @@ class ArrayParser /** * File path. * - * @var \string + * @var string * @since 1.0.0 */ public $file = null; @@ -50,13 +50,13 @@ class ArrayParser /** * Constructor. * - * @param \string $file File path - * @param \string $arr_name Array to parse + * @param string $file File path + * @param string $arr_name Array to parse * * @since 1.0.0 * @author Dennis Eichhorn */ - public function __construct(\string $file, \string $arr_name) + public function __construct(string $file, string $arr_name) { if (file_exists($file)) { $this->file = $file; @@ -104,14 +104,14 @@ class ArrayParser /** * Saving array to file. * - * @param \string $name Name of new array + * @param string $name Name of new array * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function save(\string $name) + public function save(string $name) { $arr = '<' . '?php' . PHP_EOL . '$' . $name . ' = [' . PHP_EOL @@ -126,12 +126,12 @@ class ArrayParser * * @param array $arr Array to serialize * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function serializeArray(array $arr) : \string + public function serializeArray(array $arr) : string { foreach ($arr as $key => $val) { if (is_array($val)) { diff --git a/System/FileSystem.php b/System/FileSystem.php index 3e8264261..8b506d5ea 100644 --- a/System/FileSystem.php +++ b/System/FileSystem.php @@ -46,8 +46,8 @@ class FileSystem /** * Get file count inside path. * - * @param \string $path Path to folder - * @param \bool $recursive Should sub folders be counted as well? + * @param string $path Path to folder + * @param bool $recursive Should sub folders be counted as well? * @param array $ignore Ignore these sub-paths * * @return int @@ -55,7 +55,7 @@ class FileSystem * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFileCount(\string $path, \bool $recursive = true, array $ignore = ['.', '..', 'cgi-bin', + public static function getFileCount(string $path, bool $recursive = true, array $ignore = ['.', '..', 'cgi-bin', '.DS_Store']) { $size = 0; @@ -89,7 +89,7 @@ class FileSystem { } - public static function deletePath($path) : \bool + public static function deletePath($path) : bool { $path = realpath($oldPath = $path); if ($path === false || !is_dir($path) || Validator::startsWith($path, ROOT_PATH)) { diff --git a/Uri/Http.php b/Uri/Http.php index 310175cda..d4b33fd56 100644 --- a/Uri/Http.php +++ b/Uri/Http.php @@ -36,7 +36,7 @@ class Http implements UriInterface /** * Root path. * - * @var \string + * @var string * @since 1.0.0 */ private $rootPath = ''; @@ -44,7 +44,7 @@ class Http implements UriInterface /** * Uri. * - * @var \string + * @var string * @since 1.0.0 */ private $uri = ''; @@ -52,7 +52,7 @@ class Http implements UriInterface /** * Uri scheme. * - * @var \string + * @var string * @since 1.0.0 */ private $scheme = ''; @@ -60,7 +60,7 @@ class Http implements UriInterface /** * Uri host. * - * @var \string + * @var string * @since 1.0.0 */ private $host = ''; @@ -68,7 +68,7 @@ class Http implements UriInterface /** * Uri port. * - * @var \int + * @var int * @since 1.0.0 */ private $port = 80; @@ -76,7 +76,7 @@ class Http implements UriInterface /** * Uri user. * - * @var \string + * @var string * @since 1.0.0 */ private $user = ''; @@ -84,7 +84,7 @@ class Http implements UriInterface /** * Uri password. * - * @var \string + * @var string * @since 1.0.0 */ private $pass = ''; @@ -92,7 +92,7 @@ class Http implements UriInterface /** * Uri path. * - * @var \string + * @var string * @since 1.0.0 */ private $path = ''; @@ -100,7 +100,7 @@ class Http implements UriInterface /** * Uri query. * - * @var \string + * @var string * @since 1.0.0 */ private $query = null; @@ -108,7 +108,7 @@ class Http implements UriInterface /** * Uri fragment. * - * @var \string + * @var string * @since 1.0.0 */ private $fragment = ''; @@ -116,7 +116,7 @@ class Http implements UriInterface /** * Uri base. * - * @var \string + * @var string * @since 1.0.0 */ private $base = ''; @@ -124,12 +124,12 @@ class Http implements UriInterface /** * Constructor. * - * @param \string $rootPath Root path for subdirectory + * @param string $rootPath Root path for subdirectory * * @since 1.0.0 * @author Dennis Eichhorn */ - public function __construct(\string $rootPath) + public function __construct(string $rootPath) { $this->rootPath = $rootPath; } @@ -137,12 +137,12 @@ class Http implements UriInterface /** * Get current uri. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCurrent() : \string + public static function getCurrent() : string { /** @noinspection PhpUndefinedConstantInspection */ return 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; @@ -151,7 +151,7 @@ class Http implements UriInterface /** * {@inheritdoc} */ - public static function isValid(\string $uri) : \bool + public static function isValid(string $uri) : bool { return filter_var($uri, FILTER_VALIDATE_URL); } @@ -159,12 +159,12 @@ class Http implements UriInterface /** * Get root path. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getRootPath() : \string + public function getRootPath() : string { return $this->rootPath; } @@ -172,12 +172,12 @@ class Http implements UriInterface /** * Get scheme. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getScheme() : \string + public function getScheme() : string { return $this->scheme; } @@ -185,12 +185,12 @@ class Http implements UriInterface /** * Get host. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getHost() : \string + public function getHost() : string { return $this->host; } @@ -198,12 +198,12 @@ class Http implements UriInterface /** * Get port. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getPort() : \int + public function getPort() : int { return $this->port; } @@ -211,12 +211,12 @@ class Http implements UriInterface /** * Get password. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getPass() : \string + public function getPass() : string { return $this->pass; } @@ -224,12 +224,12 @@ class Http implements UriInterface /** * Get path. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getPath() : \string + public function getPath() : string { return $this->path; } @@ -237,14 +237,14 @@ class Http implements UriInterface /** * Get query. * - * @param null|\string $key Query key + * @param null|string $key Query key * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getQuery(\string $key = null) + public function getQuery(string $key = null) { return isset($key) ? $this->query[$key] ?? null : $this->query; } @@ -252,12 +252,12 @@ class Http implements UriInterface /** * Get fragment. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getFragment() : \string + public function getFragment() : string { return $this->fragment; } @@ -265,12 +265,12 @@ class Http implements UriInterface /** * Get base. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getBase() : \string + public function getBase() : string { return $this->base; } @@ -278,14 +278,14 @@ class Http implements UriInterface /** * Set uri. * - * @param \string $uri Uri + * @param string $uri Uri * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function set(\string $uri) + public function set(string $uri) { $this->uri = $uri; @@ -335,7 +335,7 @@ class Http implements UriInterface /** * {@inheritdoc} */ - public function getAuthority() : \string + public function getAuthority() : string { return ($this->getUser() !== '' ? $this->getUser() . '@' : '') . $this->host . (isset($this->port) && $this->port !== '' ? ':' . $this->port : ''); } @@ -343,12 +343,12 @@ class Http implements UriInterface /** * Get user. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getUser() : \string + public function getUser() : string { return $this->user; } @@ -356,7 +356,7 @@ class Http implements UriInterface /** * {@inheritdoc} */ - public function getUserInfo() : \string + public function getUserInfo() : string { return $this->user . (isset($this->pass) && $this->pass !== '' ? ':' . $this->pass : ''); } diff --git a/Uri/UriFactory.php b/Uri/UriFactory.php index 5fee32ed3..93cabc7ca 100644 --- a/Uri/UriFactory.php +++ b/Uri/UriFactory.php @@ -36,7 +36,7 @@ class UriFactory /** * Dynamic query elements. * - * @var \string[] + * @var string[] * @since 1.0.0 */ private static $uri = []; @@ -54,14 +54,14 @@ class UriFactory /** * Set global query replacements. * - * @param \string $key Replacement key + * @param string $key Replacement key * * @return false|string * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getQuery(\string $key) + public static function getQuery(string $key) { return self::$uri[$key] ?? false; } @@ -69,16 +69,16 @@ class UriFactory /** * Set global query replacements. * - * @param \string $key Replacement key - * @param \string $value Replacement value - * @param \bool $overwrite Overwrite if already exists + * @param string $key Replacement key + * @param string $value Replacement value + * @param bool $overwrite Overwrite if already exists * * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function setQuery(\string $key, \string $value, \bool $overwrite = true) : \bool + public static function setQuery(string $key, string $value, bool $overwrite = true) : bool { if ($overwrite || !isset(self::$uri[$key])) { self::$uri[$key] = $value; @@ -92,9 +92,9 @@ class UriFactory /** * Build uri. * - * @param \string $uri Path data + * @param string $uri Path data * @param array $toMatch Optional special replacements - * @param UriScheme|\int $scheme Scheme type + * @param UriScheme|int $scheme Scheme type * * @return null|string * @@ -103,7 +103,7 @@ class UriFactory * @since 1.0.0 * @author Dennis Eichhorn */ - public static function build(\string $uri, array $toMatch = [], \int $scheme = UriScheme::HTTP) + public static function build(string $uri, array $toMatch = [], int $scheme = UriScheme::HTTP) { $uri = preg_replace_callback('(\{[\/#\?@\.\$][a-zA-Z0-9]*\})', function ($match) use ($toMatch) { $match = substr($match[0], 1, strlen($match[0]) - 2); diff --git a/Uri/UriInterface.php b/Uri/UriInterface.php index 1fb8af42b..f14e944d5 100644 --- a/Uri/UriInterface.php +++ b/Uri/UriInterface.php @@ -32,101 +32,101 @@ interface UriInterface /** * Is uri valid? * - * @param \string $uri Uri string + * @param string $uri Uri string * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function isValid(\string $uri) : \bool; + public static function isValid(string $uri) : bool; /** * Get scheme. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getScheme() : \string; + public function getScheme() : string; /** * Get authority. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getAuthority() : \string; + public function getAuthority() : string; /** * Get user info. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getUserInfo() : \string; + public function getUserInfo() : string; /** * Get host. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getHost() : \string; + public function getHost() : string; /** * Get port. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getPort() : \int; + public function getPort() : int; /** * Get path. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getPath() : \string; + public function getPath() : string; /** * Get query. * - * @param \string $key Query key + * @param string $key Query key * - * @return \string|array + * @return string|array * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getQuery(\string $key = null); + public function getQuery(string $key = null); /** * Get fragment. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getFragment() : \string; + public function getFragment() : string; /** * Get uri. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn @@ -136,10 +136,10 @@ interface UriInterface /** * Get base uri. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getBase() : \string; + public function getBase() : string; } diff --git a/Utils/ArrayUtils.php b/Utils/ArrayUtils.php index a91b12662..ca2384d2b 100644 --- a/Utils/ArrayUtils.php +++ b/Utils/ArrayUtils.php @@ -42,16 +42,16 @@ class ArrayUtils /** * Check if needle exists in multidimensional array. * - * @param \string $path Path to element + * @param string $path Path to element * @param array $data Array - * @param \string $delim Delimiter for path + * @param string $delim Delimiter for path * * @return array * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function unsetArray(\string $path, array $data, \string $delim) : array + public static function unsetArray(string $path, array $data, string $delim) : array { $nodes = explode($delim, $path); $prevEl = null; @@ -74,18 +74,18 @@ class ArrayUtils /** * Check if needle exists in multidimensional array. * - * @param \string $path Path to element + * @param string $path Path to element * @param array $data Array * @param mixed $value Value to add - * @param \string $delim Delimiter for path - * @param \bool $overwrite Overwrite if existing + * @param string $delim Delimiter for path + * @param bool $overwrite Overwrite if existing * * @return array * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function setArray(\string $path, array $data, $value, \string $delim, \bool $overwrite = false) : array + public static function setArray(string $path, array $data, $value, string $delim, bool $overwrite = false) : array { $pathParts = explode($delim, $path); $current = &$data; @@ -117,12 +117,12 @@ class ArrayUtils * @param mixed $needle Needle for search * @param array $haystack Haystack for search * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function inArrayRecursive($needle, array $haystack) : \bool + public static function inArrayRecursive($needle, array $haystack) : bool { $found = false; @@ -146,14 +146,14 @@ class ArrayUtils * * @param array $array Array to stringify * - * @return \string + * @return string * * @throws \Exception * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function stringify(array $array) : \string + public static function stringify(array $array) : string { $str = '['; @@ -196,16 +196,16 @@ class ArrayUtils * Convert array to csv string. * * @param array $data Data to convert - * @param \string $delimiter Delim to use - * @param \string $enclosure Enclosure to use - * @param \string $escape Escape to use + * @param string $delimiter Delim to use + * @param string $enclosure Enclosure to use + * @param string $escape Escape to use * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function arrayToCSV(array $data, \string $delimiter = ';', \string $enclosure = '"', \string $escape = '\\') : \string + public static function arrayToCSV(array $data, string $delimiter = ';', string $enclosure = '"', string $escape = '\\') : string { $outstream = fopen('php://memory', 'r+'); fputcsv($outstream, $data, $delimiter, $enclosure, $escape); diff --git a/Utils/Color.php b/Utils/Color.php index 16f039d44..414e77d33 100644 --- a/Utils/Color.php +++ b/Utils/Color.php @@ -32,17 +32,17 @@ class Color /** * Creates a 3 point gradient based on a input value. * - * @param \int $value Value to represent by color - * @param \int[] $start Gradient start - * @param \int[] $stop Gradient stop - * @param \int[] $end Gradient end + * @param int $value Value to represent by color + * @param int[] $start Gradient start + * @param int[] $stop Gradient stop + * @param int[] $end Gradient end * * @return array * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getRGBGradient(\int $value, array $start, array $stop, array $end) + public static function getRGBGradient(int $value, array $start, array $stop, array $end) { $diff = []; $gradient = []; diff --git a/Utils/Converter/Currency.php b/Utils/Converter/Currency.php index feace245f..5b3e65064 100644 --- a/Utils/Converter/Currency.php +++ b/Utils/Converter/Currency.php @@ -88,15 +88,15 @@ class Currency /** * Convert from EUR * - * @param \float $value Value to convert - * @param \string $to Output currency + * @param float $value Value to convert + * @param string $to Output currency * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function fromEurTo(\float $value, \string $to) : \float + public static function fromEurTo(float $value, string $to) : float { $currencies = self::getEcbEuroRates(); $to = strtoupper($to); @@ -111,15 +111,15 @@ class Currency /** * Convert to EUR * - * @param \float $value Value to convert - * @param \string $from Input currency + * @param float $value Value to convert + * @param string $from Input currency * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function fromToEur(\float $value, \string $from) : \float + public static function fromToEur(float $value, string $from) : float { $currencies = self::getEcbEuroRates(); $from = strtoupper($from); @@ -134,16 +134,16 @@ class Currency /** * Convert currency based on ECB reates * - * @param \float $value Value to convert - * @param \string $from Input currency - * @param \string $to Output currency + * @param float $value Value to convert + * @param string $from Input currency + * @param string $to Output currency * * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function convertCurrency(\float $value, \string $from, \string $to) : \float + public static function convertCurrency(float $value, string $from, string $to) : float { $currencies = self::getEcbEuroRates(); $from = strtoupper($from); diff --git a/Utils/Converter/File.php b/Utils/Converter/File.php index 289333f4f..886ea6b8b 100644 --- a/Utils/Converter/File.php +++ b/Utils/Converter/File.php @@ -42,14 +42,14 @@ class File /** * Get file size string. * - * @param \int $bytes Amount of bytes + * @param int $bytes Amount of bytes * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function byteSizeToString(\int $bytes) : \string + public static function byteSizeToString(int $bytes) : string { if ($bytes < 1000) { return $bytes . 'b'; @@ -65,14 +65,14 @@ class File /** * Get file size string. * - * @param \int $kilobytes Amount of kilobytes + * @param int $kilobytes Amount of kilobytes * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function kilobyteSizeToString(\int $kilobytes) : \string + public static function kilobyteSizeToString(int $kilobytes) : string { if ($kilobytes < 1000) { return round($kilobytes, 2) . 'kb'; diff --git a/Utils/Converter/Measurement.php b/Utils/Converter/Measurement.php index 5a5d77597..fc5a641a7 100644 --- a/Utils/Converter/Measurement.php +++ b/Utils/Converter/Measurement.php @@ -32,16 +32,16 @@ class Measurement /** * Convert temperature. * - * @param \float $value Value to convert - * @param \string $from Input temperature - * @param \string $to Output temperature + * @param float $value Value to convert + * @param string $from Input temperature + * @param string $to Output temperature * - * @return \float + * @return float * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function convertTemperature(\float $value, \string $from, \string $to) : \float + public static function convertTemperature(float $value, string $from, string $to) : float { switch ($from) { case TemperatureType::CELSIUS: diff --git a/Utils/Converter/Numeric.php b/Utils/Converter/Numeric.php index ff60cf908..6c478edd4 100644 --- a/Utils/Converter/Numeric.php +++ b/Utils/Converter/Numeric.php @@ -50,16 +50,16 @@ class Numeric /** * Convert base. * - * @param \string $numberInput Input number - * @param \string $fromBaseInput Input layout (e.g. 0123456789ABCDEF) - * @param \string $toBaseInput Output layout (e.g. 0123456789ABCDEF) + * @param string $numberInput Input number + * @param string $fromBaseInput Input layout (e.g. 0123456789ABCDEF) + * @param string $toBaseInput Output layout (e.g. 0123456789ABCDEF) * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function convertBase(\string $numberInput, \string $fromBaseInput, \string $toBaseInput) : \string + public static function convertBase(string $numberInput, string $fromBaseInput, string $toBaseInput) : string { if ($fromBaseInput == $toBaseInput) { return $numberInput; @@ -102,14 +102,14 @@ class Numeric * * Be aware that there is no standard for larger roman numbers. * - * @param \int $arabic Arabic number + * @param int $arabic Arabic number * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function arabicToRoman(\int $arabic) : \string + public static function arabicToRoman(int $arabic) : string { $result = ''; @@ -129,14 +129,14 @@ class Numeric /** * Convert roman to arabic. * - * @param \string $roman Roman number + * @param string $roman Roman number * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function romanToArabic(\string $roman) : \int + public static function romanToArabic(string $roman) : int { $result = 0; @@ -155,14 +155,14 @@ class Numeric * * This can be used for alpha lists such as e.g. word uses. * - * @param \int $number Number to convert + * @param int $number Number to convert * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function numericToAlpha(\int $number) : \string + public static function numericToAlpha(int $number) : string { $alpha = ''; @@ -177,14 +177,14 @@ class Numeric /** * Convert alpha to numeric. * - * @param \string $alpha Alpha to convert + * @param string $alpha Alpha to convert * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function alphaToNumeric(\string $alpha) : \int + public static function alphaToNumeric(string $alpha) : int { $numeric = 0; $length = strlen($alpha); diff --git a/Utils/IO/Csv/CsvDatabaseMapper.php b/Utils/IO/Csv/CsvDatabaseMapper.php index e5b81ba0c..088293fd0 100644 --- a/Utils/IO/Csv/CsvDatabaseMapper.php +++ b/Utils/IO/Csv/CsvDatabaseMapper.php @@ -37,7 +37,7 @@ class CsvDatabaseMapper implements IODatabaseMapper $this->db = $db; } - public function addSource(\string $source) + public function addSource(string $source) { $this->sources[] = $source; @@ -49,12 +49,12 @@ class CsvDatabaseMapper implements IODatabaseMapper $this->sources = $sources; } - public function autoIdentifyCsvSettings(\bool $identify) + public function autoIdentifyCsvSettings(bool $identify) { $this->autoIdentifyCsvSettings = $identify; } - public function setLineBuffer(\int $buffer) + public function setLineBuffer(int $buffer) { $this->lineBuffer = $buffer; } diff --git a/Utils/IO/Csv/CsvInterface.php b/Utils/IO/Csv/CsvInterface.php index 2ad35399d..cc819da19 100644 --- a/Utils/IO/Csv/CsvInterface.php +++ b/Utils/IO/Csv/CsvInterface.php @@ -35,7 +35,7 @@ namespace phpOMS\Utils\IO\Csv { /** * Export Csv. * - * @param \string $path Path to export + * @param string $path Path to export * * @since 1.0.0 * @author Dennis Eichhorn @@ -45,7 +45,7 @@ namespace phpOMS\Utils\IO\Csv { /** * Import Csv. * - * @param \string $path Path to import + * @param string $path Path to import * * @since 1.0.0 * @author Dennis Eichhorn diff --git a/Utils/IO/Csv/CsvSettingsTrait.php b/Utils/IO/Csv/CsvSettingsTrait.php index 521e58389..41654955a 100644 --- a/Utils/IO/Csv/CsvSettingsTrait.php +++ b/Utils/IO/Csv/CsvSettingsTrait.php @@ -24,7 +24,7 @@ namespace phpOMS\Utils\IO\Csv; */ trait CsvSettingsTrait { - private function getFileDelimiter($file, int $checkLines = 2, array $delimiters = [',', '\t', ';', '|', ':']) : \string + private function getFileDelimiter($file, int $checkLines = 2, array $delimiters = [',', '\t', ';', '|', ':']) : string { $results = []; diff --git a/Utils/IO/Excel/ExcelDatabaseMapper.php b/Utils/IO/Excel/ExcelDatabaseMapper.php index 412fbce5a..122645598 100644 --- a/Utils/IO/Excel/ExcelDatabaseMapper.php +++ b/Utils/IO/Excel/ExcelDatabaseMapper.php @@ -22,12 +22,12 @@ class ExcelDatabaseMapper implements IODatabaseMapper private $sources = []; private $lineBuffer = 500; - public function addSource(\string $source) + public function addSource(string $source) { $this->sources[] = $source; } - public function setLineBuffer(\int $buffer) + public function setLineBuffer(int $buffer) { $this->lineBuffer = $buffer; } diff --git a/Utils/IO/Excel/ExcelInterface.php b/Utils/IO/Excel/ExcelInterface.php index 51ba620e8..74e39a6c9 100644 --- a/Utils/IO/Excel/ExcelInterface.php +++ b/Utils/IO/Excel/ExcelInterface.php @@ -32,7 +32,7 @@ interface ExcelInterface /** * Export Excel. * - * @param \string $path Path to export + * @param string $path Path to export * * @return void * @@ -44,7 +44,7 @@ interface ExcelInterface /** * Import Excel. * - * @param \string $path Path to import + * @param string $path Path to import * * @return void * diff --git a/Utils/IO/IODatabaseMapper.php b/Utils/IO/IODatabaseMapper.php index 62119ef3e..7f544b19a 100644 --- a/Utils/IO/IODatabaseMapper.php +++ b/Utils/IO/IODatabaseMapper.php @@ -16,8 +16,8 @@ namespace phpOMS\Utils\IO; interface IODatabaseMapper { - public function addSource(\string $source); + public function addSource(string $source); public function setSources(array $sources); - public function setLineBuffer(\int $buffer); + public function setLineBuffer(int $buffer); public function insert(); } diff --git a/Utils/IO/Json/JsonInterface.php b/Utils/IO/Json/JsonInterface.php index e4b380a03..107caf27c 100644 --- a/Utils/IO/Json/JsonInterface.php +++ b/Utils/IO/Json/JsonInterface.php @@ -32,7 +32,7 @@ interface JsonInterface /** * Export Json. * - * @param \string $path Path to export + * @param string $path Path to export * * @return void * @@ -44,7 +44,7 @@ interface JsonInterface /** * Import Json. * - * @param \string $path Path to import + * @param string $path Path to import * * @return void * diff --git a/Utils/IO/Pdf/PdfInterface.php b/Utils/IO/Pdf/PdfInterface.php index 9c4c3364c..01ffcb8a2 100644 --- a/Utils/IO/Pdf/PdfInterface.php +++ b/Utils/IO/Pdf/PdfInterface.php @@ -32,7 +32,7 @@ interface PdfInterface /** * Export Pdf. * - * @param \string $path Path to export + * @param string $path Path to export * * @return void * diff --git a/Utils/IO/Zip/Zip.php b/Utils/IO/Zip/Zip.php index bc604b41f..4c3cdc482 100644 --- a/Utils/IO/Zip/Zip.php +++ b/Utils/IO/Zip/Zip.php @@ -35,16 +35,16 @@ class Zip /** * Create zip. * - * @param \string[] $sources Files and directories to compress - * @param \string $destination Output destination - * @param \bool $overwrite Overwrite if destination is existing + * @param string[] $sources Files and directories to compress + * @param string $destination Output destination + * @param bool $overwrite Overwrite if destination is existing * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function create(array $sources, \string $destination, \bool $overwrite = true) : \bool + public static function create(array $sources, string $destination, bool $overwrite = true) : bool { $destination = str_replace('\\', '/', realpath($destination)); diff --git a/Utils/JsonBuilder.php b/Utils/JsonBuilder.php index c58ec33e6..7f6a9cb7f 100644 --- a/Utils/JsonBuilder.php +++ b/Utils/JsonBuilder.php @@ -65,16 +65,16 @@ class JsonBuilder /** * Add data. * - * @param \string $path Path used for storage + * @param string $path Path used for storage * @param array $value Data to add - * @param \bool $overwrite Should overwrite existing data + * @param bool $overwrite Should overwrite existing data * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function add(\string $path, array $value, \bool $overwrite = true) + public function add(string $path, array $value, bool $overwrite = true) { $this->json = ArrayUtils::setArray($path, $this->json, $value, '/', $overwrite); } @@ -82,15 +82,15 @@ class JsonBuilder /** * Remove data. * - * @param \string $path Path to the element to delete - * @param \string $delim Delim used inside path + * @param string $path Path to the element to delete + * @param string $delim Delim used inside path * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function remove(\string $path, \string $delim) + public function remove(string $path, string $delim) { $this->json = ArrayUtils::unsetArray($path, $this->json, $delim); } @@ -98,7 +98,7 @@ class JsonBuilder /** * Get json string. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn diff --git a/Utils/MultiMap.php b/Utils/MultiMap.php index ed881623f..4b9f5eed0 100644 --- a/Utils/MultiMap.php +++ b/Utils/MultiMap.php @@ -60,14 +60,14 @@ class MultiMap implements \Countable * * @param array $keys Keys for value * @param mixed $value Value to store - * @param \bool $overwrite Add value if key exists + * @param bool $overwrite Add value if key exists * * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function add(array $keys, $value, \bool $overwrite = true) : \bool + public function add(array $keys, $value, bool $overwrite = true) : bool { $id = count($this->values); $inserted = false; @@ -133,12 +133,12 @@ class MultiMap implements \Countable * @param mixed $key Key used to identify value * @param mixed $value Value to store * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function set($key, $value) : \bool + public function set($key, $value) : bool { if (isset($this->keys[$key])) { $this->values[$this->keys[$key]] = $value; @@ -154,12 +154,12 @@ class MultiMap implements \Countable * * @param mixed $key Key used to identify value * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function remove($key) : \bool + public function remove($key) : bool { if (isset($this->keys[$key])) { $id = $this->keys[$key]; @@ -182,12 +182,12 @@ class MultiMap implements \Countable * @param mixed $old Old key * @param mixed $new New key * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function remap($old, $new) : \bool + public function remap($old, $new) : bool { if (isset($this->keys[$old]) && isset($this->keys[$new])) { $this->keys[$old] = $this->keys[$new]; @@ -207,12 +207,12 @@ class MultiMap implements \Countable * * @param mixed $key Key used to identify value * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function removeKey($key) : \bool + public function removeKey($key) : bool { if (isset($this->keys[$key])) { unset($this->keys[$key]); @@ -281,12 +281,12 @@ class MultiMap implements \Countable /** * Count values. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public function count() : \int + public function count() : int { return count($this->values); } diff --git a/Utils/RnG/DateTime.php b/Utils/RnG/DateTime.php index aebe6b32a..036810327 100644 --- a/Utils/RnG/DateTime.php +++ b/Utils/RnG/DateTime.php @@ -32,8 +32,8 @@ class DateTime /** * Get a random string. * - * @param \string $start Start date - * @param \string $end End date + * @param string $start Start date + * @param string $end End date * * @return \DateTime * diff --git a/Utils/RnG/File.php b/Utils/RnG/File.php index e0a28d779..78c1435b9 100644 --- a/Utils/RnG/File.php +++ b/Utils/RnG/File.php @@ -107,7 +107,7 @@ class File * Get a random file extension. * * @param array $source Source array for possible extensions - * @param DistributionType|\int $distribution Distribution type for the extensions + * @param DistributionType|int $distribution Distribution type for the extensions * * @return false|array * diff --git a/Utils/RnG/Name.php b/Utils/RnG/Name.php index 45e79544b..efd8718e3 100644 --- a/Utils/RnG/Name.php +++ b/Utils/RnG/Name.php @@ -474,10 +474,10 @@ class Name /** * Get a random string. * - * @param \string[] $type Name type (female, male, family) - * @param \string $origin Name origin (western) + * @param string[] $type Name type (female, male, family) + * @param string $origin Name origin (western) * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn diff --git a/Utils/RnG/Phone.php b/Utils/RnG/Phone.php index ea2438117..1111efd37 100644 --- a/Utils/RnG/Phone.php +++ b/Utils/RnG/Phone.php @@ -34,7 +34,7 @@ class Phone /** * Get a random phone number. * - * @param \bool $isInt This number uses a country code + * @param bool $isInt This number uses a country code * @param array $layout Number layout * @param array $countries Country codes * diff --git a/Utils/RnG/StringUtils.php b/Utils/RnG/StringUtils.php index e3e67d3db..0f5508c68 100644 --- a/Utils/RnG/StringUtils.php +++ b/Utils/RnG/StringUtils.php @@ -32,16 +32,16 @@ class StringUtils /** * Get a random string. * - * @param \int $min Min. length - * @param \int $max Max. length - * @param \string $charset Allowed characters + * @param int $min Min. length + * @param int $max Max. length + * @param string $charset Allowed characters * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function generateString(\int $min = 10, \int $max = 10, \string $charset = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') : \string + public static function generateString(int $min = 10, int $max = 10, string $charset = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') : string { $length = mt_rand($min, $max); $charactersLength = strlen($charset); diff --git a/Utils/RnG/Text.php b/Utils/RnG/Text.php index 8e1a75860..1fb15eb99 100644 --- a/Utils/RnG/Text.php +++ b/Utils/RnG/Text.php @@ -32,7 +32,7 @@ class Text /** * Vocabulary. * - * @var \string[] + * @var string[] * @since 1.0.0 */ public static $words_west = ['lorem', @@ -217,7 +217,7 @@ class Text /** * Text has random formatting. * - * @var \bool + * @var bool * @since 1.0.0 */ private $hasFormatting = false; @@ -225,7 +225,7 @@ class Text /** * Text has paragraphs. * - * @var \bool + * @var bool * @since 1.0.0 */ private $hasParagraphs = false; @@ -233,7 +233,7 @@ class Text /** * Amount of sentences of the last generated text. * - * @var \int + * @var int * @since 1.0.0 */ private $sentences = 0; @@ -241,7 +241,7 @@ class Text /** * Set if the text should have formatting. * - * @param \bool $hasFormatting + * @param bool $hasFormatting * * @return void * @@ -256,7 +256,7 @@ class Text /** * Set if the text should have paragraphs. * - * @param \bool $hasParagraphs + * @param bool $hasParagraphs * * @return void * @@ -271,7 +271,7 @@ class Text /** * Amount of sentences of the last generated text. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn @@ -284,10 +284,10 @@ class Text /** * Get a random string. * - * @param \int $length Text length - * @param \int $words Vocabulary + * @param int $length Text length + * @param int $words Vocabulary * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn @@ -372,9 +372,9 @@ class Text /** * Generate punctuation. * - * @param \int $length Text length + * @param int $length Text length * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn @@ -439,9 +439,9 @@ class Text /** * Generate paragraphs. * - * @param \int $length Amount of sentences + * @param int $length Amount of sentences * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn @@ -470,9 +470,9 @@ class Text /** * Generate random formatting. * - * @param \int $length Amount of words + * @param int $length Amount of words * - * @return \string[] + * @return string[] * * @since 1.0.0 * @author Dennis Eichhorn diff --git a/Utils/StringUtils.php b/Utils/StringUtils.php index a53429a40..304d8f317 100644 --- a/Utils/StringUtils.php +++ b/Utils/StringUtils.php @@ -42,15 +42,15 @@ class StringUtils /** * String ends with? * - * @param \string $haystack Haystack - * @param \string $needle Needle + * @param string $haystack Haystack + * @param string $needle Needle * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function endsWith(\string $haystack, \string $needle) : \bool + public static function endsWith(string $haystack, string $needle) : bool { return $needle === '' || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false); } @@ -58,15 +58,15 @@ class StringUtils /** * String starts with? * - * @param \string $haystack Haystack - * @param \string $needle Needle + * @param string $haystack Haystack + * @param string $needle Needle * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function startsWith(\string $haystack, \string $needle) : \bool + public static function startsWith(string $haystack, string $needle) : bool { return $needle === '' || strrpos($haystack, $needle, -strlen($haystack)) !== false; } @@ -74,15 +74,15 @@ class StringUtils /** * String starts with? * - * @param \string $haystack Haystack - * @param \string $needle Needle + * @param string $haystack Haystack + * @param string $needle Needle * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function mb_startsWith(\string $haystack, \string $needle) : \bool + public static function mb_startsWith(string $haystack, string $needle) : bool { return $needle === '' || mb_strrpos($haystack, $needle, -mb_strlen($haystack)) !== false; } @@ -90,15 +90,15 @@ class StringUtils /** * String ends with? * - * @param \string $haystack Haystack - * @param \string $needle Needle + * @param string $haystack Haystack + * @param string $needle Needle * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function mb_endsWith(\string $haystack, \string $needle) : \bool + public static function mb_endsWith(string $haystack, string $needle) : bool { return $needle === '' || (($temp = mb_strlen($haystack) - mb_strlen($needle)) >= 0 && mb_strpos($haystack, $needle, $temp) !== false); } @@ -106,14 +106,14 @@ class StringUtils /** * Uppercase first letter. * - * @param \string $string String to manipulate + * @param string $string String to manipulate * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function mb_ucfirst(\string $string) : \string + public static function mb_ucfirst(string $string) : string { $strlen = mb_strlen($string); $firstChar = mb_substr($string, 0, 1); @@ -125,14 +125,14 @@ class StringUtils /** * Lowercase first letter. * - * @param \string $string String to manipulate + * @param string $string String to manipulate * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function mb_lcfirst(\string $string) : \string + public static function mb_lcfirst(string $string) : string { $strlen = mb_strlen($string); $firstChar = mb_substr($string, 0, 1); @@ -144,15 +144,15 @@ class StringUtils /** * Trim string. * - * @param \string $string String to manipulate - * @param \string $charlist String to trim + * @param string $string String to manipulate + * @param string $charlist String to trim * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function mb_trim(\string $string, \string $charlist = ' ') : \string + public static function mb_trim(string $string, string $charlist = ' ') : string { if (is_null($charlist)) { return trim($string); @@ -166,15 +166,15 @@ class StringUtils /** * Trim right part of string. * - * @param \string $string String to manipulate - * @param \string $charlist String to trim + * @param string $string String to manipulate + * @param string $charlist String to trim * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function mb_rtrim(\string $string, \string $charlist = ' ') : \string + public static function mb_rtrim(string $string, string $charlist = ' ') : string { if ($charlist === ' ') { return rtrim($string); @@ -188,15 +188,15 @@ class StringUtils /** * Trim left part of string. * - * @param \string $string String to manipulate - * @param \string $charlist String to trim + * @param string $string String to manipulate + * @param string $charlist String to trim * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function mb_ltrim(\string $string, \string $charlist = ' ') : \string + public static function mb_ltrim(string $string, string $charlist = ' ') : string { if ($charlist === ' ') { return ltrim($string); diff --git a/Utils/SystemUtils.php b/Utils/SystemUtils.php index 4d78be74e..96812225d 100644 --- a/Utils/SystemUtils.php +++ b/Utils/SystemUtils.php @@ -44,14 +44,14 @@ class SystemUtils * * This can become rather slow for large structures. * - * @param \string $dir Root dir to inspect + * @param string $dir Root dir to inspect * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getFolderSize(\string $dir) : \int + public static function getFolderSize(string $dir) : int { $countSize = 0; $count = 0; @@ -77,12 +77,12 @@ class SystemUtils /** * Get system RAM. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getRAM() : \int + public static function getRAM() : int { $mem = null; @@ -109,12 +109,12 @@ class SystemUtils /** * Get RAM usage. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getRAMUsage() : \int + public static function getRAMUsage() : int { $memusage = 0; @@ -136,12 +136,12 @@ class SystemUtils /** * Get cpu usage. * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function getCpuUsage() : \int + public static function getCpuUsage() : int { $cpuusage = 0; diff --git a/Utils/TaskSchedule/Cron.php b/Utils/TaskSchedule/Cron.php index 56a2fc12b..11bce8655 100644 --- a/Utils/TaskSchedule/Cron.php +++ b/Utils/TaskSchedule/Cron.php @@ -42,7 +42,7 @@ class Cron implements ScheduleInterface // TODO: Implement remove() method. } - public function get(\string $id) + public function get(string $id) { // TODO: Implement get() method. } diff --git a/Utils/TaskSchedule/CronJob.php b/Utils/TaskSchedule/CronJob.php index 9a38f1445..ba621f634 100644 --- a/Utils/TaskSchedule/CronJob.php +++ b/Utils/TaskSchedule/CronJob.php @@ -38,7 +38,7 @@ class CronJob implements TaskInterface private $interval = null; private $command = ''; - public function __construct(\string $cronjob) + public function __construct(string $cronjob) { } @@ -48,7 +48,7 @@ class CronJob implements TaskInterface $this->interval = $interval; } - public function setCommand(\string $command) + public function setCommand(string $command) { $this->command = $command; } @@ -64,7 +64,7 @@ class CronJob implements TaskInterface return $minute . ' ' . $hour . ' ' . $dayOfMonth . ' ' . $month . ' ' . $dayOfWeek . ' ' . $this->command; } - private function printValue(array $value) : \string + private function printValue(array $value) : string { if (($count = count($value['dayOfWeek'])) > 0) { $parsed = implode(',', $value['dayOfWeek']); diff --git a/Utils/TaskSchedule/Interval.php b/Utils/TaskSchedule/Interval.php index 9b1edd94d..596554623 100644 --- a/Utils/TaskSchedule/Interval.php +++ b/Utils/TaskSchedule/Interval.php @@ -80,12 +80,12 @@ class Interval /** * Constructor. * - * @param \string $interval Interval to parse + * @param string $interval Interval to parse * * @since 1.0.0 * @author Dennis Eichhorn */ - public function __construct(\string $interval = null) + public function __construct(string $interval = null) { if (isset($interval)) { $this->parse($interval); @@ -95,12 +95,12 @@ class Interval /** * Parse interval. * - * @param \string $interval Interval to parse + * @param string $interval Interval to parse * * @since 1.0.0 * @author Dennis Eichhorn */ - private function parse(\string $interval) + private function parse(string $interval) { $elements = explode(' ', $interval); } @@ -108,14 +108,14 @@ class Interval /** * Parse element. * - * @param \string $minute Minute + * @param string $minute Minute * * @return array * * @since 1.0.0 * @author Dennis Eichhorn */ - private function parseMinute(\string $minute) : array + private function parseMinute(string $minute) : array { } @@ -123,14 +123,14 @@ class Interval /** * Parse element. * - * @param \string $hour Hour + * @param string $hour Hour * * @return array * * @since 1.0.0 * @author Dennis Eichhorn */ - private function parseHour(\string $hour) : array + private function parseHour(string $hour) : array { } @@ -138,14 +138,14 @@ class Interval /** * Parse element. * - * @param \string $dayOfMonth Day of month + * @param string $dayOfMonth Day of month * * @return array * * @since 1.0.0 * @author Dennis Eichhorn */ - private function parseDayOfMonth(\string $dayOfMonth) : array + private function parseDayOfMonth(string $dayOfMonth) : array { } @@ -153,14 +153,14 @@ class Interval /** * Parse element. * - * @param \string $month Month + * @param string $month Month * * @return array * * @since 1.0.0 * @author Dennis Eichhorn */ - private function parseMonth(\string $month) : array + private function parseMonth(string $month) : array { } @@ -168,14 +168,14 @@ class Interval /** * Parse element. * - * @param \string $dayOfWeek Day of week + * @param string $dayOfWeek Day of week * * @return array * * @since 1.0.0 * @author Dennis Eichhorn */ - private function parseDayOfWeek(\string $dayOfWeek) : array + private function parseDayOfWeek(string $dayOfWeek) : array { } @@ -183,14 +183,14 @@ class Interval /** * Parse element. * - * @param \string $year Year + * @param string $year Year * * @return array * * @since 1.0.0 * @author Dennis Eichhorn */ - private function parseYear(\string $year) : array + private function parseYear(string $year) : array { } @@ -199,9 +199,9 @@ class Interval * Set mintue. * * @param array $minute Minute - * @param \int $start Start/first - * @param \int $end End/last - * @param \int $step Step + * @param int $start Start/first + * @param int $end End/last + * @param int $step Step * @param bool $any Any * * @throws @@ -209,7 +209,7 @@ class Interval * @since 1.0.0 * @author Dennis Eichhorn */ - public function setMinute(array $minute, \int $start = 0, \int $end = 0, \int $step = 0, \bool $any = false) + public function setMinute(array $minute, int $start = 0, int $end = 0, int $step = 0, bool $any = false) { if ($this->validateMinute($arr = [ 'minutes' => $minute, @@ -229,9 +229,9 @@ class Interval * Set hour. * * @param array $hour Hour - * @param \int $start Start/first - * @param \int $end End/last - * @param \int $step Step + * @param int $start Start/first + * @param int $end End/last + * @param int $step Step * @param bool $any Any * * @throws @@ -239,7 +239,7 @@ class Interval * @since 1.0.0 * @author Dennis Eichhorn */ - public function setHour(array $hour, \int $start = 0, \int $end = 0, \int $step = 0, \bool $any = false) + public function setHour(array $hour, int $start = 0, int $end = 0, int $step = 0, bool $any = false) { if ($this->validateHour($arr = [ 'hours' => $hour, @@ -259,19 +259,19 @@ class Interval * Set day of month. * * @param array $dayOfMonth Day of month - * @param \int $start Start/first - * @param \int $end End/last - * @param \int $step Step + * @param int $start Start/first + * @param int $end End/last + * @param int $step Step * @param bool $any Any * @param bool $last Last - * @param \int $nearest Nearest day + * @param int $nearest Nearest day * * @throws * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setDayOfMonth(array $dayOfMonth, \int $start = 0, \int $end = 0, \int $step = 0, \bool $any = false, \bool $last = false, \int $nearest = 0) + public function setDayOfMonth(array $dayOfMonth, int $start = 0, int $end = 0, int $step = 0, bool $any = false, bool $last = false, int $nearest = 0) { if ($this->validateDayOfMonth($arr = [ 'dayOfMonth' => $dayOfMonth, @@ -293,9 +293,9 @@ class Interval * Set month. * * @param array $month Month - * @param \int $start Start/first - * @param \int $end End/last - * @param \int $step Step + * @param int $start Start/first + * @param int $end End/last + * @param int $step Step * @param bool $any Any * * @throws @@ -303,7 +303,7 @@ class Interval * @since 1.0.0 * @author Dennis Eichhorn */ - public function setMonth(array $month, \int $start = 0, \int $end = 0, \int $step = 0, \bool $any = false) + public function setMonth(array $month, int $start = 0, int $end = 0, int $step = 0, bool $any = false) { if ($this->validateMonth($arr = [ 'month' => $month, @@ -323,9 +323,9 @@ class Interval * Set day of week. * * @param array $dayOfWeek Day of week - * @param \int $start Start/first - * @param \int $end End/last - * @param \int $step Step + * @param int $start Start/first + * @param int $end End/last + * @param int $step Step * @param bool $any Any * @param bool $last Last * @@ -334,7 +334,7 @@ class Interval * @since 1.0.0 * @author Dennis Eichhorn */ - public function setDayOfWeek(array $dayOfWeek, \int $start = 0, \int $end = 0, \int $step = 0, \bool $any = false, \bool $last = false) + public function setDayOfWeek(array $dayOfWeek, int $start = 0, int $end = 0, int $step = 0, bool $any = false, bool $last = false) { if ($this->validateDayOfWeek($arr = [ 'dayOfWeek' => $dayOfWeek, @@ -355,9 +355,9 @@ class Interval * Set yaer. * * @param array $year Year - * @param \int $start Start/first - * @param \int $end End/last - * @param \int $step Step + * @param int $start Start/first + * @param int $end End/last + * @param int $step Step * @param bool $any Any * * @throws @@ -365,7 +365,7 @@ class Interval * @since 1.0.0 * @author Dennis Eichhorn */ - public function setYear(array $year, \int $start = 0, \int $end = 0, \int $step = 0, \bool $any = false) + public function setYear(array $year, int $start = 0, int $end = 0, int $step = 0, bool $any = false) { if ($this->validateYear($arr = [ 'year' => $year, @@ -464,12 +464,12 @@ class Interval * * @param array $array Element to validate * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - private function validateMinute(array $array) : \bool + private function validateMinute(array $array) : bool { foreach ($array['minutes'] as $minute) { if ($minute > 59 || $minute < 0) return false; @@ -487,12 +487,12 @@ class Interval * * @param array $array Element to validate * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - private function validateHour(array $array) : \bool + private function validateHour(array $array) : bool { foreach ($array['hours'] as $hour) { if ($hour > 23 || $hour < 0) return false; @@ -510,12 +510,12 @@ class Interval * * @param array $array Element to validate * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - private function validateDayOfMonth(array $array) : \bool + private function validateDayOfMonth(array $array) : bool { foreach ($array['dayOfMonth'] as $dayOfMonth) { if ($dayOfMonth > 31 || $dayOfMonth < 1) return false; @@ -534,12 +534,12 @@ class Interval * * @param array $array Element to validate * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - private function validateMonth(array $array) : \bool + private function validateMonth(array $array) : bool { foreach ($array['month'] as $month) { if ($month > 12 || $month < 1) return false; @@ -557,12 +557,12 @@ class Interval * * @param array $array Element to validate * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - private function validateDayOfWeek(array $array) : \bool + private function validateDayOfWeek(array $array) : bool { foreach ($array['dayOfWeek'] as $dayOfWeek) { if ($dayOfWeek > 7 || $dayOfWeek < 1) return false; @@ -580,12 +580,12 @@ class Interval * * @param array $array Element to validate * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - private function validateYear(array $array) : \bool + private function validateYear(array $array) : bool { return true; } @@ -598,7 +598,7 @@ class Interval * @since 1.0.0 * @author Dennis Eichhorn */ - public function __toString() : \string + public function __toString() : string { /* Parsing minutes */ if (($count = count($this->minute['minutes'])) > 0) { diff --git a/Utils/TaskSchedule/Schedule.php b/Utils/TaskSchedule/Schedule.php index c9252ecdc..7df7c3f9b 100644 --- a/Utils/TaskSchedule/Schedule.php +++ b/Utils/TaskSchedule/Schedule.php @@ -38,7 +38,7 @@ class Schedule implements TaskInterface private $interval = null; private $command = ''; - public function __construct(\string $cronjob) + public function __construct(string $cronjob) { } @@ -48,7 +48,7 @@ class Schedule implements TaskInterface $this->interval = $interval; } - public function setCommand(\string $command) + public function setCommand(string $command) { $this->command = $command; } diff --git a/Utils/TaskSchedule/ScheduleInterface.php b/Utils/TaskSchedule/ScheduleInterface.php index 69960ff53..3cbaba75c 100644 --- a/Utils/TaskSchedule/ScheduleInterface.php +++ b/Utils/TaskSchedule/ScheduleInterface.php @@ -32,7 +32,7 @@ interface ScheduleInterface public function remove($id); - public function get(\string $id); + public function get(string $id); public function list(); diff --git a/Utils/TaskSchedule/TaskInterface.php b/Utils/TaskSchedule/TaskInterface.php index efffd4dc4..c0869380f 100644 --- a/Utils/TaskSchedule/TaskInterface.php +++ b/Utils/TaskSchedule/TaskInterface.php @@ -29,5 +29,5 @@ namespace phpOMS\Utils\TaskSchedule; interface TaskInterface { public function setInterval(Interval $interval); - public function setCommand(\string $command); + public function setCommand(string $command); } diff --git a/Utils/TaskSchedule/TaskScheduler.php b/Utils/TaskSchedule/TaskScheduler.php index 9bae4f00e..3dc18fb81 100644 --- a/Utils/TaskSchedule/TaskScheduler.php +++ b/Utils/TaskSchedule/TaskScheduler.php @@ -42,7 +42,7 @@ class TaskScheduler implements ScheduleInterface // TODO: Implement remove() method. } - public function get(\string $id) + public function get(string $id) { // TODO: Implement get() method. } diff --git a/Validation/Base/Email.php b/Validation/Base/Email.php index 9e352b2c7..c9d5ceb45 100644 --- a/Validation/Base/Email.php +++ b/Validation/Base/Email.php @@ -44,7 +44,7 @@ class Email extends ValidatorAbstract /** * {@inheritdoc} */ - public static function isValid(\string $value) : \bool + public static function isValid(string $value) : bool { if (filter_var($value, FILTER_VALIDATE_EMAIL) === false) { self::$msg = 'Invalid Email by filter_var standards'; diff --git a/Validation/ModelValidationTrait.php b/Validation/ModelValidationTrait.php index 8095ce52c..64f76aa05 100644 --- a/Validation/ModelValidationTrait.php +++ b/Validation/ModelValidationTrait.php @@ -32,7 +32,7 @@ trait ModelValidationTrait * Set variable without validating it. * * @param mixed $var Variable to set - * @param \string $name Name of the variable + * @param string $name Name of the variable * * @throws \Exception * @@ -54,9 +54,9 @@ trait ModelValidationTrait * Validate member variable. * * @param mixed $var Variable to validate - * @param \string $name Name of the variable + * @param string $name Name of the variable * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn @@ -77,9 +77,9 @@ trait ModelValidationTrait * Set validated member variable. * * @param mixed $var Variable to validate - * @param \string $name Name of the variable + * @param string $name Name of the variable * - * @return \bool + * @return bool * * @throws * diff --git a/Validation/Validator.php b/Validation/Validator.php index c253d04ff..721b2751e 100644 --- a/Validation/Validator.php +++ b/Validation/Validator.php @@ -31,7 +31,7 @@ final class Validator extends ValidatorAbstract * @param mixed $var Variable to validate * @param array $constraints Constraints for validation * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn @@ -53,10 +53,10 @@ final class Validator extends ValidatorAbstract /** * String ends with ? * - * @param \string $haystack String to search in - * @param \string $needle String to search for + * @param string $haystack String to search in + * @param string $needle String to search for * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn @@ -70,9 +70,9 @@ final class Validator extends ValidatorAbstract * Validate variable by type. * * @param mixed $var Variable to validate - * @param \string[] $constraint Array of allowed types + * @param string[] $constraint Array of allowed types * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn @@ -91,11 +91,11 @@ final class Validator extends ValidatorAbstract /** * Validate variable by length. * - * @param \string $var Variable to validate - * @param \int|\float $min Min. length - * @param \int|\float $max Max. length + * @param string $var Variable to validate + * @param int|float $min Min. length + * @param int|float $max Max. length * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn @@ -114,10 +114,10 @@ final class Validator extends ValidatorAbstract /** * Validate variable by substring. * - * @param \string $var Variable to validate - * @param \string $substr Substring + * @param string $var Variable to validate + * @param string $substr Substring * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn @@ -130,10 +130,10 @@ final class Validator extends ValidatorAbstract /** * Validate variable by pattern. * - * @param \string $var Variable to validate - * @param \string $pattern Pattern for validation + * @param string $var Variable to validate + * @param string $pattern Pattern for validation * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn @@ -146,11 +146,11 @@ final class Validator extends ValidatorAbstract /** * Validate variable by interval. * - * @param \int|\float $var Variable to validate - * @param \int|\float $min Min. value - * @param \int|\float $max Max. value + * @param int|float $var Variable to validate + * @param int|float $min Min. value + * @param int|float $max Max. value * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn @@ -167,10 +167,10 @@ final class Validator extends ValidatorAbstract /** * String starts with ? * - * @param \string $haystack String to search in - * @param \string $needle String to search for + * @param string $haystack String to search in + * @param string $needle String to search for * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn diff --git a/Validation/ValidatorAbstract.php b/Validation/ValidatorAbstract.php index 2db524218..4bee38dde 100644 --- a/Validation/ValidatorAbstract.php +++ b/Validation/ValidatorAbstract.php @@ -32,7 +32,7 @@ abstract class ValidatorAbstract /** * Error code. * - * @var \int + * @var int * @since 1.0.0 */ protected static $error = 0; @@ -40,7 +40,7 @@ abstract class ValidatorAbstract /** * Message string. * - * @var \string + * @var string * @since 1.0.0 */ protected static $msg = ''; diff --git a/Validation/ValidatorInterface.php b/Validation/ValidatorInterface.php index eb77a9937..29c2157d4 100644 --- a/Validation/ValidatorInterface.php +++ b/Validation/ValidatorInterface.php @@ -34,7 +34,7 @@ interface ValidatorInterface * * @param mixed $value Value to validate * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn @@ -44,7 +44,7 @@ interface ValidatorInterface /** * Get most recent error string. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn diff --git a/Version/Version.php b/Version/Version.php index 9390a06bb..fa07fff37 100644 --- a/Version/Version.php +++ b/Version/Version.php @@ -46,15 +46,15 @@ class Version /** * Comparing two versions. * - * @param \string $ver1 Version - * @param \string $ver2 Version + * @param string $ver1 Version + * @param string $ver2 Version * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - public static function compare(\string $ver1, \string $ver2) : \int + public static function compare(string $ver1, string $ver2) : int { return version_compare($ver1, $ver2); } diff --git a/Views/View.php b/Views/View.php index 8f31a2e3f..a6aa11028 100644 --- a/Views/View.php +++ b/Views/View.php @@ -40,7 +40,7 @@ class View implements RenderableInterface /** * Template. * - * @var \string + * @var string * @since 1.0.0 */ protected $template = null; @@ -118,12 +118,12 @@ class View implements RenderableInterface * @param array $a Array 1 * @param array $b Array 2 * - * @return \int + * @return int * * @since 1.0.0 * @author Dennis Eichhorn */ - private static function viewSort(array $a, array $b) : \int + private static function viewSort(array $a, array $b) : int { if ($a['order'] === $b['order']) { return 0; @@ -135,12 +135,12 @@ class View implements RenderableInterface /** * Get the template. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getTemplate() : \string + public function getTemplate() : string { return $this->template; } @@ -148,14 +148,14 @@ class View implements RenderableInterface /** * Set the template. * - * @param \string $template + * @param string $template * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function setTemplate(\string $template) + public function setTemplate(string $template) { $this->template = $template; } @@ -172,7 +172,7 @@ class View implements RenderableInterface } /** - * @param \string $id View ID + * @param string $id View ID * * @return false|View * @@ -191,14 +191,14 @@ class View implements RenderableInterface /** * Remove view. * - * @param \string $id View ID + * @param string $id View ID * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function removeView(\string $id) : \bool + public function removeView(string $id) : bool { if (isset($this->views[$id])) { unset($this->views[$id]); @@ -212,16 +212,16 @@ class View implements RenderableInterface /** * Edit view. * - * @param \string $id View ID + * @param string $id View ID * @param View $view - * @param null|\int $order Order of view + * @param null|int $order Order of view * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function editView(\string $id, View $view, $order = null) + public function editView(string $id, View $view, $order = null) { $this->addView($id, $view, $order, true); } @@ -229,17 +229,17 @@ class View implements RenderableInterface /** * Add view. * - * @param \string $id View ID + * @param string $id View ID * @param View $view - * @param null|\int $order Order of view - * @param \bool $overwrite Overwrite existing view + * @param null|int $order Order of view + * @param bool $overwrite Overwrite existing view * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ - public function addView(\string $id, View $view, $order = null, \bool $overwrite = true) + public function addView(string $id, View $view, $order = null, bool $overwrite = true) { if ($overwrite || !isset($this->views[$id])) { $this->views[$id] = $view; @@ -253,12 +253,12 @@ class View implements RenderableInterface /** * Get view/template response of all views. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function renderAll() : \string + public function renderAll() : string { ob_start(); @@ -272,12 +272,12 @@ class View implements RenderableInterface /** * Get view/template response. * - * @return \string + * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ - public function render() : \string + public function render() : string { $this->l11n->setLang($this->app->l11nManager->getLanguage($this->response->getL11n()->getLanguage())); $path = realpath($oldPath = __DIR__ . '/../..' . $this->template . '.tpl.php'); @@ -294,7 +294,7 @@ class View implements RenderableInterface } /** - * @param \string $id Data Id + * @param string $id Data Id * * @return mixed * @@ -307,7 +307,7 @@ class View implements RenderableInterface } /** - * @param \string $id Data ID + * @param string $id Data ID * @param mixed $data Data * * @return void @@ -315,7 +315,7 @@ class View implements RenderableInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function setData(\string $id, $data) + public function setData(string $id, $data) { $this->data[$id] = $data; } @@ -323,14 +323,14 @@ class View implements RenderableInterface /** * Remove view. * - * @param \string $id Data Id + * @param string $id Data Id * - * @return \bool + * @return bool * * @since 1.0.0 * @author Dennis Eichhorn */ - public function removeData(\string $id) : \bool + public function removeData(string $id) : bool { if (isset($this->data[$id])) { unset($this->data[$id]); @@ -342,7 +342,7 @@ class View implements RenderableInterface } /** - * @param \string $id Data ID + * @param string $id Data ID * @param mixed $data Data * * @return void @@ -350,7 +350,7 @@ class View implements RenderableInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function addData(\string $id, $data) + public function addData(string $id, $data) { $this->data[$id] = $data; }