Type hint fixes/prep for null return type

This commit is contained in:
Dennis Eichhorn 2016-12-03 23:00:05 +01:00
parent ab5e11a242
commit cbc6205bf7
77 changed files with 194 additions and 187 deletions

View File

@ -101,7 +101,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 get(string $id) public function get(string $id) /* : ?string */
{ {
if (isset($this->assets[$id])) { if (isset($this->assets[$id])) {
return $this->assets[$id]; return $this->assets[$id];

View File

@ -36,7 +36,7 @@ trait OptionsTrait
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function exists($key) public function exists($key) : bool
{ {
return isset($this->options[$key]); return isset($this->options[$key]);
} }

View File

@ -63,7 +63,7 @@ class CookieJar
* @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 lock() public static function lock() /* : void */
{ {
self::$isLocked = true; self::$isLocked = true;
} }
@ -126,7 +126,7 @@ class CookieJar
* @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(string $id) public function delete(string $id) /* : void */
{ {
$this->remove($id); $this->remove($id);
setcookie($id, '', time() - 3600); setcookie($id, '', time() - 3600);
@ -156,10 +156,14 @@ class CookieJar
/** /**
* Save cookie * Save cookie
* *
* @return void
*
* @throws LockException
*
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function save() public function save() /* : void */
{ {
if (self::$isLocked) { if (self::$isLocked) {
throw new LockException('CookieJar'); throw new LockException('CookieJar');

View File

@ -68,12 +68,12 @@ abstract class BuilderAbstract
* *
* @param string $prefix Prefix * @param string $prefix Prefix
* *
* @return $this * @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) : BuilderAbstract
{ {
$this->prefix = $prefix; $this->prefix = $prefix;

View File

@ -165,7 +165,7 @@ abstract class ConnectionAbstract implements ConnectionInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function close() public function close() /* : void */
{ {
$this->con = null; $this->con = null;
$this->status = DatabaseStatus::CLOSED; $this->status = DatabaseStatus::CLOSED;

View File

@ -44,7 +44,7 @@ interface ConnectionInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function connect(array $dbdata); public function connect(array $dbdata) /* : void */;
/** /**
* Get the database type. * Get the database type.
@ -74,7 +74,7 @@ interface ConnectionInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function close(); public function close() /* : void */;
/** /**
* Return grammar for this connection. * Return grammar for this connection.

View File

@ -58,7 +58,7 @@ class MysqlConnection extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function connect(array $dbdata = null) public function connect(array $dbdata = null) /* : void */
{ {
$this->close(); $this->close();

View File

@ -57,7 +57,7 @@ class SqlServerConnection extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function connect(array $dbdata = null) public function connect(array $dbdata = null) /* : void */
{ {
$this->close(); $this->close();

View File

@ -216,7 +216,7 @@ 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>
*/ */
private static function extend($class) private static function extend($class) /* : void */
{ {
/* todo: have to implement this in the queries, so far not used */ /* todo: have to implement this in the queries, so far not used */
self::$collection['primaryField'][] = $class::$primaryField; self::$collection['primaryField'][] = $class::$primaryField;
@ -264,7 +264,7 @@ 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 static function with(...$objects) public static function with(...$objects) /* : void */
{ {
// todo: how to handle with of parent objects/extends/relations // todo: how to handle with of parent objects/extends/relations
@ -283,7 +283,7 @@ 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 static function clear() public static function clear() /* : void */
{ {
self::$overwrite = true; self::$overwrite = true;
self::$primaryField = ''; self::$primaryField = '';

View File

@ -78,15 +78,15 @@ class DatabasePool
* *
* @param mixed $key Database key * @param mixed $key Database key
* *
* @return ConnectionAbstract|false * @return ConnectionAbstract|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(string $key = 'core') public function get(string $key = 'core') /* : ?ConnectionAbstract */
{ {
if (!isset($this->pool[$key])) { if (!isset($this->pool[$key])) {
return false; /* todo: return nullconnection */ return null; /* todo: return nullconnection */
} }
return $this->pool[$key]; return $this->pool[$key];

View File

@ -481,7 +481,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 andWhere(Where $where) public function andWhere(Where $where) : Builder
{ {
$this->wheres[][] = [ $this->wheres[][] = [
'column' => $where, 'column' => $where,
@ -501,7 +501,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 orWhere(Where $where) public function orWhere(Where $where) : Builder
{ {
$this->wheres[][] = [ $this->wheres[][] = [
'column' => $where, 'column' => $where,

View File

@ -154,7 +154,7 @@ class HttpSession implements SessionInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function save() public function save() /* : void */
{ {
if(!self::$isLocked) { if(!self::$isLocked) {
$_SESSION = $this->sessionData; $_SESSION = $this->sessionData;

View File

@ -79,7 +79,7 @@ interface SessionInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function save(); public function save() /* : void */;
/** /**
* @return int|string * @return int|string
@ -97,6 +97,6 @@ interface SessionInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setSID($sid); public function setSID($sid) /* : void */;
} }

View File

@ -92,7 +92,7 @@ class SocketSession implements SessionInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function save() public function save() /* : void */
{ {
} }

View File

@ -63,7 +63,7 @@ class Iban implements \Serializable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private function parse(string $iban) private function parse(string $iban) /* : void */
{ {
$this->iban = self::normalize($iban); $this->iban = self::normalize($iban);
@ -276,7 +276,7 @@ class Iban implements \Serializable
* @return string the string representation of the object or null * @return string the string representation of the object or null
* @since 5.1.0 * @since 5.1.0
*/ */
public function serialize() /* : void */ public function serialize()
{ {
return $this->prettyPrint(); return $this->prettyPrint();
} }

View File

@ -237,7 +237,7 @@ class Location implements \JsonSerializable, \Serializable
* @return string the string representation of the object or null * @return string the string representation of the object or null
* @since 5.1.0 * @since 5.1.0
*/ */
public function serialize() /* : void */ public function serialize()
{ {
return $this->jsonSerialize(); return $this->jsonSerialize();
} }

View File

@ -75,7 +75,7 @@ class EventManager implements Mediator
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function trigger(string $group, string $id = '') public function trigger(string $group, string $id = '') /* : void */
{ {
if (isset($this->groups[$group])) { if (isset($this->groups[$group])) {
unset($this->groups[$group][$id]); unset($this->groups[$group][$id]);
@ -117,7 +117,7 @@ class EventManager implements Mediator
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function addGroup(string $group, string $id) public function addGroup(string $group, string $id) /* : void */
{ {
if (!isset($this->groups[$group])) { if (!isset($this->groups[$group])) {
$this->groups[$group] = []; $this->groups[$group] = [];

View File

@ -94,7 +94,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 $translation) public function loadLanguage(string $language, string $from, array $translation) /* : void */
{ {
if (!isset($translation[$from])) { if (!isset($translation[$from])) {
throw new \Exception('Unexpected language key: ' . $from); throw new \Exception('Unexpected language key: ' . $from);
@ -123,7 +123,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 loadLanguageFromFile(string $language, string $from, string $file) public function loadLanguageFromFile(string $language, string $from, string $file) /* : void */
{ {
$lang = []; $lang = [];
if (file_exists(file)) { if (file_exists(file)) {
@ -164,12 +164,12 @@ class L11nManager
* @param string $theme Theme * @param string $theme Theme
* @param string $translation Text * @param string $translation Text
* *
* @return array * @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 getText(string $code, string $module, string $theme, string $translation) public function getText(string $code, string $module, string $theme, string $translation) : string
{ {
if (!isset($this->language[$code][$module][$translation])) { if (!isset($this->language[$code][$module][$translation])) {
/** @var ModuleAbstract $class */ /** @var ModuleAbstract $class */

View File

@ -345,7 +345,7 @@ class Money implements \Serializable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function serialize() /* : void */ public function serialize()
{ {
return $this->getInt(); return $this->getInt();
} }

View File

@ -127,7 +127,7 @@ class FileLogger implements LoggerInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private function createFile() private function createFile() /* : void */
{ {
if (!$this->created && !file_exists($this->path)) { if (!$this->created && !file_exists($this->path)) {
File::create($this->path); File::create($this->path);
@ -306,7 +306,7 @@ class FileLogger implements LoggerInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
private function write(string $message) private function write(string $message) /* : void */
{ {
$this->createFile(); $this->createFile();
$this->fp = fopen($this->path, 'a'); $this->fp = fopen($this->path, 'a');
@ -335,7 +335,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 = []) /* : void */
{ {
$message = $this->interpolate($message, $context, LogLevel::EMERGENCY); $message = $this->interpolate($message, $context, LogLevel::EMERGENCY);
$this->write($message); $this->write($message);
@ -355,7 +355,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 = []) /* : void */
{ {
$message = $this->interpolate($message, $context, LogLevel::ALERT); $message = $this->interpolate($message, $context, LogLevel::ALERT);
$this->write($message); $this->write($message);
@ -374,7 +374,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 = []) /* : void */
{ {
$message = $this->interpolate($message, $context, LogLevel::CRITICAL); $message = $this->interpolate($message, $context, LogLevel::CRITICAL);
$this->write($message); $this->write($message);
@ -392,7 +392,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 = []) /* : void */
{ {
$message = $this->interpolate($message, $context, LogLevel::ERROR); $message = $this->interpolate($message, $context, LogLevel::ERROR);
$this->write($message); $this->write($message);
@ -412,7 +412,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 = []) /* : void */
{ {
$message = $this->interpolate($message, $context, LogLevel::WARNING); $message = $this->interpolate($message, $context, LogLevel::WARNING);
$this->write($message); $this->write($message);
@ -429,7 +429,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 = []) /* : void */
{ {
$message = $this->interpolate($message, $context, LogLevel::NOTICE); $message = $this->interpolate($message, $context, LogLevel::NOTICE);
$this->write($message); $this->write($message);
@ -448,7 +448,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 = []) /* : void */
{ {
$message = $this->interpolate($message, $context, LogLevel::INFO); $message = $this->interpolate($message, $context, LogLevel::INFO);
$this->write($message); $this->write($message);
@ -465,7 +465,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 = []) /* : void */
{ {
$message = $this->interpolate($message, $context, LogLevel::DEBUG); $message = $this->interpolate($message, $context, LogLevel::DEBUG);
$this->write($message); $this->write($message);
@ -483,7 +483,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 = []) /* : void */
{ {
if (!LogLevel::isValidValue($level)) { if (!LogLevel::isValidValue($level)) {
throw new InvalidEnumValue($level); throw new InvalidEnumValue($level);

View File

@ -37,7 +37,7 @@ interface LoggerInterface
* *
* @return null * @return null
*/ */
public function emergency(string $message, array $context = []); public function emergency(string $message, array $context = []) /* : void */;
/** /**
* Action must be taken immediately. * Action must be taken immediately.
@ -50,7 +50,7 @@ interface LoggerInterface
* *
* @return null * @return null
*/ */
public function alert(string $message, array $context = []); public function alert(string $message, array $context = []) /* : void */;
/** /**
* Critical conditions. * Critical conditions.
@ -62,7 +62,7 @@ interface LoggerInterface
* *
* @return null * @return null
*/ */
public function critical(string $message, array $context = []); public function critical(string $message, array $context = []) /* : void */;
/** /**
* Runtime errors that do not require immediate action but should typically * Runtime errors that do not require immediate action but should typically
@ -73,7 +73,7 @@ interface LoggerInterface
* *
* @return null * @return null
*/ */
public function error(string $message, array $context = []); public function error(string $message, array $context = []) /* : void */;
/** /**
* Exceptional occurrences that are not errors. * Exceptional occurrences that are not errors.
@ -86,7 +86,7 @@ interface LoggerInterface
* *
* @return null * @return null
*/ */
public function warning(string $message, array $context = []); public function warning(string $message, array $context = []) /* : void */;
/** /**
* Normal but significant events. * Normal but significant events.
@ -96,7 +96,7 @@ interface LoggerInterface
* *
* @return null * @return null
*/ */
public function notice(string $message, array $context = []); public function notice(string $message, array $context = []) /* : void */;
/** /**
* Interesting events. * Interesting events.
@ -108,7 +108,7 @@ interface LoggerInterface
* *
* @return null * @return null
*/ */
public function info(string $message, array $context = []); public function info(string $message, array $context = []) /* : void */;
/** /**
* Detailed debug information. * Detailed debug information.
@ -118,7 +118,7 @@ interface LoggerInterface
* *
* @return null * @return null
*/ */
public function debug(string $message, array $context = []); public function debug(string $message, array $context = []) /* : void */;
/** /**
* Logs with an arbitrary level. * Logs with an arbitrary level.
@ -129,5 +129,5 @@ interface LoggerInterface
* *
* @return null * @return null
*/ */
public function log(string $level, string $message, array $context = []); public function log(string $level, string $message, array $context = []) /* : void */;
} }

View File

@ -170,7 +170,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 invMod(int $a, int $n) public static function invMod(int $a, int $n) : int
{ {
if ($n < 0) { if ($n < 0) {
$n = -$n; $n = -$n;
@ -217,7 +217,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 mod($a, $b) public static function mod($a, $b) : int
{ {
if ($a < 0) { if ($a < 0) {
return ($a + $b) % $b; return ($a + $b) % $b;
@ -277,7 +277,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 getRelativeDegree($value, $length, $start = 0) public static function getRelativeDegree($value, $length, $start = 0) : int
{ {
return abs(self::mod($value - $start, $length)); return abs(self::mod($value - $start, $length));
} }

View File

@ -45,7 +45,7 @@ class Ellipse implements D2ShapeInterface
* @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) public static function getSurface(float $a, float $b) : float
{ {
return pi() * $a * $b; return pi() * $a * $b;
} }
@ -66,7 +66,7 @@ class Ellipse implements D2ShapeInterface
* @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) : float
{ {
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

@ -288,7 +288,7 @@ class Polygon implements D2ShapeInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function reset() public function reset() /* : void */
{ {
$this->coord = []; $this->coord = [];
$this->barycenter = ['x' => 0.0, 'y' => 0.0]; $this->barycenter = ['x' => 0.0, 'y' => 0.0];
@ -311,7 +311,7 @@ class Polygon implements D2ShapeInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getPerimeter() public function getPerimeter() : float
{ {
$count = count($this->coord); $count = count($this->coord);
$this->perimeter = sqrt(($this->coord[0]['x'] - $this->coord[$count - 1]['x']) ** 2 + ($this->coord[0]['y'] - $this->coord[$count - 1]['y']) ** 2); $this->perimeter = sqrt(($this->coord[0]['x'] - $this->coord[$count - 1]['x']) ** 2 + ($this->coord[0]['y'] - $this->coord[$count - 1]['y']) ** 2);

View File

@ -88,7 +88,7 @@ class Sphere implements D3ShapeInterface
* @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) : float
{ {
return pow($V * 3 / (4 * pi()), 1 / 3); return pow($V * 3 / (4 * pi()), 1 / 3);
} }
@ -108,7 +108,7 @@ class Sphere implements D3ShapeInterface
* @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) : float
{ {
return sqrt($S / (4 * pi())); return sqrt($S / (4 * pi()));
} }
@ -128,7 +128,7 @@ class Sphere implements D3ShapeInterface
* @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 getVolumeByRadius(float $r) public static function getVolumeByRadius(float $r) : float
{ {
return 4 / 3 * pi() * $r ** 3; return 4 / 3 * pi() * $r ** 3;
} }
@ -153,7 +153,7 @@ class Sphere implements D3ShapeInterface
* @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 getSurfaceByRadius(float $r) public static function getSurfaceByRadius(float $r) : float
{ {
return 4 * pi() * $r ** 2; return 4 * pi() * $r ** 2;
} }

View File

@ -158,7 +158,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) public static function arithmeticMean(array $values) : float
{ {
$count = count($values); $count = count($values);
@ -233,7 +233,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) : float
{ {
$count = count($values); $count = count($values);
@ -259,7 +259,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) : float
{ {
sort($values); sort($values);
@ -294,7 +294,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 angleMean($angles, int $offset = 0) public static function angleMean($angles, int $offset = 0) : float
{ {
$y = $x = 0; $y = $x = 0;
$size = count($angles); $size = count($angles);
@ -371,7 +371,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 angleMean2(array $angles, int $offset = 0) public static function angleMean2(array $angles, int $offset = 0) : float
{ {
sort($angles); sort($angles);

View File

@ -59,7 +59,7 @@ abstract class HeaderAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
abstract public function generate(string $statusCode); abstract public function generate(string $statusCode) /* : void */;
/** /**
* Get header by key. * Get header by key.
@ -91,7 +91,7 @@ abstract class HeaderAbstract
* @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 lock() public static function lock() /* : void */
{ {
// todo: maybe pass session as member and make lock not static // todo: maybe pass session as member and make lock not static
self::$isLocked = true; self::$isLocked = true;

View File

@ -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($uri = null) public function init($uri = null) /* : void */
{ {
if (!isset($uri)) { if (!isset($uri)) {
$this->initCurrentRequest(); $this->initCurrentRequest();
@ -135,7 +135,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>
*/ */
private function initCurrentRequest() private function initCurrentRequest() /* : void */
{ {
$this->data = $_GET ?? []; $this->data = $_GET ?? [];
$this->files = $_FILES ?? []; $this->files = $_FILES ?? [];
@ -166,7 +166,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>
*/ */
private function initPseudoRequest($uri) private function initPseudoRequest($uri) /* : void */
{ {
$this->setMethod($uri['type']); $this->setMethod($uri['type']);
$this->uri->set($uri['uri']); $this->uri->set($uri['uri']);
@ -180,7 +180,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>
*/ */
private function cleanupGlobals() private function cleanupGlobals() /* : void */
{ {
unset($_FILES); unset($_FILES);
unset($_GET); unset($_GET);
@ -224,7 +224,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>
*/ */
private function createRequestHashs() private function createRequestHashs() /* : void */
{ {
$this->hash = []; $this->hash = [];
foreach ($this->path as $key => $path) { foreach ($this->path as $key => $path) {
@ -312,12 +312,12 @@ class Request extends RequestAbstract
/** /**
* Determine request OS. * Determine request OS.
* *
* @return OSType * @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 getOS() : OSType public function getOS() : string
{ {
if (!isset($this->os)) { if (!isset($this->os)) {
$arr = OSType::getConstants(); $arr = OSType::getConstants();

View File

@ -67,7 +67,7 @@ interface MessageInterface
* @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) /* : void */;
/** /**
* Get status code. * Get status code.
@ -99,5 +99,5 @@ interface MessageInterface
* @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) /* : void */;
} }

View File

@ -227,7 +227,7 @@ abstract class RequestAbstract implements MessageInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getPath($key = null) public function getPath($key = null) /* : ?string */
{ {
if ($key === null) { if ($key === null) {
return $this->path; return $this->path;
@ -316,7 +316,7 @@ abstract class RequestAbstract implements MessageInterface
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function lock() public function lock() /* : void */
{ {
$this->lock = true; $this->lock = true;
} }

View File

@ -154,7 +154,7 @@ class Head implements RenderableInterface
* @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) /* : void */
{ {
$this->assets[$uri] = $type; $this->assets[$uri] = $type;
} }

View File

@ -43,7 +43,7 @@ class ActivateAbstract
* @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 activate(DatabasePool $dbPool, InfoManager $info) public static function activate(DatabasePool $dbPool, InfoManager $info) /* : void */
{ {
self::activateRoutes(ROOT_PATH . '/Web/Routes.php', ROOT_PATH . '/Modules/' . $info->getDirectory() . '/Admin/Routes/http.php'); self::activateRoutes(ROOT_PATH . '/Web/Routes.php', ROOT_PATH . '/Modules/' . $info->getDirectory() . '/Admin/Routes/http.php');
self::activateInDatabase($dbPool, $info); self::activateInDatabase($dbPool, $info);
@ -60,7 +60,7 @@ class ActivateAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private static function activateRoutes(string $destRoutePath, string $srcRoutePath) private static function activateRoutes(string $destRoutePath, string $srcRoutePath) /* : void */
{ {
// todo: remove route // todo: remove route
} }
@ -76,7 +76,7 @@ class ActivateAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function activateInDatabase(DatabasePool $dbPool, InfoManager $info) public static function activateInDatabase(DatabasePool $dbPool, InfoManager $info) /* : void */
{ {
switch ($dbPool->get()->getType()) { switch ($dbPool->get()->getType()) {
case DatabaseType::MYSQL: case DatabaseType::MYSQL:

View File

@ -43,7 +43,7 @@ class DeactivateAbstract
* @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 deactivate(DatabasePool $dbPool, InfoManager $info) public static function deactivate(DatabasePool $dbPool, InfoManager $info) /* : void */
{ {
self::deactivateRoutes(ROOT_PATH . '/Web/Routes.php', ROOT_PATH . '/Modules/' . $info->getDirectory() . '/Admin/Routes/http.php'); self::deactivateRoutes(ROOT_PATH . '/Web/Routes.php', ROOT_PATH . '/Modules/' . $info->getDirectory() . '/Admin/Routes/http.php');
self::deactivateInDatabase($dbPool, $info); self::deactivateInDatabase($dbPool, $info);
@ -60,7 +60,7 @@ class DeactivateAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private static function deactivateRoutes(string $destRoutePath, string $srcRoutePath) private static function deactivateRoutes(string $destRoutePath, string $srcRoutePath) /* : void */
{ {
// todo: remove route // todo: remove route
} }
@ -76,7 +76,7 @@ class DeactivateAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function deactivateInDatabase(DatabasePool $dbPool, InfoManager $info) public static function deactivateInDatabase(DatabasePool $dbPool, InfoManager $info) /* : void */
{ {
switch ($dbPool->get()->getType()) { switch ($dbPool->get()->getType()) {
case DatabaseType::MYSQL: case DatabaseType::MYSQL:

View File

@ -71,7 +71,7 @@ class InfoManager
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function load() public function load() /* : void */
{ {
if (!file_exists($this->path)) { if (!file_exists($this->path)) {
throw new PathException($this->path); throw new PathException($this->path);
@ -88,7 +88,7 @@ class InfoManager
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function update() public function update() /* : void */
{ {
file_put_contents($this->path, json_encode($this->info, JSON_PRETTY_PRINT)); file_put_contents($this->path, json_encode($this->info, JSON_PRETTY_PRINT));
} }

View File

@ -46,7 +46,7 @@ class InstallerAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public static function registerInDatabase(DatabasePool $dbPool, InfoManager $info) public static function registerInDatabase(DatabasePool $dbPool, InfoManager $info) /* : void */
{ {
switch ($dbPool->get()->getType()) { switch ($dbPool->get()->getType()) {
case DatabaseType::MYSQL: case DatabaseType::MYSQL:
@ -99,7 +99,7 @@ class InstallerAbstract
* @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 install(string $routePath, DatabasePool $dbPool, InfoManager $info) public static function install(string $routePath, DatabasePool $dbPool, InfoManager $info) /* : void */
{ {
self::registerInDatabase($dbPool, $info); self::registerInDatabase($dbPool, $info);
self::initRoutes($routePath, $info); self::initRoutes($routePath, $info);
@ -117,7 +117,7 @@ class InstallerAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private static function activate(DatabasePool $dbPool, InfoManager $info) private static function activate(DatabasePool $dbPool, InfoManager $info) /* : void */
{ {
/** @var ActivateAbstract $class */ /** @var ActivateAbstract $class */
$class = '\Modules\\' . $info->getDirectory() . '\Admin\Activate'; $class = '\Modules\\' . $info->getDirectory() . '\Admin\Activate';
@ -135,7 +135,7 @@ class InstallerAbstract
* @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 reInit(string $routePath, InfoManager $info) public static function reInit(string $routePath, InfoManager $info) /* : void */
{ {
self::initRoutes($routePath, $info); self::initRoutes($routePath, $info);
} }
@ -153,7 +153,7 @@ class InstallerAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private static function initRoutes(string $routePath, InfoManager $info) private static function initRoutes(string $routePath, InfoManager $info) /* : void */
{ {
// todo: maybe use static::__DIR__ ? // todo: maybe use static::__DIR__ ?
$directories = new Directory(ROOT_PATH . '/Modules/' . $info->getDirectory() . '/Admin/Routes'); $directories = new Directory(ROOT_PATH . '/Modules/' . $info->getDirectory() . '/Admin/Routes');
@ -180,7 +180,7 @@ class InstallerAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private static function installRoutes(string $destRoutePath, string $srcRoutePath) private static function installRoutes(string $destRoutePath, string $srcRoutePath) /* : void */
{ {
if (!file_exists($destRoutePath)) { if (!file_exists($destRoutePath)) {
file_put_contents($destRoutePath, '<?php return [];'); file_put_contents($destRoutePath, '<?php return [];');

View File

@ -105,9 +105,8 @@ abstract class ModuleAbstract
* @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 installExternal() public static function installExternal() /* : void */
{ {
return false;
} }
/** /**
@ -135,7 +134,7 @@ abstract class ModuleAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function addReceiving(string $module) public function addReceiving(string $module) /* : void */
{ {
$this->receiving[] = $module; $this->receiving[] = $module;
} }

View File

@ -103,7 +103,7 @@ class ModuleFactory
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private static function registerRequesting(ModuleAbstract $obj) private static function registerRequesting(ModuleAbstract $obj) /* : void */
{ {
foreach ($obj->getProviding() as $providing) { foreach ($obj->getProviding() as $providing) {
if (isset(self::$loaded[$providing])) { if (isset(self::$loaded[$providing])) {
@ -122,7 +122,7 @@ class ModuleFactory
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private static function registerProvided(ModuleAbstract $obj) private static function registerProvided(ModuleAbstract $obj) /* : void */
{ {
$name = $obj->getName(); $name = $obj->getName();
if (isset(self::$providing[$name])) { if (isset(self::$providing[$name])) {

View File

@ -433,7 +433,7 @@ class ModuleManager
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
private function installDependencies(array $dependencies) private function installDependencies(array $dependencies) /* : void */
{ {
foreach ($dependencies as $key => $version) { foreach ($dependencies as $key => $version) {
$this->install($key); $this->install($key);
@ -452,7 +452,7 @@ class ModuleManager
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
private function installModule(InfoManager $info) private function installModule(InfoManager $info) /* : void */
{ {
/** @var $class InstallerAbstract */ /** @var $class InstallerAbstract */
$class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Installer'; $class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Installer';
@ -476,7 +476,7 @@ class ModuleManager
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
private function deactivateModule(InfoManager $info) private function deactivateModule(InfoManager $info) /* : void */
{ {
$class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Deactivate'; $class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Deactivate';
@ -500,7 +500,7 @@ class ModuleManager
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
private function activateModule(InfoManager $info) private function activateModule(InfoManager $info) /* : void */
{ {
$class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Deactivate'; $class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Deactivate';
@ -572,7 +572,7 @@ class ModuleManager
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function installProviding(string $from, string $for) public function installProviding(string $from, string $for) /* : void */
{ {
if (file_exists(self::MODULE_PATH . '/' . $from . '/Admin/Install/' . $for . '.php')) { if (file_exists(self::MODULE_PATH . '/' . $from . '/Admin/Install/' . $for . '.php')) {
$class = '\\Modules\\' . $from . '\\Admin\\Install\\' . $for; $class = '\\Modules\\' . $from . '\\Admin\\Install\\' . $for;
@ -586,12 +586,14 @@ class ModuleManager
* *
* @param string|array $modules Module name * @param string|array $modules Module name
* *
* @return void
*
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function initModule($modules) public function initModule($modules) /* : void */
{ {
$modules = (array) $modules; $modules = (array) $modules;
@ -618,7 +620,7 @@ class ModuleManager
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
private function initModuleController(string $module) private function initModuleController(string $module) /* : void */
{ {
try { try {
$this->running[$module] = ModuleFactory::getInstance($module, $this->app); $this->running[$module] = ModuleFactory::getInstance($module, $this->app);
@ -640,7 +642,7 @@ class ModuleManager
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function get(string $module) public function get(string $module) : ModuleAbstract
{ {
try { try {
if (!isset($this->running[$module])) { if (!isset($this->running[$module])) {

View File

@ -42,7 +42,7 @@ class UninstallAbstract
* @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 uninstall(DatabasePool $dbPool, InfoManager $info) public static function uninstall(DatabasePool $dbPool, InfoManager $info) /* : void */
{ {
} }

View File

@ -42,7 +42,7 @@ class UpdateAbstract
* @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 update(DatabasePool $dbPool, InfoManager $info) public static function update(DatabasePool $dbPool, InfoManager $info) /* : void */
{ {
} }
} }

View File

@ -38,12 +38,12 @@ interface Mediator extends \Countable
* @param \Closure $callback Function to call if the event gets triggered * @param \Closure $callback Function to call if the event gets triggered
* @param bool $remove Remove event after execution * @param bool $remove Remove event after execution
* *
* @return void * @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 attach(string $group, \Closure $callback, bool $remove = false); public function attach(string $group, \Closure $callback, bool $remove = false) : bool;
/** /**
* Removing a event. * Removing a event.
@ -70,7 +70,7 @@ interface Mediator extends \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 addGroup(string $group, string $id); public function addGroup(string $group, string $id) /* : void */;
/** /**
* Trigger event. * Trigger event.
@ -85,5 +85,5 @@ interface Mediator extends \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 trigger(string $group, string $id); public function trigger(string $group, string $id) /* : void */;
} }

View File

@ -83,7 +83,7 @@ class Router
* @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(string $route, $destination, int $verb = RouteVerb::GET) public function add(string $route, $destination, int $verb = RouteVerb::GET) /* : void */
{ {
if (!isset($this->routes[$route])) { if (!isset($this->routes[$route])) {
$this->routes[$route] = []; $this->routes[$route] = [];

View File

@ -158,7 +158,7 @@ class Header implements \Serializable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function serialize() /* : void */ public function serialize()
{ {
return $this->__toString(); return $this->__toString();
} }

View File

@ -121,10 +121,12 @@ class MultiMap implements \Countable
/** /**
* Garbage collect unreferenced values/keys * Garbage collect unreferenced values/keys
* *
* @return void
*
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
private function garbageCollect() private function garbageCollect() /* : void */
{ {
/* garbage collect keys */ /* garbage collect keys */
foreach ($this->keys as $key => $keyValue) { foreach ($this->keys as $key => $keyValue) {

View File

@ -102,7 +102,7 @@ class PriorityQueue implements \Countable, \Serializable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function increaseAll(float $increase = 0.1) public function increaseAll(float $increase = 0.1) /* : void */
{ {
foreach ($this->queue as $key => &$ele) { foreach ($this->queue as $key => &$ele) {
$ele['priority'] += $increase; $ele['priority'] += $increase;
@ -132,7 +132,7 @@ class PriorityQueue implements \Countable, \Serializable
* @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(int $id = null) public function delete(int $id = null) /* : void */
{ {
if ($id === null) { if ($id === null) {
$this->remove(); $this->remove();

View File

@ -73,7 +73,7 @@ class Directory extends FileAbstract implements DirectoryInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function index() public function index() /* : void */
{ {
parent::index(); parent::index();

View File

@ -57,7 +57,7 @@ class File extends FileAbstract implements FileInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function index() public function index() /* : void */
{ {
parent::index(); parent::index();

View File

@ -187,7 +187,7 @@ abstract class FileAbstract implements ContainerInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function index() public function index() /* : void */
{ {
$this->createdAt->setTimestamp(filemtime($this->path)); $this->createdAt->setTimestamp(filemtime($this->path));
$this->changedAt->setTimestamp(filectime($this->path)); $this->changedAt->setTimestamp(filectime($this->path));

View File

@ -64,7 +64,7 @@ abstract class StorageAbstract implements DirectoryInterface, FileInterface
* @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() public static function getInstance() : StorageAbstract
{ {
if(!isset(static::$instance)) { if(!isset(static::$instance)) {
static::$instance = new static(); static::$instance = new static();

View File

@ -37,7 +37,7 @@ final class UnhandledHandler
* @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 exceptionHandler($e) public static function exceptionHandler($e) /* : void */
{ {
$logger = FileLogger::getInstance(ROOT_PATH . '/Logs'); $logger = FileLogger::getInstance(ROOT_PATH . '/Logs');
$logger->critical(FileLogger::MSG_FULL, [ $logger->critical(FileLogger::MSG_FULL, [
@ -109,7 +109,7 @@ final class UnhandledHandler
* @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 shutdownHandler() public static function shutdownHandler() /* : void */
{ {
$e = error_get_last(); $e = error_get_last();

View File

@ -280,7 +280,7 @@ class Http implements UriInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getQuery(string $key = null) public function getQuery(string $key = null) /* : ?string */
{ {
return isset($key) ? $this->query[$key] ?? null : $this->queryString ?? ''; return isset($key) ? $this->query[$key] ?? null : $this->queryString ?? '';
} }

View File

@ -54,14 +54,14 @@ class UriFactory
* *
* @param string $key Replacement key * @param string $key Replacement key
* *
* @return false|string * @return null|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 getQuery(string $key) public static function getQuery(string $key) /* : ?string */
{ {
return self::$uri[$key] ?? false; return self::$uri[$key] ?? null;
} }
/** /**
@ -181,7 +181,7 @@ class UriFactory
* @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 build(string $uri, array $toMatch = []) public static function build(string $uri, array $toMatch = []) /* : ?string */
{ {
$parsed = preg_replace_callback('(\{[\/#\?@\.\$][a-zA-Z0-9\-]*\})', function ($match) use ($toMatch) { $parsed = preg_replace_callback('(\{[\/#\?@\.\$][a-zA-Z0-9\-]*\})', function ($match) use ($toMatch) {
$match = substr($match[0], 1, strlen($match[0]) - 2); $match = substr($match[0], 1, strlen($match[0]) - 2);

View File

@ -237,7 +237,7 @@ class ArrayUtils
* @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 getArg(string $id, array $args) public static function getArg(string $id, array $args) /* : ?string */
{ {
if (($key = array_search($id, $args)) === false || $key === count($args) - 1) { if (($key = array_search($id, $args)) === false || $key === count($args) - 1) {
return null; return null;

View File

@ -55,7 +55,7 @@ class Currency
* @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 resetCurrencies() public static function resetCurrencies() /* : void */
{ {
self::$ecbCurrencies = null; self::$ecbCurrencies = null;
} }

View File

@ -77,7 +77,7 @@ final class Dictionary
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function generate(string $source) public function generate(string $source) /* : void */
{ {
$this->dictionary = []; $this->dictionary = [];
$this->min = -1; $this->min = -1;
@ -113,7 +113,7 @@ final class Dictionary
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private function fill(string $entry, string $value = '') private function fill(string $entry, string $value = '') /* : void */
{ {
if (!is_array($entry[0][1])) { if (!is_array($entry[0][1])) {
$this->set($entry[0][1], $value . '0'); $this->set($entry[0][1], $value . '0');
@ -205,7 +205,7 @@ final class Dictionary
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getEntry(&$value) public function getEntry(&$value) /* : ?string */
{ {
$length = strlen($value); $length = strlen($value);
if ($length < $this->min) { if ($length < $this->min) {

View File

@ -42,7 +42,7 @@ final class Huffman
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function removeDictionary() public function removeDictionary() /* : void */
{ {
$this->dictionary = null; $this->dictionary = null;
} }

View File

@ -347,7 +347,7 @@ class Commit
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private function addChange(string $path, int $line, string $old, string $new) private function addChange(string $path, int $line, string $old, string $new) /* : void */
{ {
if (!isset($this->files[$path])) { if (!isset($this->files[$path])) {
throw new \Exception(); throw new \Exception();

View File

@ -72,7 +72,7 @@ class JsonBuilder implements \Serializable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function add(string $path, $value, bool $overwrite = true) public function add(string $path, $value, bool $overwrite = true) /* : void */
{ {
$this->json = ArrayUtils::setArray($path, $this->json, $value, '/', $overwrite); $this->json = ArrayUtils::setArray($path, $this->json, $value, '/', $overwrite);
} }
@ -87,7 +87,7 @@ class JsonBuilder implements \Serializable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function remove(string $path) public function remove(string $path) /* : void */
{ {
$this->json = ArrayUtils::unsetArray($path, $this->json, '/'); $this->json = ArrayUtils::unsetArray($path, $this->json, '/');
} }
@ -98,7 +98,7 @@ class JsonBuilder implements \Serializable
* @return string the string representation of the object or null * @return string the string representation of the object or null
* @since 5.1.0 * @since 5.1.0
*/ */
public function serialize() /* : void */ public function serialize()
{ {
return json_encode($this->json); return json_encode($this->json);
} }

View File

@ -152,7 +152,7 @@ class ClassParser
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function createFile(string $path) public function createFile(string $path) /* : void */
{ {
// todo: implement // todo: implement
} }
@ -279,7 +279,7 @@ class ClassParser
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function removeExtends() public function removeExtends() /* : void */
{ {
$this->extends = ''; $this->extends = '';
} }
@ -320,7 +320,7 @@ class ClassParser
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function removeNamespace() public function removeNamespace() /* : void */
{ {
$this->namespace = ''; $this->namespace = '';
} }
@ -336,7 +336,7 @@ class ClassParser
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function addUse(string $namespace, string $as = null) public function addUse(string $namespace, string $as = null) /* : void */
{ {
if (isset($as)) { if (isset($as)) {
$this->use[$as] = $namespace; $this->use[$as] = $namespace;
@ -404,7 +404,7 @@ class ClassParser
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function addImplements(string $implements) public function addImplements(string $implements) /* : void */
{ {
$this->implements[] = $implements; $this->implements[] = $implements;
@ -421,7 +421,7 @@ class ClassParser
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function addInclude(string $include) public function addInclude(string $include) /* : void */
{ {
$this->includes[] = $include; $this->includes[] = $include;
@ -438,7 +438,7 @@ class ClassParser
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function addRequire(string $require) public function addRequire(string $require) /* : void */
{ {
$this->requires[] = $require; $this->requires[] = $require;
@ -456,7 +456,7 @@ class ClassParser
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function addTrait(string $trait, string $as = null) public function addTrait(string $trait, string $as = null) /* : void */
{ {
if (isset($as)) { if (isset($as)) {
$this->traits[$as] = $trait; $this->traits[$as] = $trait;
@ -496,7 +496,7 @@ class ClassParser
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function addMember(MemberParser $member) public function addMember(MemberParser $member) /* : void */
{ {
$this->members[$member->getName()] = $member; $this->members[$member->getName()] = $member;
} }

View File

@ -158,7 +158,7 @@ class FunctionParser
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function removeBody() public function removeBody() /* : void */
{ {
$this->body = ''; $this->body = '';
} }
@ -289,7 +289,7 @@ class FunctionParser
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function removeReturn() public function removeReturn() /* : void */
{ {
$this->return = null; $this->return = null;
} }
@ -334,7 +334,7 @@ class FunctionParser
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function addParameter(string $name, string $typehint = null, string $default = null) public function addParameter(string $name, string $typehint = null, string $default = null) /* : void */
{ {
$this->parameters[$name]['name'] = $name; $this->parameters[$name]['name'] = $name;
$this->parameters[$name]['typehint'] = $typehint; $this->parameters[$name]['typehint'] = $typehint;
@ -356,7 +356,7 @@ class FunctionParser
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function serialize() /* : void */ public function serialize()
{ {
$function = ''; $function = '';
$function .= str_repeat(' ', ClassParser::INDENT); $function .= str_repeat(' ', ClassParser::INDENT);

View File

@ -40,7 +40,7 @@ class DateTime
* @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 generateDateTime($start, $end) public static function generateDateTime(string $start, string $end) : \DateTime
{ {
$startDate = strtotime($start); $startDate = strtotime($start);
$endDate = strtotime($end); $endDate = strtotime($end);

View File

@ -482,7 +482,7 @@ class Name
* @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 generateName(array $type, string $origin = 'western') public static function generateName(array $type, string $origin = 'western') : string
{ {
$rndType = rand(0, count($type) - 1); $rndType = rand(0, count($type) - 1);

View File

@ -276,7 +276,7 @@ class Text
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getSentences() public function getSentences() : int
{ {
return $this->sentences; return $this->sentences;
} }
@ -292,7 +292,7 @@ class Text
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function generateText($length, $words = null) public function generateText(int $length, $words = null) : string
{ {
if ($length === 0) { if ($length === 0) {
return ''; return '';
@ -383,7 +383,7 @@ class Text
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private function generatePunctuation($length) private function generatePunctuation(int $length) : string
{ {
$minSentences = 4; $minSentences = 4;
$maxSentences = 20; $maxSentences = 20;
@ -450,7 +450,7 @@ class Text
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private function generateParagraph($length) private function generateParagraph(int $length) /* : void */
{ {
$minSentence = 3; $minSentence = 3;
$maxSentence = 10; $maxSentence = 10;
@ -481,7 +481,7 @@ class Text
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private function generateFormatting($length) private function generateFormatting(int $length) : array
{ {
$probCursive = 0.005; $probCursive = 0.005;
$probBold = 0.005; $probBold = 0.005;

View File

@ -57,7 +57,7 @@ class CronJob extends TaskAbstract implements \Serializable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function serialize() /* : void */ public function serialize()
{ {
$minute = $this->printValue($this->interval->getMinute()); $minute = $this->printValue($this->interval->getMinute());
$hour = $this->printValue($this->interval->getHour()); $hour = $this->printValue($this->interval->getHour());

View File

@ -617,7 +617,7 @@ class Interval implements \Serializable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function serialize() /* : void */ public function serialize()
{ {
$minute = $this->serializeTime($this->minute['minutes'], $this->minute['step']); $minute = $this->serializeTime($this->minute['minutes'], $this->minute['step']);
$hour = $this->serializeTime($this->hour['hours'], $this->hour['step']); $hour = $this->serializeTime($this->hour['hours'], $this->hour['step']);

View File

@ -48,7 +48,7 @@ class Schedule extends TaskAbstract implements \Serializable
* @return string the string representation of the object or null * @return string the string representation of the object or null
* @since 5.1.0 * @since 5.1.0
*/ */
public function serialize() /* : void */ public function serialize()
{ {
// TODO: Implement serialize() method. // TODO: Implement serialize() method.
} }

View File

@ -109,7 +109,7 @@ abstract class SchedulerAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
public function add(TaskAbstract $task) public function add(TaskAbstract $task) /* : void */
{ {
$this->tasks[$task->getId()] = $task; $this->tasks[$task->getId()] = $task;
} }
@ -186,5 +186,5 @@ abstract class SchedulerAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn * @author Dennis Eichhorn
*/ */
abstract public function save(); abstract public function save() /* : void */;
} }

View File

@ -33,7 +33,7 @@ class TaskScheduler extends SchedulerAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function save() public function save() /* : void */
{ {
} }

View File

@ -44,7 +44,7 @@ class BIC extends ValidatorAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function isValid($value) public static function isValid($value) : bool
{ {
return (bool) preg_match('/^[a-z]{6}[0-9a-z]{2}([0-9a-z]{3})?\z/i', $value); return (bool) preg_match('/^[a-z]{6}[0-9a-z]{2}([0-9a-z]{3})?\z/i', $value);
} }

View File

@ -44,7 +44,7 @@ abstract class CreditCard extends ValidatorAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function isValid($value) public static function isValid($value) : bool
{ {
$value = preg_replace('/\D/', '', $value); $value = preg_replace('/\D/', '', $value);

View File

@ -44,7 +44,7 @@ abstract class DateTime extends ValidatorAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function isValid($value) public static function isValid($value) : bool
{ {
return (bool) strtotime($value); return (bool) strtotime($value);
} }

View File

@ -44,7 +44,7 @@ abstract class Hostname extends ValidatorAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function isValid($value) public static function isValid($value) : bool
{ {
return filter_var(gethostbyname($value), FILTER_VALIDATE_IP); return filter_var(gethostbyname($value), FILTER_VALIDATE_IP);
} }

View File

@ -44,7 +44,7 @@ abstract class IP extends ValidatorAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function isValid($value) public static function isValid($value) : bool
{ {
return filter_var($value, FILTER_VALIDATE_IP); return filter_var($value, FILTER_VALIDATE_IP);
} }

View File

@ -60,7 +60,7 @@ trait ModelValidationTrait
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
protected function isValid($var, $name) protected function isValid($var, $name) : bool
{ {
/** @noinspection PhpUndefinedFieldInspection */ /** @noinspection PhpUndefinedFieldInspection */
if (!isset(self::${$name . '_validate'})) { if (!isset(self::${$name . '_validate'})) {

View File

@ -38,7 +38,7 @@ final class Validator extends ValidatorAbstract
* @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 isValid($var, array $constraints) public static function isValid($var, array $constraints) : bool
{ {
foreach ($constraints as $callback => $settings) { foreach ($constraints as $callback => $settings) {
$valid = self::$callback($var, ...$settings); $valid = self::$callback($var, ...$settings);
@ -63,7 +63,7 @@ final class Validator extends ValidatorAbstract
* @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 isType($var, $constraint) public static function isType($var, $constraint) : bool
{ {
if (!is_array($constraint)) { if (!is_array($constraint)) {
$constraint = [$constraint]; $constraint = [$constraint];
@ -90,7 +90,7 @@ final class Validator extends ValidatorAbstract
* @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 hasLength(string $var, int $min = 0, int $max = PHP_INT_MAX) public static function hasLength(string $var, int $min = 0, int $max = PHP_INT_MAX) : bool
{ {
$length = strlen($var); $length = strlen($var);
@ -112,7 +112,7 @@ final class Validator extends ValidatorAbstract
* @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 contains(string $var, $substr) public static function contains(string $var, $substr) : bool
{ {
return is_string($substr) ? strpos($var, $substr) !== false : StringUtils::contains($var, $substr); return is_string($substr) ? strpos($var, $substr) !== false : StringUtils::contains($var, $substr);
} }
@ -128,7 +128,7 @@ final class Validator extends ValidatorAbstract
* @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 matches(string $var, string $pattern) public static function matches(string $var, string $pattern) : bool
{ {
return (preg_match($pattern, $var) !== false ? true : false); return (preg_match($pattern, $var) !== false ? true : false);
} }
@ -145,7 +145,7 @@ final class Validator extends ValidatorAbstract
* @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 hasLimit($var, $min = 0, $max = PHP_INT_MAX) public static function hasLimit($var, $min = 0, $max = PHP_INT_MAX) : bool
{ {
if ($var <= $max && $var >= $min) { if ($var <= $max && $var >= $min) {
return true; return true;

View File

@ -99,7 +99,7 @@ class View extends ViewAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getData($id) public function getData(string $id)
{ {
return $this->data[$id] ?? null; return $this->data[$id] ?? null;
} }
@ -160,14 +160,14 @@ class View extends ViewAbstract
* @param string $module Module name * @param string $module Module name
* @param string $theme Theme name * @param string $theme Theme name
* *
* @return array * @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>
*/ */
protected function getText(string $translation, string $module = null, string $theme = null) protected function getText(string $translation, string $module = null, string $theme = null) : string
{ {
if (!isset($module)) { if (!isset($module)) {
$match = '/Modules/'; $match = '/Modules/';
@ -202,7 +202,7 @@ class View extends ViewAbstract
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getRequest() public function getRequest() : Request
{ {
return $this->request; return $this->request;
} }

View File

@ -166,7 +166,7 @@ abstract class ViewAbstract implements \Serializable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function editView(string $id, View $view, $order = null) public function editView(string $id, View $view, $order = null) /* : void */
{ {
$this->addView($id, $view, $order, true); $this->addView($id, $view, $order, true);
} }
@ -203,7 +203,7 @@ abstract class ViewAbstract implements \Serializable
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function serialize() /* : void */ public function serialize()
{ {
if (empty($this->template)) { if (empty($this->template)) {
return $this->toArray(); return $this->toArray();