Remove namespace from scalar

This commit is contained in:
Dennis Eichhorn 2016-01-23 10:17:34 +01:00
parent 7238e2cff1
commit 97687422eb
161 changed files with 1911 additions and 1911 deletions

View File

@ -36,7 +36,7 @@ class Account
/** /**
* Id. * Id.
* *
* @var \int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
protected $id = 0; protected $id = 0;
@ -44,7 +44,7 @@ class Account
/** /**
* Names. * Names.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $name1 = ''; protected $name1 = '';
@ -52,7 +52,7 @@ class Account
/** /**
* Names. * Names.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $name2 = ''; protected $name2 = '';
@ -60,7 +60,7 @@ class Account
/** /**
* Names. * Names.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $name3 = ''; protected $name3 = '';
@ -68,7 +68,7 @@ class Account
/** /**
* Email. * Email.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $email = ''; protected $email = '';
@ -78,7 +78,7 @@ class Account
* *
* Used in order to make sure ips don't change * Used in order to make sure ips don't change
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $origin = ''; protected $origin = '';
@ -86,7 +86,7 @@ class Account
/** /**
* Login. * Login.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $login = ''; protected $login = '';
@ -118,7 +118,7 @@ class Account
/** /**
* Groups. * Groups.
* *
* @var \int[] * @var int[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected $groups = []; protected $groups = [];
@ -160,12 +160,12 @@ class Account
/** /**
* Get account id. * Get account id.
* *
* @return \int Account id * @return int Account id
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getId() : \int public function getId() : int
{ {
return $this->id; return $this->id;
} }
@ -201,12 +201,12 @@ class Account
/** /**
* Get name1. * Get name1.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getName1() : \string public function getName1() : string
{ {
return $this->name1; return $this->name1;
} }
@ -214,12 +214,12 @@ class Account
/** /**
* Get name2. * Get name2.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getName2() : \string public function getName2() : string
{ {
return $this->name2; return $this->name2;
} }
@ -227,12 +227,12 @@ class Account
/** /**
* Get name3. * Get name3.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getName3() : \string public function getName3() : string
{ {
return $this->name3; return $this->name3;
} }
@ -240,12 +240,12 @@ class Account
/** /**
* Get email. * Get email.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getEmail() : \string public function getEmail() : string
{ {
return $this->email; return $this->email;
} }
@ -255,12 +255,12 @@ class Account
* *
* AccountStatus * AccountStatus
* *
* @return \int * @return int
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getStatus() : \int public function getStatus() : int
{ {
return $this->status; return $this->status;
} }
@ -270,12 +270,12 @@ class Account
* *
* AccountType * AccountType
* *
* @return \int * @return int
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getType() : \int public function getType() : int
{ {
return $this->type; return $this->type;
} }
@ -309,14 +309,14 @@ class Account
/** /**
* Set name1. * Set name1.
* *
* @param \string $name Name * @param string $name Name
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setName1(\string $name) public function setName1(string $name)
{ {
$this->name1 = $name; $this->name1 = $name;
} }
@ -324,14 +324,14 @@ class Account
/** /**
* Set name2. * Set name2.
* *
* @param \string $name Name * @param string $name Name
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setName2(\string $name) public function setName2(string $name)
{ {
$this->name2 = $name; $this->name2 = $name;
} }
@ -339,14 +339,14 @@ class Account
/** /**
* Set name3. * Set name3.
* *
* @param \string $name Name * @param string $name Name
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setName3(\string $name) public function setName3(string $name)
{ {
$this->name3 = $name; $this->name3 = $name;
} }
@ -354,14 +354,14 @@ class Account
/** /**
* Set email. * Set email.
* *
* @param \string $email Email * @param string $email Email
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setEmail(\string $email) public function setEmail(string $email)
{ {
if(!Email::isValid($email)) { if(!Email::isValid($email)) {
throw new \InvalidArgumentException(); throw new \InvalidArgumentException();
@ -373,14 +373,14 @@ class Account
/** /**
* Get status. * Get status.
* *
* @param \int $status Status * @param int $status Status
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setStatus(\int $status) public function setStatus(int $status)
{ {
if(!AccountStatus::isValidValue($status)) { if(!AccountStatus::isValidValue($status)) {
throw new \InvalidArgumentException(); throw new \InvalidArgumentException();
@ -392,14 +392,14 @@ class Account
/** /**
* Get type. * Get type.
* *
* @param \int $type Type * @param int $type Type
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setType(\int $type) public function setType(int $type)
{ {
if(!AccountType::isValidValue($type)) { if(!AccountType::isValidValue($type)) {
throw new \InvalidArgumentException(); throw new \InvalidArgumentException();

View File

@ -50,14 +50,14 @@ class AccountManager
/** /**
* Get account. * Get account.
* *
* @param \int $id Account id * @param int $id Account id
* *
* @return Account * @return Account
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function get(\int $id) : Account public function get(int $id) : Account
{ {
return $this->accounts[$id] ?? new NullAccount(); return $this->accounts[$id] ?? new NullAccount();
} }
@ -67,7 +67,7 @@ class AccountManager
* *
* @param Account $account Account * @param Account $account Account
* *
* @return \int Account id * @return int Account id
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>

View File

@ -32,7 +32,7 @@ class Group
/** /**
* Account id. * Account id.
* *
* @var \int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
protected $id = 0; protected $id = 0;
@ -40,7 +40,7 @@ class Group
/** /**
* Account name. * Account name.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $name = ''; protected $name = '';
@ -48,7 +48,7 @@ class Group
/** /**
* Account name. * Account name.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $description = ''; protected $description = '';
@ -56,7 +56,7 @@ class Group
/** /**
* Account name. * Account name.
* *
* @var \int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
protected $members = []; protected $members = [];
@ -64,7 +64,7 @@ class Group
/** /**
* Parents . * Parents .
* *
* @var \int[] * @var int[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected $parents = []; protected $parents = [];
@ -72,7 +72,7 @@ class Group
/** /**
* Permissions. * Permissions.
* *
* @var \int[] * @var int[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected $permissions = []; protected $permissions = [];
@ -90,12 +90,12 @@ class Group
/** /**
* Get group id. * Get group id.
* *
* @return \int * @return int
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getId() : \int public function getId() : int
{ {
return $this->id; return $this->id;
} }
@ -103,12 +103,12 @@ class Group
/** /**
* Get group name. * Get group name.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getName() : \string public function getName() : string
{ {
return $this->name; return $this->name;
} }
@ -116,12 +116,12 @@ class Group
/** /**
* Get group description. * Get group description.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getDescription() : \string public function getDescription() : string
{ {
return $this->description; return $this->description;
} }
@ -129,12 +129,12 @@ class Group
/** /**
* Set group name. * Set group name.
* *
* @param \string $name Group name * @param string $name Group name
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setName(\string $name) public function setName(string $name)
{ {
$this->name = $name; $this->name = $name;
} }
@ -142,12 +142,12 @@ class Group
/** /**
* Set group description. * Set group description.
* *
* @param \string $description Group description * @param string $description Group description
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setDescription(\string $description) public function setDescription(string $description)
{ {
$this->description = $description; $this->description = $description;
} }

View File

@ -52,16 +52,16 @@ class AssetManager implements \Countable
/** /**
* Add asset. * Add asset.
* *
* @param \string $id Asset id * @param string $id Asset id
* @param \string $asset Asset * @param string $asset Asset
* @param \bool $overwrite Overwrite * @param bool $overwrite Overwrite
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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])) { if ($overwrite || !isset($this->assets[$id])) {
$this->assets[$id] = $asset; $this->assets[$id] = $asset;
@ -75,14 +75,14 @@ class AssetManager implements \Countable
/** /**
* Remove asset. * Remove asset.
* *
* @param \string $id Asset id * @param string $id Asset id
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function remove(\string $id) : \bool public function remove(string $id) : bool
{ {
if (isset($this->assets[$id])) { if (isset($this->assets[$id])) {
unset($this->assets[$id]); unset($this->assets[$id]);
@ -96,14 +96,14 @@ class AssetManager implements \Countable
/** /**
* Get asset. * Get asset.
* *
* @param \string $id Asset id * @param string $id Asset id
* *
* @return mixed Asset * @return mixed Asset
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function get(\string $id) public function get(string $id)
{ {
if (isset($this->assets[$id])) { if (isset($this->assets[$id])) {
return $this->assets[$id]; return $this->assets[$id];
@ -120,7 +120,7 @@ class AssetManager implements \Countable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function count() : \int public function count() : int
{ {
return count($this->assets); return count($this->assets);
} }

View File

@ -68,12 +68,12 @@ class Auth
/** /**
* Authenticates user. * Authenticates user.
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function authenticate() : \bool public function authenticate() : bool
{ {
$uid = $this->session->get('UID'); $uid = $this->session->get('UID');
@ -87,15 +87,15 @@ class Auth
/** /**
* Login user. * Login user.
* *
* @param \string $login Username * @param string $login Username
* @param \string $password Password * @param string $password Password
* *
* @return \int Login code * @return int Login code
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function login(\string $login, \string $password) : \int public function login(string $login, string $password) : int
{ {
try { try {
$result = null; $result = null;
@ -146,14 +146,14 @@ class Auth
/** /**
* Logout the given user. * Logout the given user.
* *
* @param \int $uid User ID * @param int $uid User ID
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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. // TODO: logout other users? If admin wants to kick a user for updates etc.
$this->session->remove('UID'); $this->session->remove('UID');

View File

@ -35,14 +35,14 @@ class Autoloader
/** /**
* Loading classes by namespace + class name. * Loading classes by namespace + class name.
* *
* @param \string $class Class path * @param string $class Class path
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function default_autoloader(\string $class) public static function default_autoloader(string $class)
{ {
if (($class = self::exists($class)) !== false) { if (($class = self::exists($class)) !== false) {
/** @noinspection PhpIncludeInspection */ /** @noinspection PhpIncludeInspection */
@ -53,14 +53,14 @@ class Autoloader
/** /**
* Check if class exists. * Check if class exists.
* *
* @param \string $class Class path * @param string $class Class path
* *
* @return false|string * @return false|string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function exists(\string $class) public static function exists(string $class)
{ {
$class = ltrim($class, '\\'); $class = ltrim($class, '\\');
$class = str_replace(['_', '\\'], DIRECTORY_SEPARATOR, $class); $class = str_replace(['_', '\\'], DIRECTORY_SEPARATOR, $class);

View File

@ -46,27 +46,27 @@ interface OptionsInterface
* *
* @param mixed $key Unique option key * @param mixed $key Unique option key
* @param mixed $value Option value * @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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setOption($key, $value, \bool $overwrite = true) : \bool; public function setOption($key, $value, bool $overwrite = true) : bool;
/** /**
* Updating or adding settings. * Updating or adding settings.
* *
* @param array $pair Key value pair * @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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setOptions(array $pair, \bool $overwrite = true) : \bool; public function setOptions(array $pair, bool $overwrite = true) : bool;
/** /**
* Get option by key. * Get option by key.

View File

@ -52,7 +52,7 @@ trait OptionsTrait
/** /**
* {@inheritdoc} * {@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)) { if ($overwrite || !array_key_exists($key, $this->options)) {
$this->options[$key] = $value; $this->options[$key] = $value;
@ -66,7 +66,7 @@ trait OptionsTrait
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function setOptions(array $pair, \bool $overwrite = true) : \bool public function setOptions(array $pair, bool $overwrite = true) : bool
{ {
if ($overwrite) { if ($overwrite) {
$this->options += $pair; $this->options += $pair;

View File

@ -55,7 +55,7 @@ abstract class SettingsAbstract implements OptionsInterface
/** /**
* Settings table. * Settings table.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $table = null; protected static $table = null;
@ -63,7 +63,7 @@ abstract class SettingsAbstract implements OptionsInterface
/** /**
* Columns to identify the value. * Columns to identify the value.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $columns = [ protected static $columns = [
@ -73,7 +73,7 @@ abstract class SettingsAbstract implements OptionsInterface
/** /**
* Field where the actual value is stored. * Field where the actual value is stored.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $valueField = 'option'; protected $valueField = 'option';
@ -81,7 +81,7 @@ abstract class SettingsAbstract implements OptionsInterface
/** /**
* Get option by key. * Get option by key.
* *
* @param \string[] $columns Column values for filtering * @param string[] $columns Column values for filtering
* *
* @return mixed Option value * @return mixed Option value
* *
@ -114,15 +114,15 @@ abstract class SettingsAbstract implements OptionsInterface
/** /**
* Set option by key. * Set option by key.
* *
* @param \string[] $options Column values for filtering * @param string[] $options Column values for filtering
* @param \bool $store Save this Setting immediately to database * @param bool $store Save this Setting immediately to database
* *
* @return mixed Option value * @return mixed Option value
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function set(array $options, \bool $store = false) public function set(array $options, bool $store = false)
{ {
$this->setOptions($options); $this->setOptions($options);

View File

@ -38,7 +38,7 @@ class CommandManager implements \Countable
/** /**
* Commands. * Commands.
* *
* @var \int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
private $count = 0; private $count = 0;
@ -56,17 +56,17 @@ class CommandManager implements \Countable
/** /**
* Attach new command. * Attach new command.
* *
* @param \string $cmd Command ID * @param string $cmd Command ID
* @param mixed $callback Function callback * @param mixed $callback Function callback
* @param mixed $source Provider * @param mixed $source Provider
* @param \bool $overwrite Overwrite existing * @param bool $overwrite Overwrite existing
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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])) { if ($overwrite || !isset($this->commands[$cmd])) {
$this->commands[$cmd] = [$callback, $source]; $this->commands[$cmd] = [$callback, $source];
@ -81,15 +81,15 @@ class CommandManager implements \Countable
/** /**
* Detach existing command. * Detach existing command.
* *
* @param \string $cmd Command ID * @param string $cmd Command ID
* @param mixed $source Provider * @param mixed $source Provider
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function detach(\string $cmd, $source) : \bool public function detach(string $cmd, $source) : bool
{ {
if (array_key_exists($cmd, $this->commands)) { if (array_key_exists($cmd, $this->commands)) {
unset($this->commands[$cmd]); unset($this->commands[$cmd]);
@ -104,7 +104,7 @@ class CommandManager implements \Countable
/** /**
* Trigger command. * Trigger command.
* *
* @param \string $cmd Command ID * @param string $cmd Command ID
* @param mixed $para Parameters to pass * @param mixed $para Parameters to pass
* *
* @return mixed|bool * @return mixed|bool
@ -112,7 +112,7 @@ class CommandManager implements \Countable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function trigger(\string $cmd, $para) public function trigger(string $cmd, $para)
{ {
if (array_key_exists($cmd, $this->commands)) { if (array_key_exists($cmd, $this->commands)) {
return $this->commands[$cmd][0]($para); return $this->commands[$cmd][0]($para);
@ -124,12 +124,12 @@ class CommandManager implements \Countable
/** /**
* Count commands. * Count commands.
* *
* @return \int * @return int
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function count() : \int public function count() : int
{ {
return $this->count; return $this->count;
} }

View File

@ -34,13 +34,13 @@ interface JsonableInterface extends ArrayableInterface
/** /**
* Convert the object to its JSON representation. * Convert the object to its JSON representation.
* *
* @param \int $options * @param int $options
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function toJson(\int $options = 0) : \string; public function toJson(int $options = 0) : string;
} }

View File

@ -35,11 +35,11 @@ interface RenderableInterface
/** /**
* Get the evaluated contents of the object. * Get the evaluated contents of the object.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function render() : \string; public function render() : string;
} }

View File

@ -35,14 +35,14 @@ interface CacheInterface
* @param mixed $key Unique cache key * @param mixed $key Unique cache key
* @param mixed $value Cache value * @param mixed $value Cache value
* @param CacheStatus $type Cache type * @param CacheStatus $type Cache type
* @param \int $expire Valid duration (in s) * @param int $expire Valid duration (in s)
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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. * Adding new data if it doesn't exist.
@ -50,14 +50,14 @@ interface CacheInterface
* @param mixed $key Unique cache key * @param mixed $key Unique cache key
* @param mixed $value Cache value * @param mixed $value Cache value
* @param CacheStatus $type Cache type * @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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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. * Get cache by key.
@ -78,12 +78,12 @@ interface CacheInterface
* @param mixed $key Unique cache key * @param mixed $key Unique cache key
* @param CacheStatus $type Cache status/type * @param CacheStatus $type Cache status/type
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function delete($key, CacheStatus $type = null) : \bool; public function delete($key, CacheStatus $type = null) : bool;
/** /**
* Removing all elements from cache (invalidate cache). * Removing all elements from cache (invalidate cache).
@ -103,14 +103,14 @@ interface CacheInterface
* @param mixed $key Unique cache key * @param mixed $key Unique cache key
* @param mixed $value Cache value * @param mixed $value Cache value
* @param CacheType $type Cache type * @param CacheType $type Cache type
* @param \int $expire Timestamp * @param int $expire Timestamp
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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. * Requesting cache stats.
@ -125,11 +125,11 @@ interface CacheInterface
/** /**
* Get the threshold required to cache data using this cache. * Get the threshold required to cache data using this cache.
* *
* @return \int Storage threshold * @return int Storage threshold
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getThreshold() : \int; public function getThreshold() : int;
} }

View File

@ -36,7 +36,7 @@ class FileCache implements CacheInterface
/** /**
* Cache path. * Cache path.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
const CACHE_PATH = __DIR__ . '/../../../Cache'; const CACHE_PATH = __DIR__ . '/../../../Cache';
@ -44,7 +44,7 @@ class FileCache implements CacheInterface
/** /**
* Only cache if data is larger than threshold (0-100). * Only cache if data is larger than threshold (0-100).
* *
* @var \int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
private $threshold = 50; private $threshold = 50;
@ -52,14 +52,14 @@ class FileCache implements CacheInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function set($key, $value, CacheStatus $type = null, \int $expire = 2592000) public function set($key, $value, CacheStatus $type = null, int $expire = 2592000)
{ {
} }
/** /**
* {@inheritdoc} * {@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} * {@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} * {@inheritdoc}
*/ */
public function getThreshold() : \int public function getThreshold() : int
{ {
return $this->threshold; return $this->threshold;
} }

View File

