mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
Type hint fixes/prep for null return type
This commit is contained in:
parent
ab5e11a242
commit
cbc6205bf7
|
|
@ -101,7 +101,7 @@ class AssetManager implements \Countable
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function get(string $id)
|
||||
public function get(string $id) /* : ?string */
|
||||
{
|
||||
if (isset($this->assets[$id])) {
|
||||
return $this->assets[$id];
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ trait OptionsTrait
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists($key)
|
||||
public function exists($key) : bool
|
||||
{
|
||||
return isset($this->options[$key]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class CookieJar
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function lock()
|
||||
public static function lock() /* : void */
|
||||
{
|
||||
self::$isLocked = true;
|
||||
}
|
||||
|
|
@ -126,7 +126,7 @@ class CookieJar
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function delete(string $id)
|
||||
public function delete(string $id) /* : void */
|
||||
{
|
||||
$this->remove($id);
|
||||
setcookie($id, '', time() - 3600);
|
||||
|
|
@ -156,10 +156,14 @@ class CookieJar
|
|||
/**
|
||||
* Save cookie
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws LockException
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function save()
|
||||
public function save() /* : void */
|
||||
{
|
||||
if (self::$isLocked) {
|
||||
throw new LockException('CookieJar');
|
||||
|
|
|
|||
|
|
@ -68,12 +68,12 @@ abstract class BuilderAbstract
|
|||
*
|
||||
* @param string $prefix Prefix
|
||||
*
|
||||
* @return $this
|
||||
* @return BuilderAbstract
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function prefix(string $prefix)
|
||||
public function prefix(string $prefix) : BuilderAbstract
|
||||
{
|
||||
$this->prefix = $prefix;
|
||||
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ abstract class ConnectionAbstract implements ConnectionInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function close()
|
||||
public function close() /* : void */
|
||||
{
|
||||
$this->con = null;
|
||||
$this->status = DatabaseStatus::CLOSED;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ interface ConnectionInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function connect(array $dbdata);
|
||||
public function connect(array $dbdata) /* : void */;
|
||||
|
||||
/**
|
||||
* Get the database type.
|
||||
|
|
@ -74,7 +74,7 @@ interface ConnectionInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function close();
|
||||
public function close() /* : void */;
|
||||
|
||||
/**
|
||||
* Return grammar for this connection.
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class MysqlConnection extends ConnectionAbstract
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function connect(array $dbdata = null)
|
||||
public function connect(array $dbdata = null) /* : void */
|
||||
{
|
||||
$this->close();
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class SqlServerConnection extends ConnectionAbstract
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function connect(array $dbdata = null)
|
||||
public function connect(array $dbdata = null) /* : void */
|
||||
{
|
||||
$this->close();
|
||||
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @since 1.0.0
|
||||
* @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 */
|
||||
self::$collection['primaryField'][] = $class::$primaryField;
|
||||
|
|
@ -264,7 +264,7 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @since 1.0.0
|
||||
* @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
|
||||
|
||||
|
|
@ -283,7 +283,7 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function clear()
|
||||
public static function clear() /* : void */
|
||||
{
|
||||
self::$overwrite = true;
|
||||
self::$primaryField = '';
|
||||
|
|
|
|||
|
|
@ -78,15 +78,15 @@ class DatabasePool
|
|||
*
|
||||
* @param mixed $key Database key
|
||||
*
|
||||
* @return ConnectionAbstract|false
|
||||
* @return ConnectionAbstract|null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @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])) {
|
||||
return false; /* todo: return nullconnection */
|
||||
return null; /* todo: return nullconnection */
|
||||
}
|
||||
|
||||
return $this->pool[$key];
|
||||
|
|
|
|||
|
|
@ -481,7 +481,7 @@ class Builder extends BuilderAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function andWhere(Where $where)
|
||||
public function andWhere(Where $where) : Builder
|
||||
{
|
||||
$this->wheres[][] = [
|
||||
'column' => $where,
|
||||
|
|
@ -501,7 +501,7 @@ class Builder extends BuilderAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function orWhere(Where $where)
|
||||
public function orWhere(Where $where) : Builder
|
||||
{
|
||||
$this->wheres[][] = [
|
||||
'column' => $where,
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ class HttpSession implements SessionInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function save()
|
||||
public function save() /* : void */
|
||||
{
|
||||
if(!self::$isLocked) {
|
||||
$_SESSION = $this->sessionData;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ interface SessionInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function save();
|
||||
public function save() /* : void */;
|
||||
|
||||
/**
|
||||
* @return int|string
|
||||
|
|
@ -97,6 +97,6 @@ interface SessionInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setSID($sid);
|
||||
public function setSID($sid) /* : void */;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class SocketSession implements SessionInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function save()
|
||||
public function save() /* : void */
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class Iban implements \Serializable
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function parse(string $iban)
|
||||
private function parse(string $iban) /* : void */
|
||||
{
|
||||
$this->iban = self::normalize($iban);
|
||||
|
||||
|
|
@ -276,7 +276,7 @@ class Iban implements \Serializable
|
|||
* @return string the string representation of the object or null
|
||||
* @since 5.1.0
|
||||
*/
|
||||
public function serialize() /* : void */
|
||||
public function serialize()
|
||||
{
|
||||
return $this->prettyPrint();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ class Location implements \JsonSerializable, \Serializable
|
|||
* @return string the string representation of the object or null
|
||||
* @since 5.1.0
|
||||
*/
|
||||
public function serialize() /* : void */
|
||||
public function serialize()
|
||||
{
|
||||
return $this->jsonSerialize();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class EventManager implements Mediator
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function trigger(string $group, string $id = '')
|
||||
public function trigger(string $group, string $id = '') /* : void */
|
||||
{
|
||||
if (isset($this->groups[$group])) {
|
||||
unset($this->groups[$group][$id]);
|
||||
|
|
@ -117,7 +117,7 @@ class EventManager implements Mediator
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function addGroup(string $group, string $id)
|
||||
public function addGroup(string $group, string $id) /* : void */
|
||||
{
|
||||
if (!isset($this->groups[$group])) {
|
||||
$this->groups[$group] = [];
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class L11nManager
|
|||
* @since 1.0.0
|
||||
* @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])) {
|
||||
throw new \Exception('Unexpected language key: ' . $from);
|
||||
|
|
@ -123,7 +123,7 @@ class L11nManager
|
|||
* @since 1.0.0
|
||||
* @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 = [];
|
||||
if (file_exists(file)) {
|
||||
|
|
@ -164,12 +164,12 @@ class L11nManager
|
|||
* @param string $theme Theme
|
||||
* @param string $translation Text
|
||||
*
|
||||
* @return array
|
||||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @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])) {
|
||||
/** @var ModuleAbstract $class */
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@ class Money implements \Serializable
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function serialize() /* : void */
|
||||
public function serialize()
|
||||
{
|
||||
return $this->getInt();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class FileLogger implements LoggerInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function createFile()
|
||||
private function createFile() /* : void */
|
||||
{
|
||||
if (!$this->created && !file_exists($this->path)) {
|
||||
File::create($this->path);
|
||||
|
|
@ -306,7 +306,7 @@ class FileLogger implements LoggerInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
private function write(string $message)
|
||||
private function write(string $message) /* : void */
|
||||
{
|
||||
$this->createFile();
|
||||
$this->fp = fopen($this->path, 'a');
|
||||
|
|
@ -335,7 +335,7 @@ class FileLogger implements LoggerInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function emergency(string $message, array $context = [])
|
||||
public function emergency(string $message, array $context = []) /* : void */
|
||||
{
|
||||
$message = $this->interpolate($message, $context, LogLevel::EMERGENCY);
|
||||
$this->write($message);
|
||||
|
|
@ -355,7 +355,7 @@ class FileLogger implements LoggerInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function alert(string $message, array $context = [])
|
||||
public function alert(string $message, array $context = []) /* : void */
|
||||
{
|
||||
$message = $this->interpolate($message, $context, LogLevel::ALERT);
|
||||
$this->write($message);
|
||||
|
|
@ -374,7 +374,7 @@ class FileLogger implements LoggerInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function critical(string $message, array $context = [])
|
||||
public function critical(string $message, array $context = []) /* : void */
|
||||
{
|
||||
$message = $this->interpolate($message, $context, LogLevel::CRITICAL);
|
||||
$this->write($message);
|
||||
|
|
@ -392,7 +392,7 @@ class FileLogger implements LoggerInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function error(string $message, array $context = [])
|
||||
public function error(string $message, array $context = []) /* : void */
|
||||
{
|
||||
$message = $this->interpolate($message, $context, LogLevel::ERROR);
|
||||
$this->write($message);
|
||||
|
|
@ -412,7 +412,7 @@ class FileLogger implements LoggerInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function warning(string $message, array $context = [])
|
||||
public function warning(string $message, array $context = []) /* : void */
|
||||
{
|
||||
$message = $this->interpolate($message, $context, LogLevel::WARNING);
|
||||
$this->write($message);
|
||||
|
|
@ -429,7 +429,7 @@ class FileLogger implements LoggerInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function notice(string $message, array $context = [])
|
||||
public function notice(string $message, array $context = []) /* : void */
|
||||
{
|
||||
$message = $this->interpolate($message, $context, LogLevel::NOTICE);
|
||||
$this->write($message);
|
||||
|
|
@ -448,7 +448,7 @@ class FileLogger implements LoggerInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function info(string $message, array $context = [])
|
||||
public function info(string $message, array $context = []) /* : void */
|
||||
{
|
||||
$message = $this->interpolate($message, $context, LogLevel::INFO);
|
||||
$this->write($message);
|
||||
|
|
@ -465,7 +465,7 @@ class FileLogger implements LoggerInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function debug(string $message, array $context = [])
|
||||
public function debug(string $message, array $context = []) /* : void */
|
||||
{
|
||||
$message = $this->interpolate($message, $context, LogLevel::DEBUG);
|
||||
$this->write($message);
|
||||
|
|
@ -483,7 +483,7 @@ class FileLogger implements LoggerInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function log(string $level, string $message, array $context = [])
|
||||
public function log(string $level, string $message, array $context = []) /* : void */
|
||||
{
|
||||
if (!LogLevel::isValidValue($level)) {
|
||||
throw new InvalidEnumValue($level);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ interface LoggerInterface
|
|||
*
|
||||
* @return null
|
||||
*/
|
||||
public function emergency(string $message, array $context = []);
|
||||
public function emergency(string $message, array $context = []) /* : void */;
|
||||
|
||||
/**
|
||||
* Action must be taken immediately.
|
||||
|
|
@ -50,7 +50,7 @@ interface LoggerInterface
|
|||
*
|
||||
* @return null
|
||||
*/
|
||||
public function alert(string $message, array $context = []);
|
||||
public function alert(string $message, array $context = []) /* : void */;
|
||||
|
||||
/**
|
||||
* Critical conditions.
|
||||
|
|
@ -62,7 +62,7 @@ interface LoggerInterface
|
|||
*
|
||||
* @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
|
||||
|
|
@ -73,7 +73,7 @@ interface LoggerInterface
|
|||
*
|
||||
* @return null
|
||||
*/
|
||||
public function error(string $message, array $context = []);
|
||||
public function error(string $message, array $context = []) /* : void */;
|
||||
|
||||
/**
|
||||
* Exceptional occurrences that are not errors.
|
||||
|
|
@ -86,7 +86,7 @@ interface LoggerInterface
|
|||
*
|
||||
* @return null
|
||||
*/
|
||||
public function warning(string $message, array $context = []);
|
||||
public function warning(string $message, array $context = []) /* : void */;
|
||||
|
||||
/**
|
||||
* Normal but significant events.
|
||||
|
|
@ -96,7 +96,7 @@ interface LoggerInterface
|
|||
*
|
||||
* @return null
|
||||
*/
|
||||
public function notice(string $message, array $context = []);
|
||||
public function notice(string $message, array $context = []) /* : void */;
|
||||
|
||||
/**
|
||||
* Interesting events.
|
||||
|
|
@ -108,7 +108,7 @@ interface LoggerInterface
|
|||
*
|
||||
* @return null
|
||||
*/
|
||||
public function info(string $message, array $context = []);
|
||||
public function info(string $message, array $context = []) /* : void */;
|
||||
|
||||
/**
|
||||
* Detailed debug information.
|
||||
|
|
@ -118,7 +118,7 @@ interface LoggerInterface
|
|||
*
|
||||
* @return null
|
||||
*/
|
||||
public function debug(string $message, array $context = []);
|
||||
public function debug(string $message, array $context = []) /* : void */;
|
||||
|
||||
/**
|
||||
* Logs with an arbitrary level.
|
||||
|
|
@ -129,5 +129,5 @@ interface LoggerInterface
|
|||
*
|
||||
* @return null
|
||||
*/
|
||||
public function log(string $level, string $message, array $context = []);
|
||||
public function log(string $level, string $message, array $context = []) /* : void */;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ class Functions
|
|||
* @since 1.0.0
|
||||
* @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) {
|
||||
$n = -$n;
|
||||
|
|
@ -217,7 +217,7 @@ class Functions
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function mod($a, $b)
|
||||
public static function mod($a, $b) : int
|
||||
{
|
||||
if ($a < 0) {
|
||||
return ($a + $b) % $b;
|
||||
|
|
@ -277,7 +277,7 @@ class Functions
|
|||
* @since 1.0.0
|
||||
* @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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class Ellipse implements D2ShapeInterface
|
|||
* @since 1.0.0
|
||||
* @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;
|
||||
}
|
||||
|
|
@ -66,7 +66,7 @@ class Ellipse implements D2ShapeInterface
|
|||
* @since 1.0.0
|
||||
* @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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ class Polygon implements D2ShapeInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function reset()
|
||||
public function reset() /* : void */
|
||||
{
|
||||
$this->coord = [];
|
||||
$this->barycenter = ['x' => 0.0, 'y' => 0.0];
|
||||
|
|
@ -311,7 +311,7 @@ class Polygon implements D2ShapeInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getPerimeter()
|
||||
public function getPerimeter() : float
|
||||
{
|
||||
$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);
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class Sphere implements D3ShapeInterface
|
|||
* @since 1.0.0
|
||||
* @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);
|
||||
}
|
||||
|
|
@ -108,7 +108,7 @@ class Sphere implements D3ShapeInterface
|
|||
* @since 1.0.0
|
||||
* @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()));
|
||||
}
|
||||
|
|
@ -128,7 +128,7 @@ class Sphere implements D3ShapeInterface
|
|||
* @since 1.0.0
|
||||
* @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;
|
||||
}
|
||||
|
|
@ -153,7 +153,7 @@ class Sphere implements D3ShapeInterface
|
|||
* @since 1.0.0
|
||||
* @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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ class Average
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function arithmeticMean(array $values)
|
||||
public static function arithmeticMean(array $values) : float
|
||||
{
|
||||
$count = count($values);
|
||||
|
||||
|
|
@ -233,7 +233,7 @@ class Average
|
|||
* @since 1.0.0
|
||||
* @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);
|
||||
|
||||
|
|
@ -259,7 +259,7 @@ class Average
|
|||
* @since 1.0.0
|
||||
* @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);
|
||||
|
||||
|
|
@ -294,7 +294,7 @@ class Average
|
|||
* @since 1.0.0
|
||||
* @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;
|
||||
$size = count($angles);
|
||||
|
|
@ -371,7 +371,7 @@ class Average
|
|||
* @since 1.0.0
|
||||
* @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);
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ abstract class HeaderAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
abstract public function generate(string $statusCode);
|
||||
abstract public function generate(string $statusCode) /* : void */;
|
||||
|
||||
/**
|
||||
* Get header by key.
|
||||
|
|
@ -91,7 +91,7 @@ abstract class HeaderAbstract
|
|||
* @since 1.0.0
|
||||
* @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
|
||||
self::$isLocked = true;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class Request extends RequestAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function init($uri = null)
|
||||
public function init($uri = null) /* : void */
|
||||
{
|
||||
if (!isset($uri)) {
|
||||
$this->initCurrentRequest();
|
||||
|
|
@ -135,7 +135,7 @@ class Request extends RequestAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function initCurrentRequest()
|
||||
private function initCurrentRequest() /* : void */
|
||||
{
|
||||
$this->data = $_GET ?? [];
|
||||
$this->files = $_FILES ?? [];
|
||||
|
|
@ -166,7 +166,7 @@ class Request extends RequestAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function initPseudoRequest($uri)
|
||||
private function initPseudoRequest($uri) /* : void */
|
||||
{
|
||||
$this->setMethod($uri['type']);
|
||||
$this->uri->set($uri['uri']);
|
||||
|
|
@ -180,7 +180,7 @@ class Request extends RequestAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function cleanupGlobals()
|
||||
private function cleanupGlobals() /* : void */
|
||||
{
|
||||
unset($_FILES);
|
||||
unset($_GET);
|
||||
|
|
@ -224,7 +224,7 @@ class Request extends RequestAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function createRequestHashs()
|
||||
private function createRequestHashs() /* : void */
|
||||
{
|
||||
$this->hash = [];
|
||||
foreach ($this->path as $key => $path) {
|
||||
|
|
@ -312,12 +312,12 @@ class Request extends RequestAbstract
|
|||
/**
|
||||
* Determine request OS.
|
||||
*
|
||||
* @return OSType
|
||||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getOS() : OSType
|
||||
public function getOS() : string
|
||||
{
|
||||
if (!isset($this->os)) {
|
||||
$arr = OSType::getConstants();
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ interface MessageInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setStatusCode(string $status);
|
||||
public function setStatusCode(string $status) /* : void */;
|
||||
|
||||
/**
|
||||
* Get status code.
|
||||
|
|
@ -99,5 +99,5 @@ interface MessageInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setAccount(int $account);
|
||||
public function setAccount(int $account) /* : void */;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ abstract class RequestAbstract implements MessageInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getPath($key = null)
|
||||
public function getPath($key = null) /* : ?string */
|
||||
{
|
||||
if ($key === null) {
|
||||
return $this->path;
|
||||
|
|
@ -316,7 +316,7 @@ abstract class RequestAbstract implements MessageInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function lock()
|
||||
public function lock() /* : void */
|
||||
{
|
||||
$this->lock = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ class Head implements RenderableInterface
|
|||
* @since 1.0.0
|
||||
* @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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class ActivateAbstract
|
|||
* @since 1.0.0
|
||||
* @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::activateInDatabase($dbPool, $info);
|
||||
|
|
@ -60,7 +60,7 @@ class ActivateAbstract
|
|||
* @since 1.0.0
|
||||
* @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
|
||||
}
|
||||
|
|
@ -76,7 +76,7 @@ class ActivateAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function activateInDatabase(DatabasePool $dbPool, InfoManager $info)
|
||||
public static function activateInDatabase(DatabasePool $dbPool, InfoManager $info) /* : void */
|
||||
{
|
||||
switch ($dbPool->get()->getType()) {
|
||||
case DatabaseType::MYSQL:
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class DeactivateAbstract
|
|||
* @since 1.0.0
|
||||
* @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::deactivateInDatabase($dbPool, $info);
|
||||
|
|
@ -60,7 +60,7 @@ class DeactivateAbstract
|
|||
* @since 1.0.0
|
||||
* @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
|
||||
}
|
||||
|
|
@ -76,7 +76,7 @@ class DeactivateAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function deactivateInDatabase(DatabasePool $dbPool, InfoManager $info)
|
||||
public static function deactivateInDatabase(DatabasePool $dbPool, InfoManager $info) /* : void */
|
||||
{
|
||||
switch ($dbPool->get()->getType()) {
|
||||
case DatabaseType::MYSQL:
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class InfoManager
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function load()
|
||||
public function load() /* : void */
|
||||
{
|
||||
if (!file_exists($this->path)) {
|
||||
throw new PathException($this->path);
|
||||
|
|
@ -88,7 +88,7 @@ class InfoManager
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function update()
|
||||
public function update() /* : void */
|
||||
{
|
||||
file_put_contents($this->path, json_encode($this->info, JSON_PRETTY_PRINT));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class InstallerAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function registerInDatabase(DatabasePool $dbPool, InfoManager $info)
|
||||
public static function registerInDatabase(DatabasePool $dbPool, InfoManager $info) /* : void */
|
||||
{
|
||||
switch ($dbPool->get()->getType()) {
|
||||
case DatabaseType::MYSQL:
|
||||
|
|
@ -99,7 +99,7 @@ class InstallerAbstract
|
|||
* @since 1.0.0
|
||||
* @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::initRoutes($routePath, $info);
|
||||
|
|
@ -117,7 +117,7 @@ class InstallerAbstract
|
|||
* @since 1.0.0
|
||||
* @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 */
|
||||
$class = '\Modules\\' . $info->getDirectory() . '\Admin\Activate';
|
||||
|
|
@ -135,7 +135,7 @@ class InstallerAbstract
|
|||
* @since 1.0.0
|
||||
* @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);
|
||||
}
|
||||
|
|
@ -153,7 +153,7 @@ class InstallerAbstract
|
|||
* @since 1.0.0
|
||||
* @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__ ?
|
||||
$directories = new Directory(ROOT_PATH . '/Modules/' . $info->getDirectory() . '/Admin/Routes');
|
||||
|
|
@ -180,7 +180,7 @@ class InstallerAbstract
|
|||
* @since 1.0.0
|
||||
* @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)) {
|
||||
file_put_contents($destRoutePath, '<?php return [];');
|
||||
|
|
|
|||
|
|
@ -105,9 +105,8 @@ abstract class ModuleAbstract
|
|||
* @since 1.0.0
|
||||
* @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}
|
||||
*/
|
||||
public function addReceiving(string $module)
|
||||
public function addReceiving(string $module) /* : void */
|
||||
{
|
||||
$this->receiving[] = $module;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class ModuleFactory
|
|||
* @since 1.0.0
|
||||
* @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) {
|
||||
if (isset(self::$loaded[$providing])) {
|
||||
|
|
@ -122,7 +122,7 @@ class ModuleFactory
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function registerProvided(ModuleAbstract $obj)
|
||||
private static function registerProvided(ModuleAbstract $obj) /* : void */
|
||||
{
|
||||
$name = $obj->getName();
|
||||
if (isset(self::$providing[$name])) {
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@ class ModuleManager
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
private function installDependencies(array $dependencies)
|
||||
private function installDependencies(array $dependencies) /* : void */
|
||||
{
|
||||
foreach ($dependencies as $key => $version) {
|
||||
$this->install($key);
|
||||
|
|
@ -452,7 +452,7 @@ class ModuleManager
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
private function installModule(InfoManager $info)
|
||||
private function installModule(InfoManager $info) /* : void */
|
||||
{
|
||||
/** @var $class InstallerAbstract */
|
||||
$class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Installer';
|
||||
|
|
@ -476,7 +476,7 @@ class ModuleManager
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
private function deactivateModule(InfoManager $info)
|
||||
private function deactivateModule(InfoManager $info) /* : void */
|
||||
{
|
||||
$class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Deactivate';
|
||||
|
||||
|
|
@ -500,7 +500,7 @@ class ModuleManager
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
private function activateModule(InfoManager $info)
|
||||
private function activateModule(InfoManager $info) /* : void */
|
||||
{
|
||||
$class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Deactivate';
|
||||
|
||||
|
|
@ -572,7 +572,7 @@ class ModuleManager
|
|||
* @since 1.0.0
|
||||
* @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')) {
|
||||
$class = '\\Modules\\' . $from . '\\Admin\\Install\\' . $for;
|
||||
|
|
@ -586,12 +586,14 @@ class ModuleManager
|
|||
*
|
||||
* @param string|array $modules Module name
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function initModule($modules)
|
||||
public function initModule($modules) /* : void */
|
||||
{
|
||||
$modules = (array) $modules;
|
||||
|
||||
|
|
@ -618,7 +620,7 @@ class ModuleManager
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
private function initModuleController(string $module)
|
||||
private function initModuleController(string $module) /* : void */
|
||||
{
|
||||
try {
|
||||
$this->running[$module] = ModuleFactory::getInstance($module, $this->app);
|
||||
|
|
@ -640,7 +642,7 @@ class ModuleManager
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function get(string $module)
|
||||
public function get(string $module) : ModuleAbstract
|
||||
{
|
||||
try {
|
||||
if (!isset($this->running[$module])) {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class UninstallAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function uninstall(DatabasePool $dbPool, InfoManager $info)
|
||||
public static function uninstall(DatabasePool $dbPool, InfoManager $info) /* : void */
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class UpdateAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function update(DatabasePool $dbPool, InfoManager $info)
|
||||
public static function update(DatabasePool $dbPool, InfoManager $info) /* : void */
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,12 +38,12 @@ interface Mediator extends \Countable
|
|||
* @param \Closure $callback Function to call if the event gets triggered
|
||||
* @param bool $remove Remove event after execution
|
||||
*
|
||||
* @return void
|
||||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @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.
|
||||
|
|
@ -70,7 +70,7 @@ interface Mediator extends \Countable
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function addGroup(string $group, string $id);
|
||||
public function addGroup(string $group, string $id) /* : void */;
|
||||
|
||||
/**
|
||||
* Trigger event.
|
||||
|
|
@ -85,5 +85,5 @@ interface Mediator extends \Countable
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function trigger(string $group, string $id);
|
||||
public function trigger(string $group, string $id) /* : void */;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class Router
|
|||
* @since 1.0.0
|
||||
* @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])) {
|
||||
$this->routes[$route] = [];
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ class Header implements \Serializable
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function serialize() /* : void */
|
||||
public function serialize()
|
||||
{
|
||||
return $this->__toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,10 +121,12 @@ class MultiMap implements \Countable
|
|||
/**
|
||||
* Garbage collect unreferenced values/keys
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
private function garbageCollect()
|
||||
private function garbageCollect() /* : void */
|
||||
{
|
||||
/* garbage collect keys */
|
||||
foreach ($this->keys as $key => $keyValue) {
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class PriorityQueue implements \Countable, \Serializable
|
|||
* @since 1.0.0
|
||||
* @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) {
|
||||
$ele['priority'] += $increase;
|
||||
|
|
@ -132,7 +132,7 @@ class PriorityQueue implements \Countable, \Serializable
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function delete(int $id = null)
|
||||
public function delete(int $id = null) /* : void */
|
||||
{
|
||||
if ($id === null) {
|
||||
$this->remove();
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class Directory extends FileAbstract implements DirectoryInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function index()
|
||||
public function index() /* : void */
|
||||
{
|
||||
parent::index();
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class File extends FileAbstract implements FileInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function index()
|
||||
public function index() /* : void */
|
||||
{
|
||||
parent::index();
|
||||
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ abstract class FileAbstract implements ContainerInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function index()
|
||||
public function index() /* : void */
|
||||
{
|
||||
$this->createdAt->setTimestamp(filemtime($this->path));
|
||||
$this->changedAt->setTimestamp(filectime($this->path));
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ abstract class StorageAbstract implements DirectoryInterface, FileInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getInstance()
|
||||
public static function getInstance() : StorageAbstract
|
||||
{
|
||||
if(!isset(static::$instance)) {
|
||||
static::$instance = new static();
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ final class UnhandledHandler
|
|||
* @since 1.0.0
|
||||
* @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->critical(FileLogger::MSG_FULL, [
|
||||
|
|
@ -109,7 +109,7 @@ final class UnhandledHandler
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function shutdownHandler()
|
||||
public static function shutdownHandler() /* : void */
|
||||
{
|
||||
$e = error_get_last();
|
||||
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ class Http implements UriInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getQuery(string $key = null)
|
||||
public function getQuery(string $key = null) /* : ?string */
|
||||
{
|
||||
return isset($key) ? $this->query[$key] ?? null : $this->queryString ?? '';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,14 +54,14 @@ class UriFactory
|
|||
*
|
||||
* @param string $key Replacement key
|
||||
*
|
||||
* @return false|string
|
||||
* @return null|string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @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
|
||||
* @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) {
|
||||
$match = substr($match[0], 1, strlen($match[0]) - 2);
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ class ArrayUtils
|
|||
* @since 1.0.0
|
||||
* @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) {
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class Currency
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function resetCurrencies()
|
||||
public static function resetCurrencies() /* : void */
|
||||
{
|
||||
self::$ecbCurrencies = null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ final class Dictionary
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function generate(string $source)
|
||||
public function generate(string $source) /* : void */
|
||||
{
|
||||
$this->dictionary = [];
|
||||
$this->min = -1;
|
||||
|
|
@ -113,7 +113,7 @@ final class Dictionary
|
|||
* @since 1.0.0
|
||||
* @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])) {
|
||||
$this->set($entry[0][1], $value . '0');
|
||||
|
|
@ -205,7 +205,7 @@ final class Dictionary
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getEntry(&$value)
|
||||
public function getEntry(&$value) /* : ?string */
|
||||
{
|
||||
$length = strlen($value);
|
||||
if ($length < $this->min) {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ final class Huffman
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function removeDictionary()
|
||||
public function removeDictionary() /* : void */
|
||||
{
|
||||
$this->dictionary = null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ class Commit
|
|||
* @since 1.0.0
|
||||
* @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])) {
|
||||
throw new \Exception();
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class JsonBuilder implements \Serializable
|
|||
* @since 1.0.0
|
||||
* @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);
|
||||
}
|
||||
|
|
@ -87,7 +87,7 @@ class JsonBuilder implements \Serializable
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function remove(string $path)
|
||||
public function remove(string $path) /* : void */
|
||||
{
|
||||
$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
|
||||
* @since 5.1.0
|
||||
*/
|
||||
public function serialize() /* : void */
|
||||
public function serialize()
|
||||
{
|
||||
return json_encode($this->json);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ class ClassParser
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function createFile(string $path)
|
||||
public function createFile(string $path) /* : void */
|
||||
{
|
||||
// todo: implement
|
||||
}
|
||||
|
|
@ -279,7 +279,7 @@ class ClassParser
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function removeExtends()
|
||||
public function removeExtends() /* : void */
|
||||
{
|
||||
$this->extends = '';
|
||||
}
|
||||
|
|
@ -320,7 +320,7 @@ class ClassParser
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function removeNamespace()
|
||||
public function removeNamespace() /* : void */
|
||||
{
|
||||
$this->namespace = '';
|
||||
}
|
||||
|
|
@ -336,7 +336,7 @@ class ClassParser
|
|||
* @since 1.0.0
|
||||
* @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)) {
|
||||
$this->use[$as] = $namespace;
|
||||
|
|
@ -404,7 +404,7 @@ class ClassParser
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function addImplements(string $implements)
|
||||
public function addImplements(string $implements) /* : void */
|
||||
{
|
||||
$this->implements[] = $implements;
|
||||
|
||||
|
|
@ -421,7 +421,7 @@ class ClassParser
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function addInclude(string $include)
|
||||
public function addInclude(string $include) /* : void */
|
||||
{
|
||||
$this->includes[] = $include;
|
||||
|
||||
|
|
@ -438,7 +438,7 @@ class ClassParser
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function addRequire(string $require)
|
||||
public function addRequire(string $require) /* : void */
|
||||
{
|
||||
$this->requires[] = $require;
|
||||
|
||||
|
|
@ -456,7 +456,7 @@ class ClassParser
|
|||
* @since 1.0.0
|
||||
* @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)) {
|
||||
$this->traits[$as] = $trait;
|
||||
|
|
@ -496,7 +496,7 @@ class ClassParser
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function addMember(MemberParser $member)
|
||||
public function addMember(MemberParser $member) /* : void */
|
||||
{
|
||||
$this->members[$member->getName()] = $member;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ class FunctionParser
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function removeBody()
|
||||
public function removeBody() /* : void */
|
||||
{
|
||||
$this->body = '';
|
||||
}
|
||||
|
|
@ -289,7 +289,7 @@ class FunctionParser
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function removeReturn()
|
||||
public function removeReturn() /* : void */
|
||||
{
|
||||
$this->return = null;
|
||||
}
|
||||
|
|
@ -334,7 +334,7 @@ class FunctionParser
|
|||
* @since 1.0.0
|
||||
* @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]['typehint'] = $typehint;
|
||||
|
|
@ -356,7 +356,7 @@ class FunctionParser
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function serialize() /* : void */
|
||||
public function serialize()
|
||||
{
|
||||
$function = '';
|
||||
$function .= str_repeat(' ', ClassParser::INDENT);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class DateTime
|
|||
* @since 1.0.0
|
||||
* @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);
|
||||
$endDate = strtotime($end);
|
||||
|
|
|
|||
|
|
@ -482,7 +482,7 @@ class Name
|
|||
* @since 1.0.0
|
||||
* @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);
|
||||
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ class Text
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getSentences()
|
||||
public function getSentences() : int
|
||||
{
|
||||
return $this->sentences;
|
||||
}
|
||||
|
|
@ -292,7 +292,7 @@ class Text
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function generateText($length, $words = null)
|
||||
public function generateText(int $length, $words = null) : string
|
||||
{
|
||||
if ($length === 0) {
|
||||
return '';
|
||||
|
|
@ -383,7 +383,7 @@ class Text
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function generatePunctuation($length)
|
||||
private function generatePunctuation(int $length) : string
|
||||
{
|
||||
$minSentences = 4;
|
||||
$maxSentences = 20;
|
||||
|
|
@ -450,7 +450,7 @@ class Text
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function generateParagraph($length)
|
||||
private function generateParagraph(int $length) /* : void */
|
||||
{
|
||||
$minSentence = 3;
|
||||
$maxSentence = 10;
|
||||
|
|
@ -481,7 +481,7 @@ class Text
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function generateFormatting($length)
|
||||
private function generateFormatting(int $length) : array
|
||||
{
|
||||
$probCursive = 0.005;
|
||||
$probBold = 0.005;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class CronJob extends TaskAbstract implements \Serializable
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function serialize() /* : void */
|
||||
public function serialize()
|
||||
{
|
||||
$minute = $this->printValue($this->interval->getMinute());
|
||||
$hour = $this->printValue($this->interval->getHour());
|
||||
|
|
|
|||
|
|
@ -617,7 +617,7 @@ class Interval implements \Serializable
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function serialize() /* : void */
|
||||
public function serialize()
|
||||
{
|
||||
$minute = $this->serializeTime($this->minute['minutes'], $this->minute['step']);
|
||||
$hour = $this->serializeTime($this->hour['hours'], $this->hour['step']);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class Schedule extends TaskAbstract implements \Serializable
|
|||
* @return string the string representation of the object or null
|
||||
* @since 5.1.0
|
||||
*/
|
||||
public function serialize() /* : void */
|
||||
public function serialize()
|
||||
{
|
||||
// TODO: Implement serialize() method.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ abstract class SchedulerAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function add(TaskAbstract $task)
|
||||
public function add(TaskAbstract $task) /* : void */
|
||||
{
|
||||
$this->tasks[$task->getId()] = $task;
|
||||
}
|
||||
|
|
@ -186,5 +186,5 @@ abstract class SchedulerAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
abstract public function save();
|
||||
abstract public function save() /* : void */;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class TaskScheduler extends SchedulerAbstract
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function save()
|
||||
public function save() /* : void */
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class BIC extends ValidatorAbstract
|
|||
/**
|
||||
* {@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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ abstract class CreditCard extends ValidatorAbstract
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function isValid($value)
|
||||
public static function isValid($value) : bool
|
||||
{
|
||||
$value = preg_replace('/\D/', '', $value);
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ abstract class DateTime extends ValidatorAbstract
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function isValid($value)
|
||||
public static function isValid($value) : bool
|
||||
{
|
||||
return (bool) strtotime($value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ abstract class Hostname extends ValidatorAbstract
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function isValid($value)
|
||||
public static function isValid($value) : bool
|
||||
{
|
||||
return filter_var(gethostbyname($value), FILTER_VALIDATE_IP);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ abstract class IP extends ValidatorAbstract
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function isValid($value)
|
||||
public static function isValid($value) : bool
|
||||
{
|
||||
return filter_var($value, FILTER_VALIDATE_IP);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ trait ModelValidationTrait
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function isValid($var, $name)
|
||||
protected function isValid($var, $name) : bool
|
||||
{
|
||||
/** @noinspection PhpUndefinedFieldInspection */
|
||||
if (!isset(self::${$name . '_validate'})) {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ final class Validator extends ValidatorAbstract
|
|||
* @since 1.0.0
|
||||
* @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) {
|
||||
$valid = self::$callback($var, ...$settings);
|
||||
|
|
@ -63,7 +63,7 @@ final class Validator extends ValidatorAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function isType($var, $constraint)
|
||||
public static function isType($var, $constraint) : bool
|
||||
{
|
||||
if (!is_array($constraint)) {
|
||||
$constraint = [$constraint];
|
||||
|
|
@ -90,7 +90,7 @@ final class Validator extends ValidatorAbstract
|
|||
* @since 1.0.0
|
||||
* @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);
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ final class Validator extends ValidatorAbstract
|
|||
* @since 1.0.0
|
||||
* @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);
|
||||
}
|
||||
|
|
@ -128,7 +128,7 @@ final class Validator extends ValidatorAbstract
|
|||
* @since 1.0.0
|
||||
* @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);
|
||||
}
|
||||
|
|
@ -145,7 +145,7 @@ final class Validator extends ValidatorAbstract
|
|||
* @since 1.0.0
|
||||
* @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) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class View extends ViewAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getData($id)
|
||||
public function getData(string $id)
|
||||
{
|
||||
return $this->data[$id] ?? null;
|
||||
}
|
||||
|
|
@ -160,14 +160,14 @@ class View extends ViewAbstract
|
|||
* @param string $module Module name
|
||||
* @param string $theme Theme name
|
||||
*
|
||||
* @return array
|
||||
* @return string
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @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)) {
|
||||
$match = '/Modules/';
|
||||
|
|
@ -202,7 +202,7 @@ class View extends ViewAbstract
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getRequest()
|
||||
public function getRequest() : Request
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ abstract class ViewAbstract implements \Serializable
|
|||
* @since 1.0.0
|
||||
* @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);
|
||||
}
|
||||
|
|
@ -203,7 +203,7 @@ abstract class ViewAbstract implements \Serializable
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function serialize() /* : void */
|
||||
public function serialize()
|
||||
{
|
||||
if (empty($this->template)) {
|
||||
return $this->toArray();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user