@ -40,7 +40,7 @@ class MemCache implements CacheInterface
/** /**
* Only cache if data is larger than threshold (0-100). * Only cache if data is larger than threshold (0-100).
* *
* @var \int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
private $threshold = 10; private $threshold = 10;
@ -74,7 +74,7 @@ class MemCache implements CacheInterface
/** /**
* {@inheritdoc} * {@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); $this->memc->set($key, $value, false, $expire);
} }
@ -82,7 +82,7 @@ class MemCache implements CacheInterface
/** /**
* {@inheritdoc} * {@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); return $this->memc->add($key, $value, false, $expire);
} }
@ -114,7 +114,7 @@ class MemCache implements CacheInterface
/** /**
* {@inheritdoc} * {@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); $this->memc->replace($key, $value, false, $expire);
} }
@ -130,7 +130,7 @@ class MemCache implements CacheInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getThreshold() : \int public function getThreshold() : int
{ {
return $this->threshold; return $this->threshold;
} }

View File

@ -32,7 +32,7 @@ class NullCache implements CacheInterface
/** /**
* {@inheritdoc} * {@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. // TODO: Implement set() method.
} }
@ -40,7 +40,7 @@ class NullCache implements CacheInterface
/** /**
* {@inheritdoc} * {@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. // TODO: Implement add() method.
} }
@ -72,7 +72,7 @@ class NullCache implements CacheInterface
/** /**
* {@inheritdoc} * {@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. // TODO: Implement replace() method.
} }
@ -88,7 +88,7 @@ class NullCache implements CacheInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getThreshold() : \int public function getThreshold() : int
{ {
// TODO: Implement getThreshold() method. // TODO: Implement getThreshold() method.
} }

View File

@ -83,14 +83,14 @@ class Pool implements OptionsInterface
/** /**
* Requesting caching instance. * 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 * @return \phpOMS\DataStorage\Cache\MemCache|\phpOMS\DataStorage\Cache\FileCache|null
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function get(\int $type = null) public function get(int $type = null)
{ {
if (($type === null || $type === CacheStatus::MEMCACHE) && $this->memc !== null) { if (($type === null || $type === CacheStatus::MEMCACHE) && $this->memc !== null) {
return $this->memc; return $this->memc;
@ -114,7 +114,7 @@ class Pool implements OptionsInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function add(\int $type, CacheInterface $cache) public function add(int $type, CacheInterface $cache)
{ {
if (($type === null || $type === CacheStatus::MEMCACHE) && $this->memc !== null) { if (($type === null || $type === CacheStatus::MEMCACHE) && $this->memc !== null) {
$this->memc = $cache; $this->memc = $cache;

View File

@ -34,7 +34,7 @@ class RedisCache implements CacheInterface
/** /**
* {@inheritdoc} * {@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. // TODO: Implement set() method.
} }
@ -42,7 +42,7 @@ class RedisCache implements CacheInterface
/** /**
* {@inheritdoc} * {@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. // TODO: Implement add() method.
} }
@ -74,7 +74,7 @@ class RedisCache implements CacheInterface
/** /**
* {@inheritdoc} * {@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. // TODO: Implement replace() method.
} }
@ -90,7 +90,7 @@ class RedisCache implements CacheInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getThreshold() : \int public function getThreshold() : int
{ {
// TODO: Implement getThreshold() method. // TODO: Implement getThreshold() method.
} }

View File

@ -34,7 +34,7 @@ class WinCache implements CacheInterface
/** /**
* {@inheritdoc} * {@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. // TODO: Implement set() method.
} }
@ -42,7 +42,7 @@ class WinCache implements CacheInterface
/** /**
* {@inheritdoc} * {@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. // TODO: Implement add() method.
} }
@ -74,7 +74,7 @@ class WinCache implements CacheInterface
/** /**
* {@inheritdoc} * {@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. // TODO: Implement replace() method.
} }
@ -90,7 +90,7 @@ class WinCache implements CacheInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getThreshold() : \int public function getThreshold() : int
{ {
// TODO: Implement getThreshold() method. // TODO: Implement getThreshold() method.
} }

View File

@ -33,7 +33,7 @@ class CookieJar
$this->cookies = $_COOKIE; $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])) { if ($overwrite || !isset($this->cookies[$id])) {
$this->cookies[$id] = [ $this->cookies[$id] = [
@ -51,7 +51,7 @@ class CookieJar
return false; return false;
} }
public function remove($id) : \bool public function remove($id) : bool
{ {
if (isset($this->cookies[$id])) { if (isset($this->cookies[$id])) {
unset($this->cookies[$id]); unset($this->cookies[$id]);
@ -62,7 +62,7 @@ class CookieJar
return false; return false;
} }
public function delete($id) : \bool public function delete($id) : bool
{ {
$this->remove($id); $this->remove($id);
setcookie($id, '', time() - 3600); setcookie($id, '', time() - 3600);

View File

@ -51,7 +51,7 @@ abstract class BuilderAbstract
/** /**
* Prefix. * Prefix.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $prefix = ''; protected $prefix = '';
@ -59,14 +59,14 @@ abstract class BuilderAbstract
/** /**
* Set prefix. * Set prefix.
* *
* @param \string $prefix Prefix * @param string $prefix Prefix
* *
* @return BuilderAbstract * @return BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function prefix(\string $prefix) public function prefix(string $prefix)
{ {
$this->prefix = $prefix; $this->prefix = $prefix;
@ -76,12 +76,12 @@ abstract class BuilderAbstract
/** /**
* Get prefix. * Get prefix.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getPrefix() : \string public function getPrefix() : string
{ {
return $this->prefix; return $this->prefix;
} }
@ -89,12 +89,12 @@ abstract class BuilderAbstract
/** /**
* Get query type. * Get query type.
* *
* @return \int * @return int
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getType() : \int public function getType() : int
{ {
return $this->type; return $this->type;
} }

View File

@ -51,7 +51,7 @@ abstract class ConnectionAbstract implements ConnectionInterface
* *
* The database prefix name for unique table names * The database prefix name for unique table names
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
public $prefix = ''; public $prefix = '';
@ -59,7 +59,7 @@ abstract class ConnectionAbstract implements ConnectionInterface
/** /**
* Database data. * Database data.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected $dbdata = null; protected $dbdata = null;
@ -99,7 +99,7 @@ abstract class ConnectionAbstract implements ConnectionInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getType() : \int public function getType() : int
{ {
return $this->type; return $this->type;
} }
@ -107,7 +107,7 @@ abstract class ConnectionAbstract implements ConnectionInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getStatus() : \int public function getStatus() : int
{ {
return $this->status; return $this->status;
} }
@ -115,12 +115,12 @@ abstract class ConnectionAbstract implements ConnectionInterface
/** /**
* Get table prefix. * Get table prefix.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getPrefix() : \string public function getPrefix() : string
{ {
return $this->prefix; return $this->prefix;
} }

View File

@ -45,7 +45,7 @@ class ConnectionFactory
* *
* Overwrites current connection if existing * 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 * @return ConnectionInterface
* *

View File

@ -37,7 +37,7 @@ interface ConnectionInterface
* *
* Overwrites current connection if existing * 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 * @return void
* *
@ -49,22 +49,22 @@ interface ConnectionInterface
/** /**
* Get the database type. * Get the database type.
* *
* @return \int * @return int
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getType() : \int; public function getType() : int;
/** /**
* Get the database status. * Get the database status.
* *
* @return \int * @return int
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getStatus() : \int; public function getStatus() : int;
/** /**
* Close database connection. * Close database connection.

View File

@ -42,7 +42,7 @@ class MysqlConnection extends ConnectionAbstract
* *
* Creates the database object and overwrites all default values. * 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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>

View File

@ -41,7 +41,7 @@ class SqliteConnection extends ConnectionAbstract
* *
* Creates the database object and overwrites all default values. * 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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>

View File

@ -46,7 +46,7 @@ abstract class DataMapperAbstract implements DataMapperInterface
/** /**
* Overwriting extended values. * Overwriting extended values.
* *
* @var \bool * @var bool
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $overwrite = true; protected static $overwrite = true;
@ -54,7 +54,7 @@ abstract class DataMapperAbstract implements DataMapperInterface
/** /**
* Primary field name. * Primary field name.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $primaryField = ''; protected static $primaryField = '';
@ -62,7 +62,7 @@ abstract class DataMapperAbstract implements DataMapperInterface
/** /**
* Primary field name. * Primary field name.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $createdAt = ''; protected static $createdAt = '';
@ -78,7 +78,7 @@ abstract class DataMapperAbstract implements DataMapperInterface
/** /**
* Relations. * Relations.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $hasMany = []; protected static $hasMany = [];
@ -86,7 +86,7 @@ abstract class DataMapperAbstract implements DataMapperInterface
/** /**
* Relations. * Relations.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $ownsMany = []; protected static $ownsMany = [];
@ -94,7 +94,7 @@ abstract class DataMapperAbstract implements DataMapperInterface
/** /**
* Relations. * Relations.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $hasOne = []; protected static $hasOne = [];
@ -102,7 +102,7 @@ abstract class DataMapperAbstract implements DataMapperInterface
/** /**
* Extending relations. * Extending relations.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $extends = []; protected static $extends = [];
@ -110,7 +110,7 @@ abstract class DataMapperAbstract implements DataMapperInterface
/** /**
* Relations. * Relations.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $ownsOne = []; protected static $ownsOne = [];
@ -118,7 +118,7 @@ abstract class DataMapperAbstract implements DataMapperInterface
/** /**
* Table. * Table.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $table = ''; 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. * 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 * @param Builder $query Pre-defined query
* *
* @return mixed * @return mixed
@ -520,7 +520,7 @@ abstract class DataMapperAbstract implements DataMapperInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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])) { if (!isset(static::$createdAt) || !isset(static::$columns[static::$createdAt])) {
throw new \BadMethodCallException('Method "' . __METHOD__ . '" is not supported.'); throw new \BadMethodCallException('Method "' . __METHOD__ . '" is not supported.');
@ -591,14 +591,14 @@ abstract class DataMapperAbstract implements DataMapperInterface
* Get object. * Get object.
* *
* @param mixed $primaryKey Key * @param mixed $primaryKey Key
* @param \bool $relations Load relations * @param bool $relations Load relations
* *
* @return mixed * @return mixed
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function get($primaryKey, \bool $relations = true) public function get($primaryKey, bool $relations = true)
{ {
$obj = []; $obj = [];
if (is_array($primaryKey)) { if (is_array($primaryKey)) {
@ -740,12 +740,12 @@ abstract class DataMapperAbstract implements DataMapperInterface
/** /**
* Get primary field. * Get primary field.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getPrimaryField() : \string public function getPrimaryField() : string
{ {
return static::$primaryField; return static::$primaryField;
} }
@ -753,12 +753,12 @@ abstract class DataMapperAbstract implements DataMapperInterface
/** /**
* Get main table. * Get main table.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getTable() : \string public function getTable() : string
{ {
return static::$table; return static::$table;
} }

View File

@ -21,7 +21,7 @@ abstract class GrammarAbstract
/** /**
* Comment style. * Comment style.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $comment = '--'; protected $comment = '--';
@ -29,7 +29,7 @@ abstract class GrammarAbstract
/** /**
* String quotes style. * String quotes style.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $valueQuotes = '\''; protected $valueQuotes = '\'';
@ -37,7 +37,7 @@ abstract class GrammarAbstract
/** /**
* System identifier. * System identifier.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $systemIdentifier = '"'; protected $systemIdentifier = '"';
@ -45,7 +45,7 @@ abstract class GrammarAbstract
/** /**
* And operator. * And operator.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $and = 'AND'; protected $and = 'AND';
@ -53,7 +53,7 @@ abstract class GrammarAbstract
/** /**
* Or operator. * Or operator.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $or = 'OR'; protected $or = 'OR';
@ -65,14 +65,14 @@ abstract class GrammarAbstract
* *
* @param BuilderAbstract $query Builder * @param BuilderAbstract $query Builder
* *
* @return \string * @return string
* *
* @throws * @throws
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function compileQuery(BuilderAbstract $query) : \string public function compileQuery(BuilderAbstract $query) : string
{ {
return trim( return trim(
implode(' ', implode(' ',
@ -92,14 +92,14 @@ abstract class GrammarAbstract
* Expressionize elements. * Expressionize elements.
* *
* @param array $elements 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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
protected function expressionizeTableColumn(array $elements, \string $prefix = '') : \string protected function expressionizeTableColumn(array $elements, string $prefix = '') : string
{ {
$expression = ''; $expression = '';
@ -123,15 +123,15 @@ abstract class GrammarAbstract
/** /**
* Compile system. * Compile system.
* *
* @param array|\string $system System * @param array|string $system System
* @param \string $prefix Prefix for table * @param string $prefix Prefix for table
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
protected function compileSystem($system, \string $prefix = '') : \string protected function compileSystem($system, string $prefix = '') : string
{ {
if (count($split = explode('.', $system)) == 2) { if (count($split = explode('.', $system)) == 2) {
return $this->compileSystem($prefix . $split[0]) . '.' . $this->compileSystem($split[1]); 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'; return 'Y-m-d H:i:s';
} }
public function getTablePrefix() : \string public function getTablePrefix() : string
{ {
return $this->tablePrefix; return $this->tablePrefix;
} }
public function setTablePrefix(\string $prefix) public function setTablePrefix(string $prefix)
{ {
$this->tablePrefix = $prefix; $this->tablePrefix = $prefix;
} }

View File

@ -57,12 +57,12 @@ class Pool
* @param mixed $key Database key * @param mixed $key Database key
* @param ConnectionAbstract $db Database * @param ConnectionAbstract $db Database
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function add($key = 'core', ConnectionAbstract $db) : \bool public function add($key = 'core', ConnectionAbstract $db) : bool
{ {
if (isset($this->pool[$key])) { if (isset($this->pool[$key])) {
return false; return false;
@ -97,12 +97,12 @@ class Pool
* *
* @param mixed $key Database key * @param mixed $key Database key
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function remove($key) : \bool public function remove($key) : bool
{ {
if (!isset($this->pool[$key])) { if (!isset($this->pool[$key])) {
return false; return false;
@ -119,12 +119,12 @@ class Pool
* @param mixed $key Database key * @param mixed $key Database key
* @param array $config Database config data * @param array $config Database config data
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function create($key, array $config) : \bool public function create($key, array $config) : bool
{ {
if (isset($this->pool[$key])) { if (isset($this->pool[$key])) {
return false; return false;

View File

@ -69,7 +69,7 @@ class Builder extends BuilderAbstract
/** /**
* Distinct. * Distinct.
* *
* @var \bool * @var bool
* @since 1.0.0 * @since 1.0.0
*/ */
public $distinct = false; public $distinct = false;
@ -149,7 +149,7 @@ class Builder extends BuilderAbstract
/** /**
* Lock. * Lock.
* *
* @var \bool * @var bool
* @since 1.0.0 * @since 1.0.0
*/ */
public $lock = false; public $lock = false;
@ -163,7 +163,7 @@ class Builder extends BuilderAbstract
/** /**
* Comparison operators. * Comparison operators.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
const operators = [ const operators = [
@ -242,7 +242,7 @@ class Builder extends BuilderAbstract
/** /**
* Bind parameter. * Bind parameter.
* *
* @param \string|array|\Closure $binds Binds * @param string|array|\Closure $binds Binds
* *
* @return Builder * @return Builder
* *
@ -278,12 +278,12 @@ class Builder extends BuilderAbstract
/** /**
* Parsing to string. * Parsing to string.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function toSql() : \string public function toSql() : string
{ {
return $this->grammar->compileQuery($this); return $this->grammar->compileQuery($this);
} }
@ -291,7 +291,7 @@ class Builder extends BuilderAbstract
/** /**
* Make raw column selection. * Make raw column selection.
* *
* @param \string|\Closure $expression Raw expression * @param string|\Closure $expression Raw expression
* *
* @return Builder * @return Builder
* *
@ -346,7 +346,7 @@ class Builder extends BuilderAbstract
/** /**
* Make raw from. * Make raw from.
* *
* @param \string|array|\Closure $expression Expression * @param string|array|\Closure $expression Expression
* *
* @return Builder * @return Builder
* *
@ -363,16 +363,16 @@ class Builder extends BuilderAbstract
/** /**
* Or Where. * Or Where.
* *
* @param \string|array|\Closure $columns Columns * @param string|array|\Closure $columns Columns
* @param \string $operator Operator * @param string $operator Operator
* @param \string|array|\Closure $values Values * @param string|array|\Closure $values Values
* *
* @return Builder * @return Builder
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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'); return $this->where($columns, $operator, $values, 'or');
} }
@ -380,10 +380,10 @@ class Builder extends BuilderAbstract
/** /**
* Where. * Where.
* *
* @param \string|array|\Closure $columns Columns * @param string|array|\Closure $columns Columns
* @param \string|array $operator Operator * @param string|array $operator Operator
* @param mixed $values Values * @param mixed $values Values
* @param \string|array $boolean Boolean condition * @param string|array $boolean Boolean condition
* *
* @return Builder * @return Builder
* *
@ -428,16 +428,16 @@ class Builder extends BuilderAbstract
/** /**
* Where in. * Where in.
* *
* @param \string|array|\Closure $column Column * @param string|array|\Closure $column Column
* @param mixed $values Values * @param mixed $values Values
* @param \string $boolean Boolean condition * @param string $boolean Boolean condition
* *
* @return Builder * @return Builder
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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); $this->where($column, 'in', $values, $boolean);
@ -447,15 +447,15 @@ class Builder extends BuilderAbstract
/** /**
* Where null. * Where null.
* *
* @param \string|array|\Closure $column Column * @param string|array|\Closure $column Column
* @param \string $boolean Boolean condition * @param string $boolean Boolean condition
* *
* @return Builder * @return Builder
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function whereNull($column, \string $boolean = 'and') : Builder public function whereNull($column, string $boolean = 'and') : Builder
{ {
$this->where($column, '=', null, $boolean); $this->where($column, '=', null, $boolean);
@ -465,15 +465,15 @@ class Builder extends BuilderAbstract
/** /**
* Where not null. * Where not null.
* *
* @param \string|array|\Closure $column Column * @param string|array|\Closure $column Column
* @param \string $boolean Boolean condition * @param string $boolean Boolean condition
* *
* @return Builder * @return Builder
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function whereNotNull($column, \string $boolean = 'and') : Builder public function whereNotNull($column, string $boolean = 'and') : Builder
{ {
$this->where($column, '!=', null, $boolean); $this->where($column, '!=', null, $boolean);
@ -483,7 +483,7 @@ class Builder extends BuilderAbstract
/** /**
* Group by. * Group by.
* *
* @param \string|array|\Closure $columns Grouping result * @param string|array|\Closure $columns Grouping result
* *
* @return Builder * @return Builder
* *
@ -506,7 +506,7 @@ class Builder extends BuilderAbstract
/** /**
* Order by newest. * Order by newest.
* *
* @param \string|\Closure $column Column * @param string|\Closure $column Column
* *
* @return Builder * @return Builder
* *
@ -523,7 +523,7 @@ class Builder extends BuilderAbstract
/** /**
* Order by oldest. * Order by oldest.
* *
* @param \string|\Closure $column Column * @param string|\Closure $column Column
* *
* @return Builder * @return Builder
* *
@ -540,8 +540,8 @@ class Builder extends BuilderAbstract
/** /**
* Order by oldest. * Order by oldest.
* *
* @param \string|array|\Closure $columns Columns * @param string|array|\Closure $columns Columns
* @param \string|string[] $order Orders * @param string|string[] $order Orders
* *
* @return Builder * @return Builder
* *
@ -566,7 +566,7 @@ class Builder extends BuilderAbstract
/** /**
* Offset. * Offset.
* *
* @param \int|\Closure $offset Offset * @param int|\Closure $offset Offset
* *
* @return Builder * @return Builder
* *
@ -583,7 +583,7 @@ class Builder extends BuilderAbstract
/** /**
* Limit. * Limit.
* *
* @param \int|\Closure $limit Limit * @param int|\Closure $limit Limit
* *
* @return Builder * @return Builder
* *
@ -600,7 +600,7 @@ class Builder extends BuilderAbstract
/** /**
* Limit. * Limit.
* *
* @param \string|\phpOMS\DataStorage\Database\Query\Builder $query Query * @param string|\phpOMS\DataStorage\Database\Query\Builder $query Query
* *
* @return Builder * @return Builder
* *
@ -683,7 +683,7 @@ class Builder extends BuilderAbstract
/** /**
* Table to insert into. * Table to insert into.
* *
* @param \string|\Closure $table Table * @param string|\Closure $table Table
* *
* @return Builder * @return Builder
* *
@ -724,7 +724,7 @@ class Builder extends BuilderAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function value($value, \string $type = 'string') : Builder public function value($value, string $type = 'string') : Builder
{ {
end($this->values); end($this->values);
$key = key($this->values); $key = key($this->values);

View File

@ -41,12 +41,12 @@ class Column
/** /**
* Constructor. * Constructor.
* *
* @param \string $column Column * @param string $column Column
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function __construct(\string $column) public function __construct(string $column)
{ {
$this->column = $column; $this->column = $column;
} }
@ -59,12 +59,12 @@ class Column
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getColumn() : \string public function getColumn() : string
{ {
return $this->column; return $this->column;
} }
public function setColumn(\string $column) public function setColumn(string $column)
{ {
$this->column = $column; $this->column = $column;
} }

View File

@ -38,7 +38,7 @@ class Grammar extends GrammarAbstract
/** /**
* Select components. * Select components.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected $selectComponents = [ protected $selectComponents = [
@ -59,7 +59,7 @@ class Grammar extends GrammarAbstract
/** /**
* Insert components. * Insert components.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected $insertComponents = [ protected $insertComponents = [
@ -71,7 +71,7 @@ class Grammar extends GrammarAbstract
/** /**
* Update components. * Update components.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected $updateComponents = [ protected $updateComponents = [
@ -85,7 +85,7 @@ class Grammar extends GrammarAbstract
* *
* @param BuilderAbstract $query Builder * @param BuilderAbstract $query Builder
* *
* @return \string[] * @return string[]
* *
* @throws * @throws
* *
@ -129,12 +129,12 @@ class Grammar extends GrammarAbstract
* @param Builder $query Builder * @param Builder $query Builder
* @param array $columns Columns * @param array $columns Columns
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
protected function compileSelects(Builder $query, array $columns) : \string protected function compileSelects(Builder $query, array $columns) : string
{ {
$expression = $this->expressionizeTableColumn($columns, $query->getPrefix()); $expression = $this->expressionizeTableColumn($columns, $query->getPrefix());
@ -151,12 +151,12 @@ class Grammar extends GrammarAbstract
* @param Builder $query Builder * @param Builder $query Builder
* @param array $table Tables * @param array $table Tables
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
protected function compileFrom(Builder $query, array $table) : \string protected function compileFrom(Builder $query, array $table) : string
{ {
$expression = $this->expressionizeTableColumn($table, $query->getPrefix()); $expression = $this->expressionizeTableColumn($table, $query->getPrefix());
@ -172,14 +172,14 @@ class Grammar extends GrammarAbstract
* *
* @param Builder $query Builder * @param Builder $query Builder
* @param array $wheres Where elmenets * @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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
protected function compileWheres(Builder $query, array $wheres, \bool $first = true) : \string protected function compileWheres(Builder $query, array $wheres, bool $first = true) : string
{ {
$expression = ''; $expression = '';
@ -222,16 +222,16 @@ class Grammar extends GrammarAbstract
* Compile value. * Compile value.
* *
* @param array|string|\Closure $value 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 * @throws \InvalidArgumentException
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
protected function compileValue($value, $prefix = '') : \string protected function compileValue($value, $prefix = '') : string
{ {
if (is_string($value)) { if (is_string($value)) {
return $this->valueQuotes . $value . $this->valueQuotes; return $this->valueQuotes . $value . $this->valueQuotes;
@ -262,14 +262,14 @@ class Grammar extends GrammarAbstract
* Compile limit. * Compile limit.
* *
* @param Builder $query Builder * @param Builder $query Builder
* @param \int $limit Limit * @param int $limit Limit
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
protected function compileLimit(Builder $query, $limit) : \string protected function compileLimit(Builder $query, $limit) : string
{ {
return 'LIMIT ' . $limit; return 'LIMIT ' . $limit;
} }
@ -278,14 +278,14 @@ class Grammar extends GrammarAbstract
* Compile offset. * Compile offset.
* *
* @param Builder $query Builder * @param Builder $query Builder
* @param \int $offset Offset * @param int $offset Offset
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
protected function compileOffset(Builder $query, $offset) : \string protected function compileOffset(Builder $query, $offset) : string
{ {
return 'OFFSET ' . $offset; return 'OFFSET ' . $offset;
} }
@ -301,7 +301,7 @@ class Grammar extends GrammarAbstract
* @param Builder $query Builder * @param Builder $query Builder
* @param array $groups Groups * @param array $groups Groups
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
@ -325,12 +325,12 @@ class Grammar extends GrammarAbstract
* @param Builder $query Builder * @param Builder $query Builder
* @param array $orders Order * @param array $orders Order
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private function compileOrders(Builder $query, array $orders) : \string private function compileOrders(Builder $query, array $orders) : string
{ {
$expression = ''; $expression = '';
@ -361,14 +361,14 @@ class Grammar extends GrammarAbstract
* Compile insert into table. * Compile insert into table.
* *
* @param Builder $query Builder * @param Builder $query Builder
* @param \string $table Table * @param string $table Table
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
protected function compileInto(Builder $query, $table) : \string protected function compileInto(Builder $query, $table) : string
{ {
return 'INSERT INTO ' . $this->compileSystem($table, $query->getPrefix()); return 'INSERT INTO ' . $this->compileSystem($table, $query->getPrefix());
} }
@ -379,12 +379,12 @@ class Grammar extends GrammarAbstract
* @param Builder $query Builder * @param Builder $query Builder
* @param array $columns Columns * @param array $columns Columns
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
protected function compileInserts(Builder $query, array $columns) : \string protected function compileInserts(Builder $query, array $columns) : string
{ {
$cols = ''; $cols = '';
@ -405,12 +405,12 @@ class Grammar extends GrammarAbstract
* @param Builder $query Builder * @param Builder $query Builder
* @param array $values Values * @param array $values Values
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
protected function compileValues(Builder $query, array $values) : \string protected function compileValues(Builder $query, array $values) : string
{ {
$vals = ''; $vals = '';

View File

@ -22,7 +22,7 @@ class MysqlGrammar extends Grammar
/** /**
* System identifier. * System identifier.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $systemIdentifier = '`'; protected $systemIdentifier = '`';

View File

@ -22,7 +22,7 @@ class SqliteGrammar extends Grammar
/** /**
* System identifier. * System identifier.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
public $systemIdentifier = '`'; public $systemIdentifier = '`';

View File

@ -65,7 +65,7 @@ class Builder extends BuilderAbstract
$this->drop = array_unique($this->drop); $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. * Parsing to string.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function toSql() : \string public function toSql() : string
{ {
return $this->grammar->compileQuery($this); return $this->grammar->compileQuery($this);
} }

View File

@ -37,7 +37,7 @@ class Grammar extends GrammarAbstract
/** /**
* Select components. * Select components.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected $selectComponents = [ protected $selectComponents = [
@ -48,7 +48,7 @@ class Grammar extends GrammarAbstract
/** /**
* Select components. * Select components.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected $dropComponents = [ protected $dropComponents = [
@ -77,7 +77,7 @@ class Grammar extends GrammarAbstract
return $sql; return $sql;
} }
protected function compileDrop(Builder $query, array $tables) : \string protected function compileDrop(Builder $query, array $tables) : string
{ {
$expression = $this->expressionizeTableColumn($tables, $query->getPrefix()); $expression = $this->expressionizeTableColumn($tables, $query->getPrefix());

View File

@ -34,7 +34,7 @@ class MysqlGrammar extends Grammar
/** /**
* System identifier. * System identifier.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
protected $systemIdentifier = '`'; protected $systemIdentifier = '`';
@ -45,12 +45,12 @@ class MysqlGrammar extends Grammar
* @param Builder $query Builder * @param Builder $query Builder
* @param array $columns Columns * @param array $columns Columns
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
protected function compileSelects(Builder $query, array $columns) : \string protected function compileSelects(Builder $query, array $columns) : string
{ {
$expression = $this->expressionizeTableColumn($columns); $expression = $this->expressionizeTableColumn($columns);
@ -67,12 +67,12 @@ class MysqlGrammar extends Grammar
* @param Builder $query Builder * @param Builder $query Builder
* @param array $table Tables * @param array $table Tables
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
protected function compileFrom(Builder $query, array $table) : \string protected function compileFrom(Builder $query, array $table) : string
{ {
$expression = $this->expressionizeTableColumn('information_schema.tables'); $expression = $this->expressionizeTableColumn('information_schema.tables');

View File

@ -32,7 +32,7 @@ class ConsoleSession implements SessionInterface
/** /**
* Session ID. * Session ID.
* *
* @var \string|\int * @var string|int
* @since 1.0.0 * @since 1.0.0
*/ */
private $sid = null; private $sid = null;
@ -40,7 +40,7 @@ class ConsoleSession implements SessionInterface
/** /**
* Constructor. * Constructor.
* *
* @param \string|\int $sid Session id * @param string|int $sid Session id
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
@ -60,7 +60,7 @@ class ConsoleSession implements SessionInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function set($key, $value, \bool $overwrite = true) : \bool public function set($key, $value, bool $overwrite = true) : bool
{ {
return false; return false;
} }
@ -68,7 +68,7 @@ class ConsoleSession implements SessionInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function remove($key) : \bool public function remove($key) : bool
{ {
return false; return false;
} }

View File

@ -36,7 +36,7 @@ class HttpSession implements SessionInterface
/** /**
* Session ID. * Session ID.
* *
* @var \string|int * @var string|int
* @since 1.0.0 * @since 1.0.0
*/ */
private $sid = null; private $sid = null;
@ -44,15 +44,15 @@ class HttpSession implements SessionInterface
/** /**
* Constructor. * Constructor.
* *
* @param \int $liftetime Session life time * @param int $liftetime Session life time
* @param \string|int|\bool $sid Session id * @param string|int|bool $sid Session id
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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); session_id($sid);
} }
@ -83,7 +83,7 @@ class HttpSession implements SessionInterface
/** /**
* {@inheritdoc} * {@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])) { if($overwrite || !isset($this->sessionData[$key])) {
$this->sessionData[$key] = $value; $this->sessionData[$key] = $value;
@ -105,7 +105,7 @@ class HttpSession implements SessionInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function remove($key) : \bool public function remove($key) : bool
{ {
if (isset($this->sessionData[$key])) { if (isset($this->sessionData[$key])) {
unset($this->sessionData[$key]); unset($this->sessionData[$key]);

View File

@ -34,7 +34,7 @@ interface SessionInterface
/** /**
* Get session variable by key. * Get session variable by key.
* *
* @param \string|\int $key Value key * @param string|int $key Value key
* *
* @return mixed * @return mixed
* *
@ -46,28 +46,28 @@ interface SessionInterface
/** /**
* Store session value by key. * Store session value by key.
* *
* @param \string|\int $key Value key * @param string|int $key Value key
* @param mixed $value Value to store * @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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function set($key, $value, \bool $overwrite = true) : \bool; public function set($key, $value, bool $overwrite = true) : bool;
/** /**
* Remove value from session by key. * 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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function remove($key) : \bool; public function remove($key) : bool;
/** /**
* Save session. * Save session.
@ -82,7 +82,7 @@ interface SessionInterface
public function save(); public function save();
/** /**
* @return \int|\string * @return int|string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
@ -90,7 +90,7 @@ interface SessionInterface
public function getSID(); public function getSID();
/** /**
* @param \int|\string $sid * @param int|string $sid
* *
* @return void * @return void
* *

View File

@ -32,7 +32,7 @@ class SocketSession implements SessionInterface
/** /**
* Session ID. * Session ID.
* *
* @var \string|\int * @var string|int
* @since 1.0.0 * @since 1.0.0
*/ */
private $sid = null; private $sid = null;
@ -40,7 +40,7 @@ class SocketSession implements SessionInterface
/** /**
* Constructor. * Constructor.
* *
* @param \string|\int $sid Session id * @param string|int $sid Session id
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
@ -60,7 +60,7 @@ class SocketSession implements SessionInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function set($key, $value, \bool $overwrite = true) : \bool public function set($key, $value, bool $overwrite = true) : bool
{ {
return false; return false;
} }
@ -68,7 +68,7 @@ class SocketSession implements SessionInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function remove($key) : \bool public function remove($key) : bool
{ {
return false; return false;
} }

View File

@ -34,7 +34,7 @@ class Address implements JsonableInterface
/** /**
* Name of the receiver. * Name of the receiver.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $recipient = ''; private $recipient = '';
@ -42,7 +42,7 @@ class Address implements JsonableInterface
/** /**
* Sub of the address. * Sub of the address.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $fao = ''; private $fao = '';
@ -69,12 +69,12 @@ class Address implements JsonableInterface
/** /**
* Get recipient. * Get recipient.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getRecipient() : \string public function getRecipient() : string
{ {
return $this->recipient; return $this->recipient;
} }
@ -82,14 +82,14 @@ class Address implements JsonableInterface
/** /**
* Set recipient. * Set recipient.
* *
* @param \string $recipient Recipient * @param string $recipient Recipient
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setRecipient(\string $recipient) public function setRecipient(string $recipient)
{ {
$this->recipient = $recipient; $this->recipient = $recipient;
} }
@ -97,12 +97,12 @@ class Address implements JsonableInterface
/** /**
* Get FAO. * Get FAO.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getFAO() : \string public function getFAO() : string
{ {
return $this->fao; return $this->fao;
} }
@ -110,14 +110,14 @@ class Address implements JsonableInterface
/** /**
* Set FAO. * Set FAO.
* *
* @param \string $fao FAO * @param string $fao FAO
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setFAO(\string $fao) public function setFAO(string $fao)
{ {
$this->fao = $fao; $this->fao = $fao;
} }
@ -161,7 +161,7 @@ class Address implements JsonableInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function toJson(\int $option = 0) : \string public function toJson(int $option = 0) : string
{ {
return json_encode($this->toArray()); return json_encode($this->toArray());
} }

View File

@ -36,14 +36,14 @@ abstract class Enum
* *
* Checking if a certain const name exists (case sensitive) * 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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function isValidName(\string $name) : \bool public static function isValidName(string $name) : bool
{ {
$constants = self::getConstants(); $constants = self::getConstants();
@ -72,12 +72,12 @@ abstract class Enum
* *
* @param mixed $value Value to check * @param mixed $value Value to check
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function isValidValue($value) : \bool public static function isValidValue($value) : bool
{ {
$values = array_values(self::getConstants()); $values = array_values(self::getConstants());

View File

@ -36,14 +36,14 @@ abstract class EnumArray
* *
* Checking if a certain const name exists (case sensitive) * 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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function isValidName(\string $name) : \bool public static function isValidName(string $name) : bool
{ {
$constants = self::getConstants(); $constants = self::getConstants();
@ -71,12 +71,12 @@ abstract class EnumArray
* *
* @param mixed $value Value to check * @param mixed $value Value to check
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function isValidValue($value) : \bool public static function isValidValue($value) : bool
{ {
$constants = self::getConstants(); $constants = self::getConstants();

View File

@ -34,7 +34,7 @@ class Location implements JsonableInterface
/** /**
* Zip or postal. * Zip or postal.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $postal = ''; private $postal = '';
@ -42,7 +42,7 @@ class Location implements JsonableInterface
/** /**
* Name of city. * Name of city.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $city = ''; private $city = '';
@ -50,7 +50,7 @@ class Location implements JsonableInterface
/** /**
* Name of the country. * Name of the country.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $country = ''; private $country = '';
@ -58,7 +58,7 @@ class Location implements JsonableInterface
/** /**
* Street & district. * Street & district.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $address = ''; private $address = '';
@ -66,7 +66,7 @@ class Location implements JsonableInterface
/** /**
* State. * State.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $state = ''; private $state = '';
@ -74,7 +74,7 @@ class Location implements JsonableInterface
/** /**
* Geo coordinates. * Geo coordinates.
* *
* @var \float[] * @var float[]
* @since 1.0.0 * @since 1.0.0
*/ */
private $geo = ['lat' => 0, 'long' => 0]; private $geo = ['lat' => 0, 'long' => 0];
@ -90,127 +90,127 @@ class Location implements JsonableInterface
} }
/** /**
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getPostal() : \string public function getPostal() : string
{ {
return $this->postal; return $this->postal;
} }
/** /**
* @param \string $postal * @param string $postal
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setPostal(\string $postal) public function setPostal(string $postal)
{ {
$this->postal = $postal; $this->postal = $postal;
} }
/** /**
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getCity() : \string public function getCity() : string
{ {
return $this->city; return $this->city;
} }
/** /**
* @param \string $city * @param string $city
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setCity(\string $city) public function setCity(string $city)
{ {
$this->city = $city; $this->city = $city;
} }
/** /**
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getCountry() : \string public function getCountry() : string
{ {
return $this->country; return $this->country;
} }
/** /**
* @param \string $country * @param string $country
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setCountry(\string $country) public function setCountry(string $country)
{ {
$this->country = $country; $this->country = $country;
} }
/** /**
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getAddress() : \string public function getAddress() : string
{ {
return $this->address; return $this->address;
} }
/** /**
* @param \string $address * @param string $address
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setAddress(\string $address) public function setAddress(string $address)
{ {
$this->address = $address; $this->address = $address;
} }
/** /**
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getState() : \string public function getState() : string
{ {
return $this->state; return $this->state;
} }
/** /**
* @param \string $state * @param string $state
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setState(\string $state) public function setState(string $state)
{ {
$this->state = $state; $this->state = $state;
} }
/** /**
* @return \float[] * @return float[]
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
@ -221,7 +221,7 @@ class Location implements JsonableInterface
} }
/** /**
* @param \float[] $geo * @param float[] $geo
* *
* @return void * @return void
* *
@ -251,7 +251,7 @@ class Location implements JsonableInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function toJson(\int $option = 0) : \string public function toJson(int $option = 0) : string
{ {
return json_encode($this->toArray()); return json_encode($this->toArray());
} }

View File

@ -44,17 +44,17 @@ class SmartDateTime extends \DateTime
/** /**
* Modify datetime in a smart way. * Modify datetime in a smart way.
* *
* @param \int $y Year * @param int $y Year
* @param \int $m Month * @param int $m Month
* @param \int $d Day * @param int $d Day
* @param \int $calendar Calendar * @param int $calendar Calendar
* *
* @return SmartDateTime * @return SmartDateTime
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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 = clone $this;
$dt->smartModify($y, $m, $d, $calendar); $dt->smartModify($y, $m, $d, $calendar);
@ -65,17 +65,17 @@ class SmartDateTime extends \DateTime
/** /**
* Modify datetime in a smart way. * Modify datetime in a smart way.
* *
* @param \int $y Year * @param int $y Year
* @param \int $m Month * @param int $m Month
* @param \int $d Day * @param int $d Day
* @param \int $calendar Calendar * @param int $calendar Calendar
* *
* @return SmartDateTime * @return SmartDateTime
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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 = 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; $y_change = ((int) $this->format('m') + $m) < 0 && ((int) $this->format('m') + $m) % 12 === 0 ? $y_change - 1 : $y_change;

View File

@ -70,7 +70,7 @@ class Dispatcher
/** /**
* Dispatch controller. * Dispatch controller.
* *
* @param \string|array|\Closure $controller Controller string * @param string|array|\Closure $controller Controller string
* @param RequestAbstract $request Request * @param RequestAbstract $request Request
* @param ResponseAbstract $response Response * @param ResponseAbstract $response Response
* @param mixed $data Data * @param mixed $data Data
@ -118,14 +118,14 @@ class Dispatcher
/** /**
* Get controller. * Get controller.
* *
* @param \string $controller Controller string * @param string $controller Controller string
* *
* @return mixed * @return mixed
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function get(\string $controller) public function get(string $controller)
{ {
if (!isset($this->controllers[$controller])) { if (!isset($this->controllers[$controller])) {
if (realpath($path = ROOT_PATH . '/' . str_replace('\\', '/', $controller) . '.php') === false) { if (realpath($path = ROOT_PATH . '/' . str_replace('\\', '/', $controller) . '.php') === false) {
@ -142,14 +142,14 @@ class Dispatcher
* Set controller by alias. * Set controller by alias.
* *
* @param ModuleAbstract $controller Controller * @param ModuleAbstract $controller Controller
* @param \string $name Controller string * @param string $name Controller string
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function set(ModuleAbstract $controller, \string $name) : \bool public function set(ModuleAbstract $controller, string $name) : bool
{ {
if (!isset($this->controllers[$name])) { if (!isset($this->controllers[$name])) {
$this->controllers[$name] = $controller; $this->controllers[$name] = $controller;

View File

@ -51,7 +51,7 @@ class EventManager implements Mediator
/** /**
* {@inheritdoc} * {@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; $this->events[$event][$listener] = $callback;
@ -61,7 +61,7 @@ class EventManager implements Mediator
/** /**
* {@inheritdoc} * {@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; $count = 0;
foreach ($this->events[$event] as $event) { 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 * 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 \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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; $run = true;
$count = 0; $count = 0;
@ -113,7 +113,7 @@ class EventManager implements Mediator
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function detach(\int $event) public function detach(int $event)
{ {
$this->events = ArrayUtils::unsetArray($event, $this->events, '/'); $this->events = ArrayUtils::unsetArray($event, $this->events, '/');
} }
@ -121,12 +121,12 @@ class EventManager implements Mediator
/** /**
* Count event listenings. * Count event listenings.
* *
* @return \int * @return int
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function count() : \int public function count() : int
{ {
return count($this->events); return count($this->events);
} }

View File

@ -32,7 +32,7 @@ class L11nManager
/** /**
* Language. * Language.
* *
* @var \string[][] * @var string[][]
* @since 1.0.0 * @since 1.0.0
*/ */
private $language = []; private $language = [];
@ -40,14 +40,14 @@ class L11nManager
/** /**
* Verify if language is loaded. * 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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function isLanguageLoaded(\string $language) : \bool public function isLanguageLoaded(string $language) : bool
{ {
return isset($this->language[$language]); 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 * One module can only be loaded once. Once the module got loaded it's not
* possible to load more language files later on. * possible to load more language files later on.
* *
* @param \string $language Language iso code * @param string $language Language iso code
* @param \string $from Module name * @param string $from Module name
* @param \string[][] $files Language files content * @param string[][] $files Language files content
* *
* @return void * @return void
* *
@ -69,7 +69,7 @@ class L11nManager
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function loadLanguage(\string $language, \string $from, array $files) public function loadLanguage(string $language, string $from, array $files)
{ {
if(!isset($files[$from])) { if(!isset($files[$from])) {
throw new \Exception('Unexpected language key: ' . $from); throw new \Exception('Unexpected language key: ' . $from);
@ -86,15 +86,15 @@ class L11nManager
/** /**
* Get application language. * Get application language.
* *
* @param \string $language Language iso code * @param string $language Language iso code
* @param \string $module Module name * @param string $module Module name
* *
* @return array * @return array
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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])) { if (!isset($module) && isset($this->language[$language])) {
return $this->language[$language]; return $this->language[$language];

View File

@ -33,7 +33,7 @@ class Localization
/** /**
* Country ID. * Country ID.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $country = ISO3166Enum::_US; private $country = ISO3166Enum::_US;
@ -41,7 +41,7 @@ class Localization
/** /**
* Timezone. * Timezone.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $timezone = 'America/New_York'; private $timezone = 'America/New_York';
@ -49,7 +49,7 @@ class Localization
/** /**
* Language ISO code. * Language ISO code.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $language = ISO639x1Enum::_EN; private $language = ISO639x1Enum::_EN;
@ -57,7 +57,7 @@ class Localization
/** /**
* Currency. * Currency.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $currency = ISO4217Enum::C_USD; private $currency = ISO4217Enum::C_USD;
@ -65,7 +65,7 @@ class Localization
/** /**
* Number format. * Number format.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $decimal = '.'; private $decimal = '.';
@ -73,7 +73,7 @@ class Localization
/** /**
* Number format. * Number format.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $thousands = ','; private $thousands = ',';
@ -81,7 +81,7 @@ class Localization
/** /**
* Time format. * Time format.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $datetime = 'Y-m-d H:i:s'; private $datetime = 'Y-m-d H:i:s';
@ -89,7 +89,7 @@ class Localization
/** /**
* Language array. * Language array.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
public $lang = []; public $lang = [];
@ -105,25 +105,25 @@ class Localization
} }
/** /**
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getCountry() : \string public function getCountry() : string
{ {
return $this->country; return $this->country;
} }
/** /**
* @param \string $country * @param string $country
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setCountry(\string $country) public function setCountry(string $country)
{ {
if(!ISO3166Enum::isValidValue($country)) { if(!ISO3166Enum::isValidValue($country)) {
throw new InvalidEnumValue($country); throw new InvalidEnumValue($country);
@ -133,25 +133,25 @@ class Localization
} }
/** /**
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getTimezone() : \string public function getTimezone() : string
{ {
return $this->timezone; return $this->timezone;
} }
/** /**
* @param \string $timezone * @param string $timezone
* *
* @todo: maybe make parameter int * @todo: maybe make parameter int
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setTimezone(\string $timezone) public function setTimezone(string $timezone)
{ {
if(!TimeZoneEnumArray::isValidValue($timezone)) { if(!TimeZoneEnumArray::isValidValue($timezone)) {
throw new InvalidEnumValue($timezone); throw new InvalidEnumValue($timezone);
@ -161,25 +161,25 @@ class Localization
} }
/** /**
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getLanguage() : \string public function getLanguage() : string
{ {
return $this->language; return $this->language;
} }
/** /**
* @param \string $language * @param string $language
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setLanguage(\string $language) public function setLanguage(string $language)
{ {
if(!ISO639x1Enum::isValidValue($language)) { if(!ISO639x1Enum::isValidValue($language)) {
throw new InvalidEnumValue($language); throw new InvalidEnumValue($language);
@ -213,25 +213,25 @@ class Localization
} }
/** /**
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getCurrency() : \string public function getCurrency() : string
{ {
return $this->currency; return $this->currency;
} }
/** /**
* @param \string $currency * @param string $currency
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setCurrency(\string $currency) public function setCurrency(string $currency)
{ {
if(!ISO4217Enum::isValidValue($currency)) { if(!ISO4217Enum::isValidValue($currency)) {
throw new InvalidEnumValue($currency); throw new InvalidEnumValue($currency);
@ -241,73 +241,73 @@ class Localization
} }
/** /**
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getDatetime() : \string public function getDatetime() : string
{ {
return $this->datetime; return $this->datetime;
} }
/** /**
* @param \string $datetime * @param string $datetime
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setDatetime(\string $datetime) public function setDatetime(string $datetime)
{ {
$this->datetime = $datetime; $this->datetime = $datetime;
} }
/** /**
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getDecimal() : \string public function getDecimal() : string
{ {
return $this->decimal; return $this->decimal;
} }
/** /**
* @param \string $decimal * @param string $decimal
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setDecimal(\string $decimal) public function setDecimal(string $decimal)
{ {
$this->decimal = $decimal; $this->decimal = $decimal;
} }
/** /**
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getThousands() : \string public function getThousands() : string
{ {
return $this->thousands; return $this->thousands;
} }
/** /**
* @param \string $thousands * @param string $thousands
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setThousands(\string $thousands) public function setThousands(string $thousands)
{ {
$this->thousands = $thousands; $this->thousands = $thousands;
} }

View File

@ -78,12 +78,12 @@ class FileLogger implements LoggerInterface
* *
* Creates the logging object and overwrites all default values. * 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 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function __construct(\string $lpath) public function __construct(string $lpath)
{ {
$path = realpath($lpath); $path = realpath($lpath);
@ -115,14 +115,14 @@ class FileLogger implements LoggerInterface
/** /**
* Returns instance. * Returns instance.
* *
* @param \string $path Logging path * @param string $path Logging path
* *
* @return self * @return self
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getInstance(\string $path = '') public static function getInstance(string $path = '')
{ {
if (self::$instance === null) { if (self::$instance === null) {
self::$instance = new self($path); self::$instance = new self($path);
@ -159,7 +159,7 @@ class FileLogger implements LoggerInterface
/** /**
* Starts the time measurement. * 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 * @return void
* *
@ -177,9 +177,9 @@ class FileLogger implements LoggerInterface
/** /**
* Ends the time measurement. * 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 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
@ -213,16 +213,16 @@ class FileLogger implements LoggerInterface
/** /**
* Interpolate context * Interpolate context
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* @param \string $level * @param string $level
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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 = []; $replace = [];
foreach ($context as $key => $val) { foreach ($context as $key => $val) {
@ -257,7 +257,7 @@ class FileLogger implements LoggerInterface
* @param array $a * @param array $a
* @param array $b * @param array $b
* *
* @return \bool the comparison * @return bool the comparison
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
@ -274,14 +274,14 @@ class FileLogger implements LoggerInterface
/** /**
* Write to file. * Write to file.
* *
* @param \string $message * @param string $message
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
private function write(\string $message) private function write(string $message)
{ {
$this->fp = fopen($this->path, 'a'); $this->fp = fopen($this->path, 'a');
fwrite($this->fp, $message . "\n"); fwrite($this->fp, $message . "\n");
@ -291,7 +291,7 @@ class FileLogger implements LoggerInterface
/** /**
* System is unusable. * System is unusable.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return null * @return null
@ -299,7 +299,7 @@ class FileLogger implements LoggerInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function emergency(\string $message, array $context = []) public function emergency(string $message, array $context = [])
{ {
$message = $this->interpolate($message, $context, LogLevel::EMERGENCY); $message = $this->interpolate($message, $context, LogLevel::EMERGENCY);
$this->write($message); $this->write($message);
@ -311,7 +311,7 @@ class FileLogger implements LoggerInterface
* Example: Entire website down, database unavailable, etc. This should * Example: Entire website down, database unavailable, etc. This should
* trigger the SMS alerts and wake you up. * trigger the SMS alerts and wake you up.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return void * @return void
@ -319,7 +319,7 @@ class FileLogger implements LoggerInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function alert(\string $message, array $context = []) public function alert(string $message, array $context = [])
{ {
$message = $this->interpolate($message, $context, LogLevel::ALERT); $message = $this->interpolate($message, $context, LogLevel::ALERT);
$this->write($message); $this->write($message);
@ -330,7 +330,7 @@ class FileLogger implements LoggerInterface
* *
* Example: Application component unavailable, unexpected exception. * Example: Application component unavailable, unexpected exception.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return void * @return void
@ -338,7 +338,7 @@ class FileLogger implements LoggerInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function critical(\string $message, array $context = []) public function critical(string $message, array $context = [])
{ {
$message = $this->interpolate($message, $context, LogLevel::CRITICAL); $message = $this->interpolate($message, $context, LogLevel::CRITICAL);
$this->write($message); $this->write($message);
@ -348,7 +348,7 @@ class FileLogger implements LoggerInterface
* Runtime errors that do not require immediate action but should typically * Runtime errors that do not require immediate action but should typically
* be logged and monitored. * be logged and monitored.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return void * @return void
@ -356,7 +356,7 @@ class FileLogger implements LoggerInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function error(\string $message, array $context = []) public function error(string $message, array $context = [])
{ {
$message = $this->interpolate($message, $context, LogLevel::ERROR); $message = $this->interpolate($message, $context, LogLevel::ERROR);
$this->write($message); $this->write($message);
@ -368,7 +368,7 @@ class FileLogger implements LoggerInterface
* Example: Use of deprecated APIs, poor use of an API, undesirable things * Example: Use of deprecated APIs, poor use of an API, undesirable things
* that are not necessarily wrong. * that are not necessarily wrong.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return void * @return void
@ -376,7 +376,7 @@ class FileLogger implements LoggerInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function warning(\string $message, array $context = []) public function warning(string $message, array $context = [])
{ {
$message = $this->interpolate($message, $context, LogLevel::WARNING); $message = $this->interpolate($message, $context, LogLevel::WARNING);
$this->write($message); $this->write($message);
@ -385,7 +385,7 @@ class FileLogger implements LoggerInterface
/** /**
* Normal but significant events. * Normal but significant events.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return void * @return void
@ -393,7 +393,7 @@ class FileLogger implements LoggerInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function notice(\string $message, array $context = []) public function notice(string $message, array $context = [])
{ {
$message = $this->interpolate($message, $context, LogLevel::NOTICE); $message = $this->interpolate($message, $context, LogLevel::NOTICE);
$this->write($message); $this->write($message);
@ -404,7 +404,7 @@ class FileLogger implements LoggerInterface
* *
* Example: User logs in, SQL logs. * Example: User logs in, SQL logs.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return void * @return void
@ -412,7 +412,7 @@ class FileLogger implements LoggerInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function info(\string $message, array $context = []) public function info(string $message, array $context = [])
{ {
$message = $this->interpolate($message, $context, LogLevel::INFO); $message = $this->interpolate($message, $context, LogLevel::INFO);
$this->write($message); $this->write($message);
@ -421,7 +421,7 @@ class FileLogger implements LoggerInterface
/** /**
* Detailed debug information. * Detailed debug information.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return void * @return void
@ -429,7 +429,7 @@ class FileLogger implements LoggerInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function debug(\string $message, array $context = []) public function debug(string $message, array $context = [])
{ {
$message = $this->interpolate($message, $context, LogLevel::DEBUG); $message = $this->interpolate($message, $context, LogLevel::DEBUG);
$this->write($message); $this->write($message);
@ -438,8 +438,8 @@ class FileLogger implements LoggerInterface
/** /**
* Logs with an arbitrary level. * Logs with an arbitrary level.
* *
* @param \string $level * @param string $level
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return void * @return void
@ -447,7 +447,7 @@ class FileLogger implements LoggerInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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)) { if (!LogLevel::isValidValue($level)) {
throw new InvalidEnumValue($level); throw new InvalidEnumValue($level);
@ -490,11 +490,11 @@ class FileLogger implements LoggerInterface
/** /**
* Find cricitcal connections. * Find cricitcal connections.
* *
* @param \int $limit Amout of perpetrators * @param int $limit Amout of perpetrators
* *
* @return array * @return array
*/ */
public function getHighestPerpetrator(\int $limit = 10) public function getHighestPerpetrator(int $limit = 10)
{ {
$connection = []; $connection = [];
@ -523,12 +523,12 @@ class FileLogger implements LoggerInterface
/** /**
* Get logging messages from file. * Get logging messages from file.
* *
* @param \int $limit Amout of perpetrators * @param int $limit Amout of perpetrators
* @param \int $offset Offset * @param int $offset Offset
* *
* @return array * @return array
*/ */
public function get(\int $limit = 25, \int $offset = 0) : array public function get(int $limit = 25, int $offset = 0) : array
{ {
$logs = []; $logs = [];
$id = 0; $id = 0;
@ -570,11 +570,11 @@ class FileLogger implements LoggerInterface
/** /**
* Get single logging message from file. * 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 * @return array
*/ */
public function getByLine(\int $id = 1) : array public function getByLine(int $id = 1) : array
{ {
$log = []; $log = [];
$current = 0; $current = 0;

View File

@ -21,12 +21,12 @@ interface LoggerInterface
/** /**
* System is unusable. * System is unusable.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return null * @return null
*/ */
public function emergency(\string $message, array $context = []); public function emergency(string $message, array $context = []);
/** /**
* Action must be taken immediately. * Action must be taken immediately.
@ -34,35 +34,35 @@ interface LoggerInterface
* Example: Entire website down, database unavailable, etc. This should * Example: Entire website down, database unavailable, etc. This should
* trigger the SMS alerts and wake you up. * trigger the SMS alerts and wake you up.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return null * @return null
*/ */
public function alert(\string $message, array $context = []); public function alert(string $message, array $context = []);
/** /**
* Critical conditions. * Critical conditions.
* *
* Example: Application component unavailable, unexpected exception. * Example: Application component unavailable, unexpected exception.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return null * @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 * Runtime errors that do not require immediate action but should typically
* be logged and monitored. * be logged and monitored.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return null * @return null
*/ */
public function error(\string $message, array $context = []); public function error(string $message, array $context = []);
/** /**
* Exceptional occurrences that are not errors. * Exceptional occurrences that are not errors.
@ -70,53 +70,53 @@ interface LoggerInterface
* Example: Use of deprecated APIs, poor use of an API, undesirable things * Example: Use of deprecated APIs, poor use of an API, undesirable things
* that are not necessarily wrong. * that are not necessarily wrong.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return null * @return null
*/ */
public function warning(\string $message, array $context = []); public function warning(string $message, array $context = []);
/** /**
* Normal but significant events. * Normal but significant events.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return null * @return null
*/ */
public function notice(\string $message, array $context = []); public function notice(string $message, array $context = []);
/** /**
* Interesting events. * Interesting events.
* *
* Example: User logs in, SQL logs. * Example: User logs in, SQL logs.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return null * @return null
*/ */
public function info(\string $message, array $context = []); public function info(string $message, array $context = []);
/** /**
* Detailed debug information. * Detailed debug information.
* *
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return null * @return null
*/ */
public function debug(\string $message, array $context = []); public function debug(string $message, array $context = []);
/** /**
* Logs with an arbitrary level. * Logs with an arbitrary level.
* *
* @param \string $level * @param string $level
* @param \string $message * @param string $message
* @param array $context * @param array $context
* *
* @return null * @return null
*/ */
public function log(\string $level, \string $message, array $context = []); public function log(string $level, string $message, array $context = []);
} }

View File

@ -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); $length = count($vertices);

View File

@ -50,7 +50,7 @@ class FiniteDifference
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; 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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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); 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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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) { 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); 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);

File diff suppressed because it is too large Load Diff

View File

@ -31,17 +31,17 @@ class Loan
/** /**
* Balloon Loan - Payments * Balloon Loan - Payments
* *
* @param \float $PV Present value * @param float $PV Present value
* @param \float $r Rate per period * @param float $r Rate per period
* @param \int $n Number of periods * @param int $n Number of periods
* @param \float $balloon Balloon balance * @param float $balloon Balloon balance
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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)); return ($PV - $balloon / pow(1 + $r, $n)) * $r / (1 - pow(1 + $r, -$n));
} }
@ -49,17 +49,17 @@ class Loan
/** /**
* Loan - Balloon Balance * Loan - Balloon Balance
* *
* @param \float $PV Present value (original balance) * @param float $PV Present value (original balance)
* @param \float $P Payment * @param float $P Payment
* @param \float $r Rate per payment * @param float $r Rate per payment
* @param \int $n Number of payments * @param int $n Number of payments
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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; return $PV * pow(1 + $r, $n) - $P * (pow(1 + $r, $n) - 1) / $r;
} }
@ -67,16 +67,16 @@ class Loan
/** /**
* Loan - Payment * Loan - Payment
* *
* @param \float $PV Present value (original balance) * @param float $PV Present value (original balance)
* @param \float $r Rate per period * @param float $r Rate per period
* @param \int $n Number of periods * @param int $n Number of periods
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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)); return $r * $PV / (1 - pow(1 + $r, -$n));
} }
@ -84,17 +84,17 @@ class Loan
/** /**
* Loan - Remaining Balance * Loan - Remaining Balance
* *
* @param \float $PV Present value (original balance) * @param float $PV Present value (original balance)
* @param \float $P Payment * @param float $P Payment
* @param \float $r Rate per payment * @param float $r Rate per payment
* @param \int $n Number of payments * @param int $n Number of payments
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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; return $PV * pow(1 + $r, $n) - $P * (pow(1 + $r, $n) - 1) / $r;
} }
@ -102,15 +102,15 @@ class Loan
/** /**
* Loan to Deposit Ratio * Loan to Deposit Ratio
* *
* @param \float $loans Loans * @param float $loans Loans
* @param \float $deposits Deposits * @param float $deposits Deposits
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function getLoanToDepositRatio(\float $loans, \float $deposits) : \float public static function getLoanToDepositRatio(float $loans, float $deposits) : float
{ {
return $loans / $deposits; return $loans / $deposits;
} }
@ -118,15 +118,15 @@ class Loan
/** /**
* Loan to Value (LTV) * Loan to Value (LTV)
* *
* @param \float $loan Loan amount * @param float $loan Loan amount
* @param \float $collateral Value of collateral * @param float $collateral Value of collateral
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function getLoanToValueRatio(\float $loan, \float $collateral) : \float public static function getLoanToValueRatio(float $loan, float $collateral) : float
{ {
return $loan / $collateral; return $loan / $collateral;
} }

View File

@ -31,16 +31,16 @@ class StockBonds
/** /**
* Bond Equivalent Yield * Bond Equivalent Yield
* *
* @param \float $fv Face value * @param float $fv Face value
* @param \float $price Price * @param float $price Price
* @param \int $days Days to maturity * @param int $days Days to maturity
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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; return ($fv - $price) / $price * 365 / $days;
} }
@ -48,15 +48,15 @@ class StockBonds
/** /**
* Book Value per Share * Book Value per Share
* *
* @param \float $total Total common stockholder's Equity * @param float $total Total common stockholder's Equity
* @param \int $common Number of common shares * @param int $common Number of common shares
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function getBookValuePerShare(\float $total, \int $common) : \float public static function getBookValuePerShare(float $total, int $common) : float
{ {
return $total / $common; return $total / $common;
} }
@ -64,16 +64,16 @@ class StockBonds
/** /**
* Capital Asset Pricing Model (CAPM) * Capital Asset Pricing Model (CAPM)
* *
* @param \float $rf Risk free rate * @param float $rf Risk free rate
* @param \float $beta Risk to invest in a stock relative to the risk of the market * @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 $r Return on the market
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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); return $rf + $beta * ($r - $rf);
} }
@ -81,15 +81,15 @@ class StockBonds
/** /**
* Capital Gains Yield * Capital Gains Yield
* *
* @param \float $P0 Old stock price * @param float $P0 Old stock price
* @param \float $P1 New stock price * @param float $P1 New stock price
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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; return $P1 / $P0 - 1;
} }
@ -97,15 +97,15 @@ class StockBonds
/** /**
* Current Yield * Current Yield
* *
* @param \float $coupons Annual coupons * @param float $coupons Annual coupons
* @param \float $price Current bond price * @param float $price Current bond price
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function getCurrentYield(\float $coupons, \float $price) : \float public static function getCurrentYield(float $coupons, float $price) : float
{ {
return $coupons / $price; return $coupons / $price;
} }
@ -113,16 +113,16 @@ class StockBonds
/** /**
* Diluted Earnings per Share * Diluted Earnings per Share
* *
* @param \float $income Net Income * @param float $income Net Income
* @param \float $avg Avg. shares * @param float $avg Avg. shares
* @param \float $other Other convertible instruments * @param float $other Other convertible instruments
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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); return $income / ($avg + $other);
} }
@ -130,15 +130,15 @@ class StockBonds
/** /**
* Dividend Payout Ratio * Dividend Payout Ratio
* *
* @param \float $dividends Dividends * @param float $dividends Dividends
* @param \float $income Net income * @param float $income Net income
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function getDividendPayoutRatio(\float $dividends, \float $income) : \float public static function getDividendPayoutRatio(float $dividends, float $income) : float
{ {
return $dividends / $income; return $dividends / $income;
} }
@ -146,15 +146,15 @@ class StockBonds
/** /**
* Dividend Yield * Dividend Yield
* *
* @param \float $dividends Dividends * @param float $dividends Dividends
* @param \float $price Initial price for the period * @param float $price Initial price for the period
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function getDividendYield(\float $dividends, \float $price) : \float public static function getDividendYield(float $dividends, float $price) : float
{ {
return $dividends / $price; return $dividends / $price;
} }
@ -162,15 +162,15 @@ class StockBonds
/** /**
* Dividend Yield * Dividend Yield
* *
* @param \float $dividends Dividends * @param float $dividends Dividends
* @param \int $shares Initial price for the period * @param int $shares Initial price for the period
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function getDividendsPerShare(\float $dividends, \int $shares) : \float public static function getDividendsPerShare(float $dividends, int $shares) : float
{ {
return $dividends / $shares; return $dividends / $shares;
} }
@ -178,15 +178,15 @@ class StockBonds
/** /**
* Earnings Per Share * Earnings Per Share
* *
* @param \float $income Net income * @param float $income Net income
* @param \float $shares Weighted avg. outstanding shares * @param float $shares Weighted avg. outstanding shares
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function getEarningsPerShare(\float $income, \float $shares) : \float public static function getEarningsPerShare(float $income, float $shares) : float
{ {
return $income / $shares; return $income / $shares;
} }
@ -194,15 +194,15 @@ class StockBonds
/** /**
* Equity Multiplier * Equity Multiplier
* *
* @param \float $assets Total assets * @param float $assets Total assets
* @param \float $equity Stockholder's equity * @param float $equity Stockholder's equity
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function getEquityMultiplier(\float $assets, \float $equity) : \float public static function getEquityMultiplier(float $assets, float $equity) : float
{ {
return $assets / $equity; return $assets / $equity;
} }
@ -212,12 +212,12 @@ class StockBonds
* *
* @param array $r Rate of return * @param array $r Rate of return
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function getHoldingPeriodReturn(array $r) : \float public static function getHoldingPeriodReturn(array $r) : float
{ {
$hpr = 1.0; $hpr = 1.0;
@ -231,16 +231,16 @@ class StockBonds
/** /**
* Net Asset Value * Net Asset Value
* *
* @param \float $assets Fund assets * @param float $assets Fund assets
* @param \float $liabilities Fund liabilities * @param float $liabilities Fund liabilities
* @param \int $shares Outstanding shares * @param int $shares Outstanding shares
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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; return ($assets - $liabilities) / $shares;
} }
@ -248,15 +248,15 @@ class StockBonds
/** /**
* Price to Book Value * Price to Book Value
* *
* @param \float $market Market price per share * @param float $market Market price per share
* @param \float $book Book value per share * @param float $book Book value per share
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function getPriceToBookValue(\float $market, \float $book) : \float public static function getPriceToBookValue(float $market, float $book) : float
{ {
return $market / $book; return $market / $book;
} }
@ -264,15 +264,15 @@ class StockBonds
/** /**
* Price to Earnings (P/E Ratio) * Price to Earnings (P/E Ratio)
* *
* @param \float $price Price per share * @param float $price Price per share
* @param \float $earnings Earnings per share * @param float $earnings Earnings per share
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function getPriceEarningsRatio(\float $price, \float $earnings) : \float public static function getPriceEarningsRatio(float $price, float $earnings) : float
{ {
return $price / $earnings; return $price / $earnings;
} }
@ -280,15 +280,15 @@ class StockBonds
/** /**
* Price to Sales (P/S Ratio) * Price to Sales (P/S Ratio)
* *
* @param \float $price Price per share * @param float $price Price per share
* @param \float $sales Sales per share * @param float $sales Sales per share
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function getPriceToSalesRatio(\float $price, \float $sales) : \float public static function getPriceToSalesRatio(float $price, float $sales) : float
{ {
return $price / $sales; return $price / $sales;
} }
@ -296,16 +296,16 @@ class StockBonds
/** /**
* Stock - PV with Constant Growth * Stock - PV with Constant Growth
* *
* @param \float $dividend Estimated dividends for next period * @param float $dividend Estimated dividends for next period
* @param \float $r Required rate of return * @param float $r Required rate of return
* @param \float $g Growth rate * @param float $g Growth rate
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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); return $dividend / ($r - $g);
} }
@ -313,15 +313,15 @@ class StockBonds
/** /**
* Tax Equivalent Yield * Tax Equivalent Yield
* *
* @param \float $free Tax free yield * @param float $free Tax free yield
* @param \float $tax Tax rate * @param float $tax Tax rate
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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); return $free / (1 - $tax);
} }
@ -329,16 +329,16 @@ class StockBonds
/** /**
* Total Stock Return * Total Stock Return
* *
* @param \float $P0 Initial stock price * @param float $P0 Initial stock price
* @param \float $P1 Ending stock price * @param float $P1 Ending stock price
* @param \float $D Dividends * @param float $D Dividends
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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; return ($P1 - $P0 + $D) / $P0;
} }
@ -346,17 +346,17 @@ class StockBonds
/** /**
* Yield to Maturity * Yield to Maturity
* *
* @param \float $C Coupon/interest payment * @param float $C Coupon/interest payment
* @param \float $F Face value * @param float $F Face value
* @param \float $P Price * @param float $P Price
* @param \int $n Years to maturity * @param int $n Years to maturity
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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); return ($C + ($F - $P) / $n) / (($F + $P) / 2);
} }
@ -364,16 +364,16 @@ class StockBonds
/** /**
* Zero Coupon Bond Value * Zero Coupon Bond Value
* *
* @param \float $F Face value * @param float $F Face value
* @param \float $r Rate or yield * @param float $r Rate or yield
* @param \int $t Time to maturity * @param int $t Time to maturity
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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); return $F / pow(1 + $r, $t);
} }
@ -381,16 +381,16 @@ class StockBonds
/** /**
* Zero Coupon Bond Effective Yield * Zero Coupon Bond Effective Yield
* *
* @param \float $F Face value * @param float $F Face value
* @param \float $PV Present value * @param float $PV Present value
* @param \int $n Time to maturity * @param int $n Time to maturity
* *
* @return \float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @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; return pow($F / $PV, 1 / $n) - 1;
} }

View File

@ -41,7 +41,7 @@ class Functions
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getGammaInteger(\int $k) : \int public static function getGammaInteger(int $k) : int
{ {
return self::fact($k - 1); return self::fact($k - 1);
} }
@ -59,7 +59,7 @@ class Functions
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function fact(\int $n, \int $start = 1) : \int public static function fact(int $n, int $start = 1) : int
{ {
$fact = 1; $fact = 1;
@ -85,7 +85,7 @@ class Functions
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function binomialCoefficient(\int $n, \int $k) : \int public static function binomialCoefficient(int $n, int $k) : int
{ {
$max = max([$k, $n - $k]); $max = max([$k, $n - $k]);
$min = min([$k, $n - $k]); $min = min([$k, $n - $k]);

View File

@ -74,7 +74,7 @@ class BruteForce
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getSolution(\int $limit = 1) : Population public function getSolution(int $limit = 1) : Population
{ {
$population = new Population($this->cityPool, $limit, true); $population = new Population($this->cityPool, $limit, true);
$cities = $this->cityPool->getCities(); $cities = $this->cityPool->getCities();

View File

@ -64,7 +64,7 @@ class City
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function __construct(\float $lat, \float $long, \string $name) public function __construct(float $lat, float $long, string $name)
{ {
$this->long = $long; $this->long = $long;
$this->lat = $lat; $this->lat = $lat;
@ -79,7 +79,7 @@ class City
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getLongitude() : \float public function getLongitude() : float
{ {
return $this->long; return $this->long;
} }
@ -92,7 +92,7 @@ class City
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getLatitude() : \float public function getLatitude() : float
{ {
return $this->lat; return $this->lat;
} }
@ -105,7 +105,7 @@ class City
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getName() : \string public function getName() : string
{ {
return $this->name; return $this->name;
} }
@ -120,7 +120,7 @@ class City
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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(); return $this->name === $city->getName() && $this->lat === $city->getLatitude() && $this->long === $city->getLatitude();
} }
@ -135,7 +135,7 @@ class City
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getDistanceTo(City $city) : \float public function getDistanceTo(City $city) : float
{ {
return Sphere::distance2PointsOnSphere($this->lat, $this->long, $city->getLatitude(), $city->getLongitude()); return Sphere::distance2PointsOnSphere($this->lat, $this->long, $city->getLatitude(), $city->getLongitude());
} }

View File

@ -73,7 +73,7 @@ class CityPool implements \Countable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getCity(\int $index) : City public function getCity(int $index) : City
{ {
return array_values($this->cities)[$index]; return array_values($this->cities)[$index];
} }
@ -96,12 +96,12 @@ class CityPool implements \Countable
* *
* @param City $city City * @param City $city City
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function hasCity(City $city) : \bool public function hasCity(City $city) : bool
{ {
foreach ($this->cities as $c) { foreach ($this->cities as $c) {
if ($c->equals($city)) { if ($c->equals($city)) {
@ -115,12 +115,12 @@ class CityPool implements \Countable
/** /**
* Count cities * Count cities
* *
* @return \int * @return int
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function count() : \int public function count() : int
{ {
return count($this->cities); return count($this->cities);
} }

View File

@ -47,7 +47,7 @@ class Population implements \Countable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function __construct(CityPool $pool, \int $size, \bool $initialize = false) public function __construct(CityPool $pool, int $size, bool $initialize = false)
{ {
if ($initialize) { if ($initialize) {
for ($i = 0; $i < $size; $i++) { for ($i = 0; $i < $size; $i++) {
@ -65,7 +65,7 @@ class Population implements \Countable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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); $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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setTour(\int $index, Tour $tour) public function setTour(int $index, Tour $tour)
{ {
$this->tours[$index] = $tour; $this->tours[$index] = $tour;
asort($this->tours); asort($this->tours);
@ -108,7 +108,7 @@ class Population implements \Countable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getTour(\int $index) public function getTour(int $index)
{ {
return $this->tours[$index] ?? null; return $this->tours[$index] ?? null;
} }
@ -165,7 +165,7 @@ class Population implements \Countable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function count() : \int public function count() : int
{ {
return count($this->tours); return count($this->tours);
} }

View File

@ -70,7 +70,7 @@ class Tour implements \Countable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function __construct(CityPool $pool, \bool $initialize = false) public function __construct(CityPool $pool, bool $initialize = false)
{ {
$this->cityPool = $pool; $this->cityPool = $pool;
@ -103,7 +103,7 @@ class Tour implements \Countable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getFitness() : \float public function getFitness() : float
{ {
if ($this->fitness === 0.0 && ($distance = $this->getDistance()) !== 0.0) { if ($this->fitness === 0.0 && ($distance = $this->getDistance()) !== 0.0) {
$this->fitness = 1 / $distance; $this->fitness = 1 / $distance;
@ -137,7 +137,7 @@ class Tour implements \Countable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setCity(\int $index, City $city) public function setCity(int $index, City $city)
{ {
$this->cities[$index] = $city; $this->cities[$index] = $city;
asort($this->cities); asort($this->cities);
@ -154,7 +154,7 @@ class Tour implements \Countable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getDistance() : \float public function getDistance() : float
{ {
if ($this->distance === 0.0) { if ($this->distance === 0.0) {
$distance = 0.0; $distance = 0.0;
@ -178,12 +178,12 @@ class Tour implements \Countable
* *
* @param City $city City * @param City $city City
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function hasCity(City $city) : \bool public function hasCity(City $city) : bool
{ {
foreach ($this->cities as $c) { foreach ($this->cities as $c) {
if ($c->equals($city)) { if ($c->equals($city)) {
@ -202,7 +202,7 @@ class Tour implements \Countable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function count() : \int public function count() : int
{ {
return count($this->cities); return count($this->cities);
} }

View File

@ -39,7 +39,7 @@ class Circle
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getArea(\float $r) public static function getArea(float $r)
{ {
return pi() * $r ** 2; return pi() * $r ** 2;
} }
@ -54,7 +54,7 @@ class Circle
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getCircumference(\float $r) public static function getCircumference(float $r)
{ {
return 2 * pi() * $r; return 2 * pi() * $r;
} }
@ -69,7 +69,7 @@ class Circle
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getRadiusByArea(\float $area) public static function getRadiusByArea(float $area)
{ {
return sqrt($area / pi()); return sqrt($area / pi());
} }
@ -84,7 +84,7 @@ class Circle
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getRadiusByCircumference(\float $C) public static function getRadiusByCircumference(float $C)
{ {
return $C / (2 * pi()); return $C / (2 * pi());
} }

View File

@ -45,7 +45,7 @@ class Ellipse
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getArea(\float $a, \float $b) public static function getArea(float $a, float $b)
{ {
return pi() * $a * $b; return pi() * $a * $b;
} }
@ -66,7 +66,7 @@ class Ellipse
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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); return pi() * ($a + $b) * (3 * ($a - $b) ** 2 / (($a + $b) ** 2 * (sqrt(-3 * ($a - $b) ** 2 / (($a + $b) ** 2) + 4) + 10)) + 1);
} }

View File

@ -44,7 +44,7 @@ class Polygon implements Shape2DInterface
/** /**
* Polygon perimeter. * Polygon perimeter.
* *
* @var \float * @var float
* @since 1.0.0 * @since 1.0.0
*/ */
private $perimeter = null; private $perimeter = null;
@ -52,7 +52,7 @@ class Polygon implements Shape2DInterface
/** /**
* Polygon surface. * Polygon surface.
* *
* @var \float * @var float
* @since 1.0.0 * @since 1.0.0
*/ */
private $surface = null; private $surface = null;
@ -60,7 +60,7 @@ class Polygon implements Shape2DInterface
/** /**
* Interior angle sum of the polygon. * Interior angle sum of the polygon.
* *
* @var \float * @var float
* @since 1.0.0 * @since 1.0.0
*/ */
private $interiorAngleSum = null; private $interiorAngleSum = null;
@ -68,7 +68,7 @@ class Polygon implements Shape2DInterface
/** /**
* Exterior angle sum of the polygon. * Exterior angle sum of the polygon.
* *
* @var \float * @var float
* @since 1.0.0 * @since 1.0.0
*/ */
private $exteriorAngleSum = null; private $exteriorAngleSum = null;
@ -76,7 +76,7 @@ class Polygon implements Shape2DInterface
/** /**
* Polygon barycenter. * Polygon barycenter.
* *
* @var \float[] * @var float[]
* @since 1.0.0 * @since 1.0.0
*/ */
private $barycenter = null; private $barycenter = null;
@ -84,7 +84,7 @@ class Polygon implements Shape2DInterface
/** /**
* Polygon edge length. * Polygon edge length.
* *
* @var \float * @var float
* @since 1.0.0 * @since 1.0.0
*/ */
private $edgeLength = []; private $edgeLength = [];
@ -92,7 +92,7 @@ class Polygon implements Shape2DInterface
/** /**
* Polygon inner length. * Polygon inner length.
* *
* @var \float * @var float
* @since 1.0.0 * @since 1.0.0
*/ */
private $innerLength = null; private $innerLength = null;
@ -100,7 +100,7 @@ class Polygon implements Shape2DInterface
/** /**
* Polygon inner edge angular. * Polygon inner edge angular.
* *
* @var \float * @var float
* @since 1.0.0 * @since 1.0.0
*/ */
private $innerEdgeAngular = null; private $innerEdgeAngular = null;
@ -133,9 +133,9 @@ class Polygon implements Shape2DInterface
/** /**
* Set polygon coordinate. * Set polygon coordinate.
* *
* @param \int $i Index * @param int $i Index
* @param \int|\float $x X coordinate * @param int|float $x X coordinate
* @param \int|\float $y Y coordinate * @param int|float $y Y coordinate
* *
* @return void * @return void
* *

View File

@ -40,7 +40,7 @@ class Rectangle
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getArea(\float $a, \float $b) public static function getArea(float $a, float $b)
{ {
return $a * $b; return $a * $b;
} }
@ -56,7 +56,7 @@ class Rectangle
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getPerimeter(\float $a, \float $b) public static function getPerimeter(float $a, float $b)
{ {
return 2 * ($a + $b); return 2 * ($a + $b);
} }
@ -72,7 +72,7 @@ class Rectangle
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getDiagonal(\float $a, \float $b) public static function getDiagonal(float $a, float $b)
{ {
return sqrt($a * $a + $b * $b); return sqrt($a * $a + $b * $b);
} }

View File

@ -47,7 +47,7 @@ class Trapezoid
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; return ($a + $b) / 2 * $h;
} }
@ -71,7 +71,7 @@ class Trapezoid
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; return $a + $b + $c + $d;
} }
@ -94,7 +94,7 @@ class Trapezoid
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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); return 2 * $area / ($a + $b);
} }
@ -117,7 +117,7 @@ class Trapezoid
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; return 2 * $area / $h - $b;
} }
@ -140,7 +140,7 @@ class Trapezoid
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; return 2 * $area / $h - $a;
} }
@ -164,7 +164,7 @@ class Trapezoid
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; return $perimeter - $a - $b - $d;
} }
@ -188,7 +188,7 @@ class Trapezoid
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; return $perimeter - $a - $b - $c;
} }

View File

@ -46,7 +46,7 @@ class Triangle
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getArea(\float $b, \float $h) public static function getArea(float $b, float $h)
{ {
return $h * $b / 2; return $h * $b / 2;
} }
@ -63,7 +63,7 @@ class Triangle
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getPerimeter(\float $a, \float $b, \float $c) public static function getPerimeter(float $a, float $b, float $c)
{ {
return $a + $b + $c; return $a + $b + $c;
} }
@ -79,7 +79,7 @@ class Triangle
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getHeight(\float $area, \float $b) public static function getHeight(float $area, float $b)
{ {
return 2 * $area / $b; return 2 * $area / $b;
} }

View File

@ -40,7 +40,7 @@ class Cone
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getVolume(\float $r, \float $h) public static function getVolume(float $r, float $h)
{ {
return pi() * $r ** 2 * $h / 3; return pi() * $r ** 2 * $h / 3;
} }
@ -56,7 +56,7 @@ class Cone
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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)); return pi() * $r * ($r + sqrt($h ** 2 + $r ** 2));
} }
@ -72,7 +72,7 @@ class Cone
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getSlantHeight(\float $r, \float $h) public static function getSlantHeight(float $r, float $h)
{ {
return sqrt($h ** 2 + $r ** 2); return sqrt($h ** 2 + $r ** 2);
} }
@ -88,7 +88,7 @@ class Cone
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getHeight(\float $V, \float $r) public static function getHeight(float $V, float $r)
{ {
return 4 * $V / (pi() * $r ** 2); return 4 * $V / (pi() * $r ** 2);
} }

View File

@ -41,7 +41,7 @@ class Cuboid
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getVolume(\float $a, \float $b, \float $h) public static function getVolume(float $a, float $b, float $h)
{ {
return $a * $b * $h; return $a * $b * $h;
} }
@ -58,7 +58,7 @@ class Cuboid
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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); return 2 * ($a * $b + $a * $h + $b * $h);
} }

View File

@ -40,7 +40,7 @@ class Cylinder
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getVolume(\float $r, \float $h) public static function getVolume(float $r, float $h)
{ {
return pi() * $r ** 2 * $h; return pi() * $r ** 2 * $h;
} }
@ -56,7 +56,7 @@ class Cylinder
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getSurface(\float $r, \float $h) public static function getSurface(float $r, float $h)
{ {
return 2 * pi() * ($r * $h + $r ** 2); return 2 * pi() * ($r * $h + $r ** 2);
} }
@ -72,7 +72,7 @@ class Cylinder
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getLateralSurface(\float $r, \float $h) public static function getLateralSurface(float $r, float $h)
{ {
return 2 * pi() * $r * $h; return 2 * pi() * $r * $h;
} }

View File

@ -41,7 +41,7 @@ class RectangularPyramid
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; return $a * $b * $h / 3;
} }
@ -58,7 +58,7 @@ class RectangularPyramid
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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); 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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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); return $a * sqrt(($b / 2) ** 2 + $h ** 2) + $b * sqrt(($a / 2) ** 2 + $h ** 2);
} }

View File

@ -43,7 +43,7 @@ class Sphere
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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); $latFrom = deg2rad($latStart);
$lonFrom = deg2rad($longStart); $lonFrom = deg2rad($longStart);
@ -73,7 +73,7 @@ class Sphere
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getVolume(\float $r) public static function getVolume(float $r)
{ {
return 4 / 3 * pi() * $r ** 3; return 4 / 3 * pi() * $r ** 3;
} }
@ -88,7 +88,7 @@ class Sphere
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getRadiusByVolume(\float $V) public static function getRadiusByVolume(float $V)
{ {
return pow($V * 3 / (4 * pi()), 1 / 3); return pow($V * 3 / (4 * pi()), 1 / 3);
} }
@ -103,7 +103,7 @@ class Sphere
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getSurface(\float $r) public static function getSurface(float $r)
{ {
return 4 * pi() * $r ** 2; return 4 * pi() * $r ** 2;
} }
@ -118,7 +118,7 @@ class Sphere
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getRadiusBySurface(\float $S) public static function getRadiusBySurface(float $S)
{ {
return sqrt($S / (4 * pi())); return sqrt($S / (4 * pi()));
} }

View File

@ -39,7 +39,7 @@ class Tetrahedron
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getVolume(\float $a) public static function getVolume(float $a)
{ {
return $a ** 3 / (6 * sqrt(2)); return $a ** 3 / (6 * sqrt(2));
} }
@ -54,7 +54,7 @@ class Tetrahedron
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getSurface(\float $a) public static function getSurface(float $a)
{ {
return sqrt(3) * $a ** 2; return sqrt(3) * $a ** 2;
} }
@ -69,7 +69,7 @@ class Tetrahedron
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getFaceArea(\float $a) public static function getFaceArea(float $a)
{ {
return sqrt(3) / 4 * $a ** 2; return sqrt(3) / 4 * $a ** 2;
} }

View File

@ -45,7 +45,7 @@ class Average
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function weightedAverage(array $values, array $weight) : \float public static function weightedAverage(array $values, array $weight) : float
{ {
if (($count = count($values)) !== count($weight)) { if (($count = count($values)) !== count($weight)) {
throw new \Exception('Dimension'); throw new \Exception('Dimension');
@ -93,7 +93,7 @@ class Average
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function median(array $values) : \float public static function median(array $values) : float
{ {
sort($values); sort($values);
$count = count($values); $count = count($values);
@ -116,7 +116,7 @@ class Average
* Example: ([1, 2, 2, 3, 4, 4, 2]) * Example: ([1, 2, 2, 3, 4, 4, 2])
* *
* @param array $values Values * @param array $values Values
* @param \int $offset Offset for outlier * @param int $offset Offset for outlier
* *
* @return float * @return float
* *
@ -125,7 +125,7 @@ class Average
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function arithmeticMean(array $values, \int $offset = 0) public static function arithmeticMean(array $values, int $offset = 0)
{ {
sort($values); sort($values);
@ -148,7 +148,7 @@ class Average
* Example: ([1, 2, 2, 3, 4, 4, 2]) * Example: ([1, 2, 2, 3, 4, 4, 2])
* *
* @param array $values Values * @param array $values Values
* @param \int $offset Offset for outlier * @param int $offset Offset for outlier
* *
* @return float * @return float
* *
@ -157,7 +157,7 @@ class Average
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function geometricMean(array $values, \int $offset = 0) public static function geometricMean(array $values, int $offset = 0)
{ {
sort($values); sort($values);
@ -180,7 +180,7 @@ class Average
* Example: ([1, 2, 2, 3, 4, 4, 2]) * Example: ([1, 2, 2, 3, 4, 4, 2])
* *
* @param array $values Values * @param array $values Values
* @param \int $offset Offset for outlier * @param int $offset Offset for outlier
* *
* @return float * @return float
* *
@ -189,7 +189,7 @@ class Average
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function harmonicMean(array $values, \int $offset = 0) public static function harmonicMean(array $values, int $offset = 0)
{ {
sort($values); sort($values);
@ -217,14 +217,14 @@ class Average
* Example: ([1, 2, 2, 3, 4, 4, 2]) * Example: ([1, 2, 2, 3, 4, 4, 2])
* *
* @param array $angles Angles * @param array $angles Angles
* @param \int $offset Offset for outlier * @param int $offset Offset for outlier
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function angleMean($angles, \int $offset = 0) public static function angleMean($angles, int $offset = 0)
{ {
sort($angles); sort($angles);
@ -260,7 +260,7 @@ class Average
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function timeToAngle(\string $time) : \float public static function timeToAngle(string $time) : float
{ {
$parts = explode(':', $time); $parts = explode(':', $time);
@ -288,7 +288,7 @@ class Average
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function angleToTime(\float $angle) : \string public static function angleToTime(float $angle) : string
{ {
$sec = 86400.0 * $angle / 360.0; $sec = 86400.0 * $angle / 360.0;
$time = sprintf('%02d:%02d:%02d', floor($sec / 3600), floor(($sec % 3600) / 60), $sec % 60); $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]) * Example: ([1, 2, 2, 3, 4, 4, 2])
* *
* @param array $angles Angles * @param array $angles Angles
* @param \int $offset Offset for outlier * @param int $offset Offset for outlier
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function angleMean2(array $angles, \int $offset = 0) public static function angleMean2(array $angles, int $offset = 0)
{ {
sort($angles); sort($angles);

View File

@ -42,7 +42,7 @@ class MeasureOfDispersion
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function range(array $values) : \float public static function range(array $values) : float
{ {
sort($values); sort($values);
$end = end($values); $end = end($values);
@ -65,7 +65,7 @@ class MeasureOfDispersion
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function empiricalVariance(array $values) : \float public static function empiricalVariance(array $values) : float
{ {
$count = count($values); $count = count($values);
@ -97,7 +97,7 @@ class MeasureOfDispersion
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function sampleVariance(array $values) : \float public static function sampleVariance(array $values) : float
{ {
$count = count($values); $count = count($values);
@ -120,7 +120,7 @@ class MeasureOfDispersion
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function standardDeviation(array $values) : \float public static function standardDeviation(array $values) : float
{ {
return sqrt(self::sampleVariance($values)); return sqrt(self::sampleVariance($values));
} }
@ -139,7 +139,7 @@ class MeasureOfDispersion
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function empiricalVariationcoefficient(array $values) : \float public static function empiricalVariationcoefficient(array $values) : float
{ {
$mean = Average::arithmeticMean($values); $mean = Average::arithmeticMean($values);
@ -165,7 +165,7 @@ class MeasureOfDispersion
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function empiricalCovariance(array $x, array $y) : \float public static function empiricalCovariance(array $x, array $y) : float
{ {
$count = count($x); $count = count($x);
@ -202,7 +202,7 @@ class MeasureOfDispersion
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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)); return self::empiricalCovariance($x, $y) / sqrt(self::empiricalCovariance($x, $x) * self::empiricalCovariance($y, $y));
} }

View File

@ -42,7 +42,7 @@ class BernulliDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getPmf(\float $p, \int $k) : \float public static function getPmf(float $p, int $k) : float
{ {
if ($k === 0) { if ($k === 0) {
return 1 - $p; return 1 - $p;
@ -56,14 +56,14 @@ class BernulliDistribution
/** /**
* Get mode. * Get mode.
* *
* @param \float $p * @param float $p
* *
* @return int * @return int
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMode(\float $p) : \int public static function getMode(float $p) : int
{ {
if ($p === 0.5) { if ($p === 0.5) {
return 0; return 0;
@ -77,14 +77,14 @@ class BernulliDistribution
/** /**
* Get expected value. * Get expected value.
* *
* @param \float $p * @param float $p
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMean(\float $p) : \float public static function getMean(float $p) : float
{ {
return $p; return $p;
} }
@ -92,14 +92,14 @@ class BernulliDistribution
/** /**
* Get expected value. * Get expected value.
* *
* @param \float $p * @param float $p
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMedian(\float $p) : \float public static function getMedian(float $p) : float
{ {
if ($p === 0.5) { if ($p === 0.5) {
return 0.5; return 0.5;
@ -113,14 +113,14 @@ class BernulliDistribution
/** /**
* Get variance. * Get variance.
* *
* @param \float $p * @param float $p
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getVariance(\float $p) : \float public static function getVariance(float $p) : float
{ {
return $p * (1 - $p); return $p * (1 - $p);
} }
@ -136,7 +136,7 @@ class BernulliDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMgf(\float $p, \float $t) : \float public static function getMgf(float $p, float $t) : float
{ {
return (1 - $p) + $p * exp($t); return (1 - $p) + $p * exp($t);
} }
@ -151,7 +151,7 @@ class BernulliDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getSkewness(\float $p) : \float public static function getSkewness(float $p) : float
{ {
return (1 - 2 * $p) / sqrt($p * (1 - $p)); return (1 - 2 * $p) / sqrt($p * (1 - $p));
} }
@ -166,7 +166,7 @@ class BernulliDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getFisherInformation(\float $p) : \float public static function getFisherInformation(float $p) : float
{ {
return 1 / ($p * (1 - $p)); return 1 / ($p * (1 - $p));
} }
@ -181,7 +181,7 @@ class BernulliDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getExKurtosis(\float $p) : \float public static function getExKurtosis(float $p) : float
{ {
return (1 - 6 * $p * (1 - $p)) / ($p * (1 - $p)); return (1 - 6 * $p * (1 - $p)) / ($p * (1 - $p));
} }

View File

@ -44,7 +44,7 @@ class BinomialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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)) { if (($temp = ($n + 1) * $p) === 0 || !is_int($temp)) {
return floor($temp); return floor($temp);
@ -71,7 +71,7 @@ class BinomialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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); return Functions::binomialCoefficient($n, $k) * pow($p, $k) * pow(1 - $p, $n - $k);
} }
@ -88,7 +88,7 @@ class BinomialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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); return pow(1 - $p + $p * exp($t), $n);
} }
@ -104,7 +104,7 @@ class BinomialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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)); return (1 - 2 * $p) / sqrt($n * $p * (1 - $p));
} }
@ -120,7 +120,7 @@ class BinomialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getFisherInformation(\int $n, \float $p) : \float public static function getFisherInformation(int $n, float $p) : float
{ {
return $n / ($p * (1 - $p)); return $n / ($p * (1 - $p));
} }
@ -136,7 +136,7 @@ class BinomialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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)); return (1 - 6 * $p * (1 - $p)) / ($n * $p * (1 - $p));
} }
@ -153,7 +153,7 @@ class BinomialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; $sum = 0.0;
@ -175,7 +175,7 @@ class BinomialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMedian(\int $n, \float $p) : \float public static function getMedian(int $n, float $p) : float
{ {
return floor($n * $p); return floor($n * $p);
} }
@ -191,7 +191,7 @@ class BinomialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMean(\int $n, \float $p) : \float public static function getMean(int $n, float $p) : float
{ {
return $n * $p; return $n * $p;
} }
@ -207,7 +207,7 @@ class BinomialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getVariance(\int $n, \float $p) : \float public static function getVariance(int $n, float $p) : float
{ {
return $n * $p * (1 - $p); return $n * $p * (1 - $p);
} }

View File

@ -41,7 +41,7 @@ class CauchyDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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)); return 1 / (pi() * $gamma * (1 + (($x - $x0) / $gamma) ** 2));
} }
@ -58,7 +58,7 @@ class CauchyDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; return 1 / pi() * atan(($x - $x0) / $gamma) + 0.5;
} }
@ -73,7 +73,7 @@ class CauchyDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMode($x0) : \float public static function getMode($x0) : float
{ {
return $x0; return $x0;
} }
@ -81,14 +81,14 @@ class CauchyDistribution
/** /**
* Get expected value. * Get expected value.
* *
* @param \float $x0 * @param float $x0
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMedian(\float $x0) : \float public static function getMedian(float $x0) : float
{ {
return $x0; return $x0;
} }

View File

@ -87,7 +87,7 @@ class ChiSquaredDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getDegreesOfFreedom(array $values) : \int public static function getDegreesOfFreedom(array $values) : int
{ {
if (is_array($first = reset($values))) { if (is_array($first = reset($values))) {
return (count($values) - 1) * (count($first) - 1); return (count($values) - 1) * (count($first) - 1);
@ -111,7 +111,7 @@ class ChiSquaredDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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)) { if (($count = count($dataset)) !== count($expected)) {
throw new \Exception('Dimension'); throw new \Exception('Dimension');
@ -158,7 +158,7 @@ class ChiSquaredDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getPdf(\float $x, \int $df) : \float public static function getPdf(float $x, int $df) : float
{ {
if ($x < 0) { if ($x < 0) {
throw new \Exception('Out of bounds'); throw new \Exception('Out of bounds');
@ -170,14 +170,14 @@ class ChiSquaredDistribution
/** /**
* Get mode. * Get mode.
* *
* @param \int $df Degrees of freedom * @param int $df Degrees of freedom
* *
* @return int * @return int
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMode(\int $df) : \int public static function getMode(int $df) : int
{ {
return max([$df - 2, 0]); return max([$df - 2, 0]);
} }
@ -185,14 +185,14 @@ class ChiSquaredDistribution
/** /**
* Get expected value. * Get expected value.
* *
* @param \int $df Degrees of freedom * @param int $df Degrees of freedom
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMean(\int $df) : \float public static function getMean(int $df) : float
{ {
return $df; return $df;
} }
@ -200,14 +200,14 @@ class ChiSquaredDistribution
/** /**
* Get expected value. * Get expected value.
* *
* @param \int $df Degrees of freedom * @param int $df Degrees of freedom
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMedian(\int $df) : \float public static function getMedian(int $df) : float
{ {
return $df * (1 - 2 / (9 * $df)) ** 3; return $df * (1 - 2 / (9 * $df)) ** 3;
} }
@ -215,14 +215,14 @@ class ChiSquaredDistribution
/** /**
* Get variance. * Get variance.
* *
* @param \int $df Degrees of freedom * @param int $df Degrees of freedom
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getVariance(\int $df) : \float public static function getVariance(int $df) : float
{ {
return 2 * $df; return 2 * $df;
} }
@ -240,7 +240,7 @@ class ChiSquaredDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMgf(\int $df, \float $t) : \float public static function getMgf(int $df, float $t) : float
{ {
if ($t > 0.5) { if ($t > 0.5) {
throw new \Exception('Out of bounds'); throw new \Exception('Out of bounds');
@ -259,7 +259,7 @@ class ChiSquaredDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getSkewness(\int $df) : \float public static function getSkewness(int $df) : float
{ {
return sqrt(8 / $df); return sqrt(8 / $df);
} }
@ -274,7 +274,7 @@ class ChiSquaredDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getExKurtosis(\int $df) : \float public static function getExKurtosis(int $df) : float
{ {
return 12 / $df; return 12 / $df;
} }

View File

@ -40,7 +40,7 @@ class ExponentialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; return $x >= 0 ? $lambda * exp(-$lambda * $x) : 0;
} }
@ -56,7 +56,7 @@ class ExponentialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; return $x >= 0 ? 1 - exp($lambda * $x) : 0;
} }
@ -69,7 +69,7 @@ class ExponentialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMode() : \float public static function getMode() : float
{ {
return 0; return 0;
} }
@ -77,14 +77,14 @@ class ExponentialDistribution
/** /**
* Get expected value. * Get expected value.
* *
* @param \float $lambda * @param float $lambda
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMean(\float $lambda) : \float public static function getMean(float $lambda) : float
{ {
return 1 / $lambda; return 1 / $lambda;
} }
@ -92,14 +92,14 @@ class ExponentialDistribution
/** /**
* Get expected value. * Get expected value.
* *
* @param \float $lambda * @param float $lambda
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMedian(\float $lambda) : \float public static function getMedian(float $lambda) : float
{ {
return 1 / $lambda; return 1 / $lambda;
} }
@ -107,14 +107,14 @@ class ExponentialDistribution
/** /**
* Get variance. * Get variance.
* *
* @param \float $lambda * @param float $lambda
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getVariance(\float $lambda) : \float public static function getVariance(float $lambda) : float
{ {
return pow($lambda, -2); return pow($lambda, -2);
} }
@ -132,7 +132,7 @@ class ExponentialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMgf(\float $t, \float $lambda) : \float public static function getMgf(float $t, float $lambda) : float
{ {
if ($t >= $lambda) { if ($t >= $lambda) {
throw new \Exception('Out of bounds'); throw new \Exception('Out of bounds');
@ -149,7 +149,7 @@ class ExponentialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getSkewness() : \float public static function getSkewness() : float
{ {
return 2; return 2;
} }
@ -162,7 +162,7 @@ class ExponentialDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getExKurtosis() : \float public static function getExKurtosis() : float
{ {
return 6; return 6;
} }

View File

@ -42,7 +42,7 @@ class GeometricDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; return pow(1 - $p, $k - 1) * $p;
} }
@ -60,7 +60,7 @@ class GeometricDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getCdf(\float $p, \int $k) : \float public static function getCdf(float $p, int $k) : float
{ {
return 1 - pow(1 - $p, $k); return 1 - pow(1 - $p, $k);
} }
@ -73,7 +73,7 @@ class GeometricDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMode() : \int public static function getMode() : int
{ {
return 1; return 1;
} }
@ -81,14 +81,14 @@ class GeometricDistribution
/** /**
* Get expected value. * Get expected value.
* *
* @param \float $p * @param float $p
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMean(\float $p) : \float public static function getMean(float $p) : float
{ {
return 1 / $p; return 1 / $p;
} }
@ -96,14 +96,14 @@ class GeometricDistribution
/** /**
* Get expected value. * Get expected value.
* *
* @param \float $p * @param float $p
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMedian(\float $p) : \float public static function getMedian(float $p) : float
{ {
return ceil(-1 / (log(1 - $p, 2))); return ceil(-1 / (log(1 - $p, 2)));
} }
@ -111,14 +111,14 @@ class GeometricDistribution
/** /**
* Get variance. * Get variance.
* *
* @param \float $p * @param float $p
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getVariance(\float $p) : \float public static function getVariance(float $p) : float
{ {
return (1 - $p) / $p ** 2; return (1 - $p) / $p ** 2;
} }
@ -134,7 +134,7 @@ class GeometricDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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)); return $p * exp($t) / (1 - (1 - $p) * exp($t));
} }
@ -149,7 +149,7 @@ class GeometricDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getSkewness(\float $lambda) : \float public static function getSkewness(float $lambda) : float
{ {
return (2 - $p) / sqrt(1 - $p); return (2 - $p) / sqrt(1 - $p);
} }
@ -164,7 +164,7 @@ class GeometricDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getExKurtosis(\float $lambda) : \float public static function getExKurtosis(float $lambda) : float
{ {
return 6 + $p ** 2 / (1 - $p); return 6 + $p ** 2 / (1 - $p);
} }

View File

@ -41,7 +41,7 @@ class LaplaceDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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); return 1 / (2 * $b) * exp(-abs($x - $mu) / $b);
} }
@ -58,7 +58,7 @@ class LaplaceDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; return $x < $mu ? exp(($x - $mu) / $b) / 2 : 1 - exp(-($x - $mu) / $b) / 2;
} }
@ -66,14 +66,14 @@ class LaplaceDistribution
/** /**
* Get mode. * Get mode.
* *
* @param \float $mu * @param float $mu
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMode(\float $mu) : \float public static function getMode(float $mu) : float
{ {
return $mu; return $mu;
} }
@ -81,14 +81,14 @@ class LaplaceDistribution
/** /**
* Get expected value. * Get expected value.
* *
* @param \float $mu * @param float $mu
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMean(\float $mu) : \float public static function getMean(float $mu) : float
{ {
return $mu; return $mu;
} }
@ -96,14 +96,14 @@ class LaplaceDistribution
/** /**
* Get expected value. * Get expected value.
* *
* @param \float $mu * @param float $mu
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMedian(\float $mu) : \float public static function getMedian(float $mu) : float
{ {
return $mu; return $mu;
} }
@ -111,14 +111,14 @@ class LaplaceDistribution
/** /**
* Get variance. * Get variance.
* *
* @param \float $b * @param float $b
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getVariance(\float $b) : \float public static function getVariance(float $b) : float
{ {
return 2 * $b ** 2; return 2 * $b ** 2;
} }
@ -137,7 +137,7 @@ class LaplaceDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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) { if ($t >= 1 / $b) {
throw new \Exception('Out of bounds'); throw new \Exception('Out of bounds');
@ -154,7 +154,7 @@ class LaplaceDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getSkewness() : \float public static function getSkewness() : float
{ {
return 0; return 0;
} }
@ -167,7 +167,7 @@ class LaplaceDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getExKurtosis() : \float public static function getExKurtosis() : float
{ {
return 3; return 3;
} }

View File

@ -42,7 +42,7 @@ class NormalDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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)); return 1 / ($sig * sqrt(2 * pi())) * exp(-($x - $mu) ** 2 / (2 * $sig ** 2));
} }
@ -50,14 +50,14 @@ class NormalDistribution
/** /**
* Get mode. * Get mode.
* *
* @param \float $mu * @param float $mu
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMode(\float $mu) : \float public static function getMode(float $mu) : float
{ {
return $mu; return $mu;
} }
@ -65,14 +65,14 @@ class NormalDistribution
/** /**
* Get expected value. * Get expected value.
* *
* @param \float $mu * @param float $mu
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMean(\float $mu) : \float public static function getMean(float $mu) : float
{ {
return $mu; return $mu;
} }
@ -80,14 +80,14 @@ class NormalDistribution
/** /**
* Get expected value. * Get expected value.
* *
* @param \float $mu * @param float $mu
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMedian(\float $mu) : \float public static function getMedian(float $mu) : float
{ {
return $mu; return $mu;
} }
@ -95,14 +95,14 @@ class NormalDistribution
/** /**
* Get variance. * Get variance.
* *
* @param \float $sig * @param float $sig
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getVariance(\float $sig) : \float public static function getVariance(float $sig) : float
{ {
return $sig ** 2; return $sig ** 2;
} }
@ -119,7 +119,7 @@ class NormalDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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); return exp($mu * $t + ($sig ** 2 * $t ** 2) / 2);
} }
@ -132,7 +132,7 @@ class NormalDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getSkewness() : \float public static function getSkewness() : float
{ {
return 0; return 0;
} }
@ -147,7 +147,7 @@ class NormalDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getFisherInformation(\float $sig) : \float public static function getFisherInformation(float $sig) : float
{ {
return [[1 / $sig ** 2, 0], [0, 1 / (2 * $sig ** 4)]]; return [[1 / $sig ** 2, 0], [0, 1 / (2 * $sig ** 4)]];
} }
@ -160,7 +160,7 @@ class NormalDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getExKurtosis() : \float public static function getExKurtosis() : float
{ {
return 0; return 0;
} }

View File

@ -43,7 +43,7 @@ class PoissonDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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))); return exp($k * log($lambda) - $lambda - log(Functions::getGammaInteger($k + 1)));
} }
@ -59,7 +59,7 @@ class PoissonDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getCdf(\int $k, \float $lambda) : \float public static function getCdf(int $k, float $lambda) : float
{ {
$sum = 0.0; $sum = 0.0;
@ -73,14 +73,14 @@ class PoissonDistribution
/** /**
* Get mode. * Get mode.
* *
* @param \float $lambda Lambda * @param float $lambda Lambda
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMode(\float $lambda) : \float public static function getMode(float $lambda) : float
{ {
return floor($lambda); return floor($lambda);
} }
@ -88,14 +88,14 @@ class PoissonDistribution
/** /**
* Get expected value. * Get expected value.
* *
* @param \float $lambda Lambda * @param float $lambda Lambda
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMean(\float $lambda) : \float public static function getMean(float $lambda) : float
{ {
return $lambda; return $lambda;
} }
@ -103,14 +103,14 @@ class PoissonDistribution
/** /**
* Get expected value. * Get expected value.
* *
* @param \float $lambda Lambda * @param float $lambda Lambda
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMedian(\float $lambda) : \float public static function getMedian(float $lambda) : float
{ {
return floor($lambda + 1 / 3 - 0.02 / $lambda); return floor($lambda + 1 / 3 - 0.02 / $lambda);
} }
@ -118,14 +118,14 @@ class PoissonDistribution
/** /**
* Get variance. * Get variance.
* *
* @param \float $lambda Lambda * @param float $lambda Lambda
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getVariance(\float $lambda) : \float public static function getVariance(float $lambda) : float
{ {
return $lambda; return $lambda;
} }
@ -141,7 +141,7 @@ class PoissonDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMgf(\float $lambda, \float $t) : \float public static function getMgf(float $lambda, float $t) : float
{ {
return exp($lambda * (exp($t) - 1)); return exp($lambda * (exp($t) - 1));
} }
@ -156,7 +156,7 @@ class PoissonDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getSkewness(\float $lambda) : \float public static function getSkewness(float $lambda) : float
{ {
return pow($lambda, -1 / 2); return pow($lambda, -1 / 2);
} }
@ -171,7 +171,7 @@ class PoissonDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getFisherInformation(\float $lambda) : \float public static function getFisherInformation(float $lambda) : float
{ {
return pow($lambda, -1); return pow($lambda, -1);
} }
@ -186,7 +186,7 @@ class PoissonDistribution
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getExKurtosis(\float $lambda) : \float public static function getExKurtosis(float $lambda) : float
{ {
return pow($lambda, -1); return pow($lambda, -1);
} }

View File

@ -43,7 +43,7 @@ class UniformDistributionContinuous
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMode(\float $a, \float $b) : \float public static function getMode(float $a, float $b) : float
{ {
return ($a + $b) / 2; return ($a + $b) / 2;
} }
@ -62,7 +62,7 @@ class UniformDistributionContinuous
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; return $x > $a && $x < $b ? 1 / ($b - $a) : 0;
} }
@ -81,7 +81,7 @@ class UniformDistributionContinuous
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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) { if ($x < $a) {
return 0; return 0;
@ -104,7 +104,7 @@ class UniformDistributionContinuous
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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)); return $t === 0 ? 1 : (exp($t * $b) - exp($t * $a)) / ($t * ($b - $a));
} }
@ -117,7 +117,7 @@ class UniformDistributionContinuous
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getSkewness() : \float public static function getSkewness() : float
{ {
return 0.0; return 0.0;
} }
@ -130,7 +130,7 @@ class UniformDistributionContinuous
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getExKurtosis() : \float public static function getExKurtosis() : float
{ {
return -6 / 5; return -6 / 5;
} }
@ -146,7 +146,7 @@ class UniformDistributionContinuous
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMedian(\float $a, \float $b) : \float public static function getMedian(float $a, float $b) : float
{ {
return ($a + $b) / 2; return ($a + $b) / 2;
} }
@ -162,7 +162,7 @@ class UniformDistributionContinuous
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMean(\float $a, \float $b) : \float public static function getMean(float $a, float $b) : float
{ {
return ($a + $b) / 2; return ($a + $b) / 2;
} }
@ -178,7 +178,7 @@ class UniformDistributionContinuous
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getVariance(\float $a, \float $b) : \float public static function getVariance(float $a, float $b) : float
{ {
return 1 / 12 * ($b - $a) ** 2; return 1 / 12 * ($b - $a) ** 2;
} }

View File

@ -33,7 +33,7 @@ class UniformDistributionDiscrete
/** /**
* Get probability mass function. * Get probability mass function.
* *
* @param \float $a * @param float $a
* @param float $b * @param float $b
* *
* @return float * @return float
@ -41,7 +41,7 @@ class UniformDistributionDiscrete
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getPmf(\float $a, \float $b) : \float public static function getPmf(float $a, float $b) : float
{ {
return 1 / ($b - $a + 1); return 1 / ($b - $a + 1);
} }
@ -60,7 +60,7 @@ class UniformDistributionDiscrete
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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) { if ($k > $b || $k < $a) {
throw new \Exception('Out of bounds'); throw new \Exception('Out of bounds');
@ -81,7 +81,7 @@ class UniformDistributionDiscrete
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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))); return (exp($a * $t) - exp(($b + 1) * $t)) / (($b - $a + 1) * (1 - exp($t)));
} }
@ -94,7 +94,7 @@ class UniformDistributionDiscrete
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getSkewness() : \float public static function getSkewness() : float
{ {
return 0.0; return 0.0;
} }
@ -110,7 +110,7 @@ class UniformDistributionDiscrete
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getExKurtosis(\float $a, \float $b) : \float public static function getExKurtosis(float $a, float $b) : float
{ {
$n = ($b - $a + 1); $n = ($b - $a + 1);
@ -128,7 +128,7 @@ class UniformDistributionDiscrete
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMedian(\float $a, \float $b) : \float public static function getMedian(float $a, float $b) : float
{ {
return ($a + $b) / 2; return ($a + $b) / 2;
} }
@ -144,7 +144,7 @@ class UniformDistributionDiscrete
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public static function getMean(\float $a, \float $b) : \float public static function getMean(float $a, float $b) : float
{ {
return ($a + $b) / 2; return ($a + $b) / 2;
} }
@ -160,7 +160,7 @@ class UniformDistributionDiscrete
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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; return (($b - $a + 1) ** 2 - 1) / 12;
} }

View File

@ -72,7 +72,7 @@ class Request extends RequestAbstract
/** /**
* Request information. * Request information.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
private $info = null; private $info = null;
@ -80,12 +80,12 @@ class Request extends RequestAbstract
/** /**
* Constructor. * Constructor.
* *
* @param \string $rootPath relative installation path * @param string $rootPath relative installation path
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function __construct(\string $rootPath) public function __construct(string $rootPath)
{ {
$this->uri = new Http($rootPath); $this->uri = new Http($rootPath);
$this->l11n = new Localization(); $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 * 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 * @return void
* *
@ -106,7 +106,7 @@ class Request extends RequestAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function init(\string $uri = null) public function init(string $uri = null)
{ {
if ($uri === null) { if ($uri === null) {
$this->data = $_GET ?? []; $this->data = $_GET ?? [];
@ -165,7 +165,7 @@ class Request extends RequestAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function isMobile() : \bool public function isMobile() : bool
{ {
// TODO: maybe replace this with smart media queries... checked gets handled in reverse!!! // TODO: maybe replace this with smart media queries... checked gets handled in reverse!!!
$useragent = $_SERVER['HTTP_USER_AGENT']; $useragent = $_SERVER['HTTP_USER_AGENT'];
@ -197,12 +197,12 @@ class Request extends RequestAbstract
* *
* @param array $request Request array * @param array $request Request array
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private function hashRequest(array $request) : \string private function hashRequest(array $request) : string
{ {
return sha1(implode('', $request)); return sha1(implode('', $request));
} }
@ -284,7 +284,7 @@ class Request extends RequestAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getOrigin() : \string public function getOrigin() : string
{ {
return $_SERVER['REMOTE_ADDR']; return $_SERVER['REMOTE_ADDR'];
} }
@ -292,14 +292,14 @@ class Request extends RequestAbstract
/** /**
* Is request made via https. * Is request made via https.
* *
* @param \int $port Secure port * @param int $port Secure port
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function isHttps(\int $port = 443) : \bool public function isHttps(int $port = 443) : bool
{ {
if ($port < 1 || $port > 65535) { if ($port < 1 || $port > 65535) {
throw new \OutOfRangeException('Value "' . $port . '" is out of range.'); throw new \OutOfRangeException('Value "' . $port . '" is out of range.');
@ -315,7 +315,7 @@ class Request extends RequestAbstract
/** /**
* Stringify request. * Stringify request.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
@ -331,12 +331,12 @@ class Request extends RequestAbstract
/** /**
* Get request type. * Get request type.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getMethod() : \string public function getMethod() : string
{ {
if (!isset($this->type)) { if (!isset($this->type)) {
$this->type = $_SERVER['REQUEST_METHOD']; $this->type = $_SERVER['REQUEST_METHOD'];
@ -348,7 +348,7 @@ class Request extends RequestAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getProtocolVersion() : \string public function getProtocolVersion() : string
{ {
return $_SERVER['SERVER_PROTOCOL']; return $_SERVER['SERVER_PROTOCOL'];
} }
@ -364,7 +364,7 @@ class Request extends RequestAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function hasHeader(\string $name) : \bool public function hasHeader(string $name) : bool
{ {
return array_key_exists($name, getallheaders()); return array_key_exists($name, getallheaders());
} }
@ -372,7 +372,7 @@ class Request extends RequestAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getHeader(\string $name) : \string public function getHeader(string $name) : string
{ {
return getallheaders()[$name]; return getallheaders()[$name];
} }
@ -380,7 +380,7 @@ class Request extends RequestAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getBody() : \string public function getBody() : string
{ {
return file_get_contents('php://input'); return file_get_contents('php://input');
} }
@ -388,7 +388,7 @@ class Request extends RequestAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getRequestTarget() : \string public function getRequestTarget() : string
{ {
return '/'; return '/';
} }
@ -406,7 +406,7 @@ class Request extends RequestAbstract
return $this->files; 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 // NOT Required for Http request
} }
@ -419,7 +419,7 @@ class Request extends RequestAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getRoutify() : \string public function getRoutify() : string
{ {
return $this->uri->__toString(); return $this->uri->__toString();
} }

View File

@ -38,7 +38,7 @@ class Response extends ResponseAbstract implements RenderableInterface
/** /**
* Header. * Header.
* *
* @var \string[][] * @var string[][]
* @since 1.0.0 * @since 1.0.0
*/ */
private $header = []; private $header = [];
@ -83,14 +83,14 @@ class Response extends ResponseAbstract implements RenderableInterface
/** /**
* Remove header by ID. * Remove header by ID.
* *
* @param \int $key Header key * @param int $key Header key
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function removeHeader(\int $key) : \bool public function removeHeader(int $key) : bool
{ {
if (isset($this->header[$key])) { if (isset($this->header[$key])) {
unset($this->header[$key]); unset($this->header[$key]);
@ -104,14 +104,14 @@ class Response extends ResponseAbstract implements RenderableInterface
/** /**
* Generate header automatically based on code. * Generate header automatically based on code.
* *
* @param \int $code HTTP status code * @param int $code HTTP status code
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function generateHeader(\int $code) public function generateHeader(int $code)
{ {
if ($code === 403) { if ($code === 403) {
$this->setHeader('HTTP', 'HTTP/1.0 403 Forbidden'); $this->setHeader('HTTP', 'HTTP/1.0 403 Forbidden');
@ -129,14 +129,14 @@ class Response extends ResponseAbstract implements RenderableInterface
/** /**
* Set response. * Set response.
* *
* @param \string $response Response to set * @param string $response Response to set
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setResponse(\string $response) public function setResponse(string $response)
{ {
$this->response = $response; $this->response = $response;
} }
@ -144,14 +144,14 @@ class Response extends ResponseAbstract implements RenderableInterface
/** /**
* Push a specific response ID. * Push a specific response ID.
* *
* @param \int $id Response ID * @param int $id Response ID
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function pushResponseId(\int $id) public function pushResponseId(int $id)
{ {
ob_start(); ob_start();
echo $this->response[$id]; echo $this->response[$id];
@ -193,14 +193,14 @@ class Response extends ResponseAbstract implements RenderableInterface
/** /**
* Remove response by ID. * Remove response by ID.
* *
* @param \int $id Response ID * @param int $id Response ID
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function remove(\int $id) : \bool public function remove(int $id) : bool
{ {
if (isset($this->response[$id])) { if (isset($this->response[$id])) {
unset($this->response[$id]); unset($this->response[$id]);
@ -222,7 +222,7 @@ class Response extends ResponseAbstract implements RenderableInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getProtocolVersion() : \string public function getProtocolVersion() : string
{ {
return '1.0'; return '1.0';
} }
@ -238,7 +238,7 @@ class Response extends ResponseAbstract implements RenderableInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function hasHeader(\string $name) : \bool public function hasHeader(string $name) : bool
{ {
return array_key_exists($name, $this->header); return array_key_exists($name, $this->header);
} }
@ -246,7 +246,7 @@ class Response extends ResponseAbstract implements RenderableInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getBody() : \string public function getBody() : string
{ {
return $this->render(); return $this->render();
} }
@ -254,14 +254,14 @@ class Response extends ResponseAbstract implements RenderableInterface
/** /**
* Generate response. * Generate response.
* *
* @return \string * @return string
* *
* @throws \Exception * @throws \Exception
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function render() : \string public function render() : string
{ {
$render = $this->head->render(); $render = $this->head->render();
@ -284,7 +284,7 @@ class Response extends ResponseAbstract implements RenderableInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function toCsv() : \string public function toCsv() : string
{ {
return ArrayUtils::arrayToCSV($this->toArray()); return ArrayUtils::arrayToCSV($this->toArray());
} }
@ -310,7 +310,7 @@ class Response extends ResponseAbstract implements RenderableInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getReasonPhrase() : \string public function getReasonPhrase() : string
{ {
return $this->getHeader('Status'); return $this->getHeader('Status');
} }
@ -318,7 +318,7 @@ class Response extends ResponseAbstract implements RenderableInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getHeader(\string $name) public function getHeader(string $name)
{ {
if (isset($this->header[$name])) { if (isset($this->header[$name])) {
return $this->header[$name]; return $this->header[$name];
@ -330,7 +330,7 @@ class Response extends ResponseAbstract implements RenderableInterface
/** /**
* {@inheritdoc} * {@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])) { if (!$overwrite && isset($this->header[$key])) {
return false; return false;

View File

@ -51,12 +51,12 @@ class Rest
/** /**
* Set url. * Set url.
* *
* @param \string $url Url * @param string $url Url
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function setUrl(\string $url) { public function setUrl(string $url) {
if (filter_var($url, FILTER_VALIDATE_URL) === false) { if (filter_var($url, FILTER_VALIDATE_URL) === false) {
throw new InvalidUriException('$url'); throw new InvalidUriException('$url');
} }
@ -67,12 +67,12 @@ class Rest
/** /**
* Set method. * Set method.
* *
* @param \string $method Method * @param string $method Method
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function setMethod(\string $method) { public function setMethod(string $method) {
if(!RequestMethod::isValidValue($method)) { if(!RequestMethod::isValidValue($method)) {
throw new InvalidEnumValue($method); throw new InvalidEnumValue($method);
} }
@ -85,12 +85,12 @@ class Rest
* *
* @param mixed $data Data to pass * @param mixed $data Data to pass
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function callApi($data = false) : \string public function callApi($data = false) : string
{ {
$curl = curl_init(); $curl = curl_init();

View File

@ -48,7 +48,7 @@ class Imap extends Mail
return imap_get_quotaroot($this->inbox, "INBOX"); 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'); $ids = imap_search($this->inbox, $option, SE_FREE, 'UTF-8');
@ -74,22 +74,22 @@ class Imap extends Mail
return $this->getInbox('NEW'); return $this->getInbox('NEW');
} }
public function getInboxFrom(\string $from) public function getInboxFrom(string $from)
{ {
return $this->getInbox('FROM "' . $from . '"'); return $this->getInbox('FROM "' . $from . '"');
} }
public function getInboxTo(\string $to) public function getInboxTo(string $to)
{ {
return $this->getInbox('TO "' . $to . '"'); return $this->getInbox('TO "' . $to . '"');
} }
public function getInboxCc(\string $cc) public function getInboxCc(string $cc)
{ {
return $this->getInbox('CC "' . $cc . '"'); return $this->getInbox('CC "' . $cc . '"');
} }
public function getInboxBcc(\string $bcc) public function getInboxBcc(string $bcc)
{ {
return $this->getInbox('BCC "' . $bcc . '"'); return $this->getInbox('BCC "' . $bcc . '"');
} }
@ -99,7 +99,7 @@ class Imap extends Mail
return $this->getInbox('ANSWERED'); return $this->getInbox('ANSWERED');
} }
public function getInboxSubject(\string $subject) public function getInboxSubject(string $subject)
{ {
return $this->getInbox('SUBJECT "' . $subject . '"'); return $this->getInbox('SUBJECT "' . $subject . '"');
} }
@ -124,7 +124,7 @@ class Imap extends Mail
return $this->getInbox('DELETED'); return $this->getInbox('DELETED');
} }
public function getInboxText(\string $text) public function getInboxText(string $text)
{ {
return $this->getInbox('TEXT "' . $text . '"'); return $this->getInbox('TEXT "' . $text . '"');
} }

View File

@ -39,7 +39,7 @@ abstract class Mail
protected $mailer = null; protected $mailer = null;
public function __construct(\int $type) public function __construct(int $type)
{ {
$this->type = $type; $this->type = $type;

View File

@ -50,92 +50,92 @@ interface MessageInterface
/** /**
* Checks if a header exists by the given case-insensitive name. * 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 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function hasHeader(\string $name) : \bool; public function hasHeader(string $name) : bool;
/** /**
* Retrieves a message header value by the given case-insensitive name. * Retrieves a message header value by the given case-insensitive name.
* *
* @param \string $name Header name * @param string $name Header name
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getHeader(\string $name); public function getHeader(string $name);
/** /**
* Add header by ID. * Add header by ID.
* *
* @param mixed $key Header ID * @param mixed $key Header ID
* @param \string $header Header string * @param string $header Header string
* @param \bool $overwrite Overwrite existing headers * @param bool $overwrite Overwrite existing headers
* *
* @return \bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setHeader($key, \string $header, \bool $overwrite = true); public function setHeader($key, string $header, bool $overwrite = true);
/** /**
* Gets the body of the message. * Gets the body of the message.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getBody() : \string; public function getBody() : string;
/** /**
* Set status code. * Set status code.
* *
* @param \string $status Status code * @param string $status Status code
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setStatusCode(\string $status); public function setStatusCode(string $status);
/** /**
* Get status code. * Get status code.
* *
* @return \string Status code * @return string Status code
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getStatusCode() : \string; public function getStatusCode() : string;
/** /**
* Get account id. * Get account id.
* *
* @return \int Account id * @return int Account id
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getAccount() : \int; public function getAccount() : int;
/** /**
* Set account id. * Set account id.
* *
* @param \int $account Account id * @param int $account Account id
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setAccount(\int $account); public function setAccount(int $account);
} }

View File

@ -78,7 +78,7 @@ abstract class RequestAbstract implements RequestInterface
/** /**
* Account. * Account.
* *
* @var \int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
protected $account = null; protected $account = null;
@ -94,7 +94,7 @@ abstract class RequestAbstract implements RequestInterface
/** /**
* Request status. * Request status.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $status = RequestStatus::R_200; private $status = RequestStatus::R_200;
@ -156,7 +156,7 @@ abstract class RequestAbstract implements RequestInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
abstract public function getMethod() : \string; abstract public function getMethod() : string;
/** /**
* {@inheritdoc} * {@inheritdoc}
@ -209,7 +209,7 @@ abstract class RequestAbstract implements RequestInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getAccount() : \int public function getAccount() : int
{ {
return $this->account; return $this->account;
} }
@ -217,7 +217,7 @@ abstract class RequestAbstract implements RequestInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function setAccount(\int $account) public function setAccount(int $account)
{ {
$this->account = $account; $this->account = $account;
} }
@ -225,7 +225,7 @@ abstract class RequestAbstract implements RequestInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function setStatusCode(\string $status) public function setStatusCode(string $status)
{ {
$this->status = $status; $this->status = $status;
} }
@ -233,7 +233,7 @@ abstract class RequestAbstract implements RequestInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getStatusCode() : \string public function getStatusCode() : string
{ {
return $this->status; return $this->status;
} }
@ -241,7 +241,7 @@ abstract class RequestAbstract implements RequestInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public abstract function getOrigin() : \string; public abstract function getOrigin() : string;
/** /**
* {@inheritdoc} * {@inheritdoc}

View File

@ -34,22 +34,22 @@ interface RequestInterface extends MessageInterface
/** /**
* Get request target. * Get request target.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getRequestTarget() : \string; public function getRequestTarget() : string;
/** /**
* Get request method. * Get request method.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getMethod() : \string; public function getMethod() : string;
/** /**
* Get request uri. * Get request uri.
@ -64,7 +64,7 @@ interface RequestInterface extends MessageInterface
/** /**
* Get request hash. * Get request hash.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>

View File

@ -45,7 +45,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface
/** /**
* Responses. * Responses.
* *
* @var \string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected $response = []; protected $response = [];
@ -53,7 +53,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface
/** /**
* Response status. * Response status.
* *
* @var \int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
protected $status = 200; protected $status = 200;
@ -61,7 +61,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface
/** /**
* Account. * Account.
* *
* @var \int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
protected $account = null; protected $account = null;
@ -69,7 +69,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
abstract public function setHeader($key, \string $header, \bool $overwrite = true); abstract public function setHeader($key, string $header, bool $overwrite = true);
/** /**
* {@inheritdoc} * {@inheritdoc}
@ -107,14 +107,14 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface
* *
* @param mixed $key Response id * @param mixed $key Response id
* @param mixed $response Response to add * @param mixed $response Response to add
* @param \bool $overwrite Overwrite * @param bool $overwrite Overwrite
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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); $this->response = ArrayUtils::setArray($key, $this->response, $response, ':', $overwrite);
} }
@ -122,7 +122,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function setStatusCode(\string $status) public function setStatusCode(string $status)
{ {
$this->status = $status; $this->status = $status;
$this->generateHeader($status); $this->generateHeader($status);
@ -131,7 +131,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getStatusCode() : \string public function getStatusCode() : string
{ {
return $this->status; return $this->status;
} }
@ -139,7 +139,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getAccount() : \int public function getAccount() : int
{ {
return $this->account; return $this->account;
} }
@ -147,7 +147,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function setAccount(\int $account) public function setAccount(int $account)
{ {
$this->account = $account; $this->account = $account;
} }
@ -155,7 +155,7 @@ abstract class ResponseAbstract implements ResponseInterface, ArrayableInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function toJson(\int $options = 0) : \string public function toJson(int $options = 0) : string
{ {
return json_encode($this->toArray()); return json_encode($this->toArray());
} }

View File

@ -32,12 +32,12 @@ interface ResponseInterface extends MessageInterface
/** /**
* Generate header automatically based on code. * Generate header automatically based on code.
* *
* @param \int $code HTTP status code * @param int $code HTTP status code
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function generateHeader(\int $code); public function generateHeader(int $code);
} }

View File

@ -40,14 +40,14 @@ interface UploadedFileInterface
/** /**
* Move the uploaded file to a new location. * Move the uploaded file to a new location.
* *
* @param \string $targetPath Path to new location * @param string $targetPath Path to new location
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function moveTo(\string $targetPath); public function moveTo(string $targetPath);
/** /**
* Retrieve the file size. * Retrieve the file size.

View File

@ -38,7 +38,7 @@ class Head implements RenderableInterface
/** /**
* Page language. * Page language.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $language = ''; private $language = '';
@ -46,7 +46,7 @@ class Head implements RenderableInterface
/** /**
* Page title. * Page title.
* *
* @var \string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $title = ''; private $title = '';
@ -62,7 +62,7 @@ class Head implements RenderableInterface
/** /**
* Is the header set? * Is the header set?
* *
* @var \bool * @var bool
* @since 1.0.0 * @since 1.0.0
*/ */
private $hasContent = false; private $hasContent = false;
@ -118,12 +118,12 @@ class Head implements RenderableInterface
/** /**
* Set page title. * Set page title.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getTitle() : \string public function getTitle() : string
{ {
return $this->title; return $this->title;
} }
@ -131,14 +131,14 @@ class Head implements RenderableInterface
/** /**
* Set page title. * Set page title.
* *
* @param \string $title Page title * @param string $title Page title
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setTitle(\string $title) public function setTitle(string $title)
{ {
$this->title = $title; $this->title = $title;
} }
@ -146,15 +146,15 @@ class Head implements RenderableInterface
/** /**
* Set page title. * Set page title.
* *
* @param \string $type Asset type * @param string $type Asset type
* @param \string $uri Asset uri * @param string $uri Asset uri
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function addAsset(\string $type, \string $uri) public function addAsset(string $type, string $uri)
{ {
$this->assets[$uri] = $type; $this->assets[$uri] = $type;
} }
@ -162,14 +162,14 @@ class Head implements RenderableInterface
/** /**
* Set page language. * Set page language.
* *
* @param \string $language language string * @param string $language language string
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setLanguage(\string $language) public function setLanguage(string $language)
{ {
$this->language = $language; $this->language = $language;
} }
@ -177,12 +177,12 @@ class Head implements RenderableInterface
/** /**
* Get the evaluated contents of the object. * Get the evaluated contents of the object.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function render() : \string public function render() : string
{ {
$head = ''; $head = '';
if ($this->hasContent) { if ($this->hasContent) {
@ -197,12 +197,12 @@ class Head implements RenderableInterface
/** /**
* Render style. * Render style.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function renderStyle() : \string public function renderStyle() : string
{ {
$style = ''; $style = '';
foreach ($this->style as $css) { foreach ($this->style as $css) {
@ -215,12 +215,12 @@ class Head implements RenderableInterface
/** /**
* Render script. * Render script.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function renderScript() : \string public function renderScript() : string
{ {
$script = ''; $script = '';
foreach ($this->script as $js) { foreach ($this->script as $js) {
@ -233,16 +233,16 @@ class Head implements RenderableInterface
/** /**
* Set a style. * Set a style.
* *
* @param \string $key Style key * @param string $key Style key
* @param \string $style Style source * @param string $style Style source
* @param \bool $overwrite Overwrite if already existing * @param bool $overwrite Overwrite if already existing
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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])) { if ($overwrite || !isset($this->script[$key])) {
$this->style[$key] = $style; $this->style[$key] = $style;
@ -252,16 +252,16 @@ class Head implements RenderableInterface
/** /**
* Set a script. * Set a script.
* *
* @param \string $key Script key * @param string $key Script key
* @param \string $script Script source * @param string $script Script source
* @param \bool $overwrite Overwrite if already existing * @param bool $overwrite Overwrite if already existing
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
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])) { if ($overwrite || !isset($this->script[$key])) {
$this->script[$key] = $script; $this->script[$key] = $script;
@ -297,12 +297,12 @@ class Head implements RenderableInterface
/** /**
* Render assets. * Render assets.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function renderAssets() : \string public function renderAssets() : string
{ {
$asset = ''; $asset = '';
foreach ($this->assets as $uri => $type) { foreach ($this->assets as $uri => $type) {
@ -319,12 +319,12 @@ class Head implements RenderableInterface
/** /**
* Render assets. * Render assets.
* *
* @return \string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function renderAssetsLate() : \string public function renderAssetsLate() : string
{ {
$asset = ''; $asset = '';
foreach ($this->assets as $uri => $type) { foreach ($this->assets as $uri => $type) {

Some files were not shown because too many files have changed in this diff Show More