mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-09 21:48:41 +00:00
phpstan fixes
This commit is contained in:
parent
3b45692ff1
commit
1cd1ee0e10
|
|
@ -89,7 +89,7 @@ class AssetManager implements \Countable
|
||||||
*
|
*
|
||||||
* @param string $id Asset id
|
* @param string $id Asset id
|
||||||
*
|
*
|
||||||
* @return mixed Asset
|
* @return string|null
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@ class Depreciation
|
||||||
* Calculate the depreciation rate
|
* Calculate the depreciation rate
|
||||||
*
|
*
|
||||||
* @param float $start Value to depreciate (reduced by residual value if required)
|
* @param float $start Value to depreciate (reduced by residual value if required)
|
||||||
* @param int $residual Residual value
|
* @param float $residual Residual value
|
||||||
* @param int $duration Useful life time
|
* @param int $duration Useful life time
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
|
|
@ -183,7 +183,7 @@ class Depreciation
|
||||||
* Calculate the depreciation value in a period
|
* Calculate the depreciation value in a period
|
||||||
*
|
*
|
||||||
* @param float $start Value to depreciate (reduced by residual value if required)
|
* @param float $start Value to depreciate (reduced by residual value if required)
|
||||||
* @param int $residual Residual value
|
* @param float $residual Residual value
|
||||||
* @param int $duration Useful life time
|
* @param int $duration Useful life time
|
||||||
* @param int $t Period
|
* @param int $t Period
|
||||||
*
|
*
|
||||||
|
|
@ -202,7 +202,7 @@ class Depreciation
|
||||||
* Calculate the residual value after some periods
|
* Calculate the residual value after some periods
|
||||||
*
|
*
|
||||||
* @param float $start Value to depreciate (reduced by residual value if required)
|
* @param float $start Value to depreciate (reduced by residual value if required)
|
||||||
* @param int $residual Residual value
|
* @param float $residual Residual value
|
||||||
* @param int $duration Useful life time
|
* @param int $duration Useful life time
|
||||||
* @param int $t Period
|
* @param int $t Period
|
||||||
*
|
*
|
||||||
|
|
@ -225,7 +225,7 @@ class Depreciation
|
||||||
* Calculate the depreciation rate
|
* Calculate the depreciation rate
|
||||||
*
|
*
|
||||||
* @param float $start Value to depreciate (reduced by residual value if required)
|
* @param float $start Value to depreciate (reduced by residual value if required)
|
||||||
* @param int $residual Residual value
|
* @param float $residual Residual value
|
||||||
* @param int $duration Useful life time
|
* @param int $duration Useful life time
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
|
|
@ -241,7 +241,7 @@ class Depreciation
|
||||||
* Calculate the depreciation value in a period
|
* Calculate the depreciation value in a period
|
||||||
*
|
*
|
||||||
* @param float $start Value to depreciate (reduced by residual value if required)
|
* @param float $start Value to depreciate (reduced by residual value if required)
|
||||||
* @param int $residual Residual value
|
* @param float $residual Residual value
|
||||||
* @param int $duration Useful life time
|
* @param int $duration Useful life time
|
||||||
* @param int $t Period
|
* @param int $t Period
|
||||||
*
|
*
|
||||||
|
|
@ -259,7 +259,7 @@ class Depreciation
|
||||||
* Calculate the residual value after some periods
|
* Calculate the residual value after some periods
|
||||||
*
|
*
|
||||||
* @param float $start Value to depreciate (reduced by residual value if required)
|
* @param float $start Value to depreciate (reduced by residual value if required)
|
||||||
* @param int $residual Residual value
|
* @param float $residual Residual value
|
||||||
* @param int $duration Useful life time
|
* @param int $duration Useful life time
|
||||||
* @param int $t Period
|
* @param int $t Period
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -30,11 +30,11 @@ interface OptionsInterface
|
||||||
*
|
*
|
||||||
* @param mixed $key Key to check for existence
|
* @param mixed $key Key to check for existence
|
||||||
*
|
*
|
||||||
* @return void
|
* @return bool
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function exists($key);
|
public function exists($key) : bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updating or adding settings.
|
* Updating or adding settings.
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ abstract class SettingsAbstract implements OptionsInterface
|
||||||
* @param string[] $options Column values for filtering
|
* @param string[] $options Column values for filtering
|
||||||
* @param bool $store Save this Setting immediately to database
|
* @param bool $store Save this Setting immediately to database
|
||||||
*
|
*
|
||||||
* @return mixed Option value
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ class ConnectionFactory
|
||||||
case CacheType::REDIS:
|
case CacheType::REDIS:
|
||||||
return new RedisCache($cacheData);
|
return new RedisCache($cacheData);
|
||||||
case CacheType::MEMCACHED:
|
case CacheType::MEMCACHED:
|
||||||
return new MemcachedCache($cacheData);
|
return new MemCached($cacheData);
|
||||||
case CacheType::WINCACHE:
|
case CacheType::WINCACHE:
|
||||||
return new WinCache($cacheData);
|
return new WinCache($cacheData);
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ interface ConnectionInterface extends DataStorageConnectionInterface
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function set($key, $value, int $expire = -1); /* : void */
|
public function set($key, $value, int $expire = -1) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adding new data if it doesn't exist.
|
* Adding new data if it doesn't exist.
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,12 @@ class MemCached extends ConnectionAbstract
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param array $data Cache data
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct(array $data)
|
||||||
{
|
{
|
||||||
$this->memc = null;
|
$this->memc = null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace phpOMS\DataStorage\Cache\Connection;
|
namespace phpOMS\DataStorage\Cache\Connection;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Cache\CacheStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RedisCache class.
|
* RedisCache class.
|
||||||
*
|
*
|
||||||
|
|
@ -27,6 +29,17 @@ namespace phpOMS\DataStorage\Cache\Connection;
|
||||||
class RedisCache extends ConnectionAbstract
|
class RedisCache extends ConnectionAbstract
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param array $data Cache data
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function __construct(array $data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace phpOMS\DataStorage\Cache\Connection;
|
namespace phpOMS\DataStorage\Cache\Connection;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Cache\CacheStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WinCache class.
|
* WinCache class.
|
||||||
*
|
*
|
||||||
|
|
@ -26,6 +28,17 @@ namespace phpOMS\DataStorage\Cache\Connection;
|
||||||
*/
|
*/
|
||||||
class WinCache extends ConnectionAbstract
|
class WinCache extends ConnectionAbstract
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param array $data Cache data
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function __construct(array $data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ interface DataStorageConnectionInterface
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function connect(array $data); /* : void */
|
public function connect(array $data) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the datastorage type.
|
* Get the datastorage type.
|
||||||
|
|
@ -65,5 +65,5 @@ interface DataStorageConnectionInterface
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function close(); /* : void */
|
public function close() : void;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ interface DataStoragePoolInterface
|
||||||
/**
|
/**
|
||||||
* Add connection.
|
* Add connection.
|
||||||
*
|
*
|
||||||
* @param mixed $key Connection key
|
* @param string $key Connection key
|
||||||
* @param DataStorageConnectionInterface $db Connection
|
* @param DataStorageConnectionInterface $db Connection
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
|
|
@ -42,7 +42,7 @@ interface DataStoragePoolInterface
|
||||||
/**
|
/**
|
||||||
* Get connection.
|
* Get connection.
|
||||||
*
|
*
|
||||||
* @param mixed $key Connection key
|
* @param string $key Connection key
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*
|
*
|
||||||
|
|
@ -53,7 +53,7 @@ interface DataStoragePoolInterface
|
||||||
/**
|
/**
|
||||||
* Remove connection.
|
* Remove connection.
|
||||||
*
|
*
|
||||||
* @param mixed $key Connection key
|
* @param string $key Connection key
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ abstract class ConnectionAbstract implements ConnectionInterface
|
||||||
*
|
*
|
||||||
* This can be used externally to define queries and execute them.
|
* This can be used externally to define queries and execute them.
|
||||||
*
|
*
|
||||||
* @var \PDO
|
* @var \PDO|null
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public $con = null;
|
public $con = null;
|
||||||
|
|
|
||||||
36
DataStorage/Database/Connection/NullConnection.php
Normal file
36
DataStorage/Database/Connection/NullConnection.php
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.1
|
||||||
|
*
|
||||||
|
* @package phpOMS\DataStorage\Database\Connection
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace phpOMS\DataStorage\Database\Connection;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Database handler.
|
||||||
|
*
|
||||||
|
* @package phpOMS\DataStorage\Database\Connection
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
class NullConnection extends ConnectionAbstract
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function connect(array $dbdata = null) : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1076,7 +1076,7 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
* @param mixed $objId Model id
|
* @param mixed $objId Model id
|
||||||
* @param \ReflectionClass $reflectionClass Reflection class
|
* @param \ReflectionClass $reflectionClass Reflection class
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -1302,7 +1302,7 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
* @param int $relations Delete all relations as well
|
* @param int $relations Delete all relations as well
|
||||||
* @param \ReflectionClass $reflectionClass Reflection class
|
* @param \ReflectionClass $reflectionClass Reflection class
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -2271,7 +2271,7 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
public static function fillRelationsArray(array &$obj, int $relations = RelationType::ALL, int $depth = null) : void
|
public static function fillRelationsArray(array &$obj, int $relations = RelationType::ALL, int $depth = null) : void
|
||||||
{
|
{
|
||||||
if (isset($depth) && $depth < 1) {
|
if (isset($depth) && $depth < 1) {
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($relations !== RelationType::NONE) {
|
if ($relations !== RelationType::NONE) {
|
||||||
|
|
@ -2335,7 +2335,7 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
* @param mixed $refKey Key
|
* @param mixed $refKey Key
|
||||||
* @param string $ref Ref
|
* @param string $ref Ref
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return array
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -2361,7 +2361,7 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
* @param mixed $refKey Key
|
* @param mixed $refKey Key
|
||||||
* @param string $ref Ref
|
* @param string $ref Ref
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return array
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ use phpOMS\DataStorage\DataStorageConnectionInterface;
|
||||||
use phpOMS\DataStorage\Database\Connection\ConnectionAbstract;
|
use phpOMS\DataStorage\Database\Connection\ConnectionAbstract;
|
||||||
use phpOMS\DataStorage\Database\Connection\ConnectionFactory;
|
use phpOMS\DataStorage\Database\Connection\ConnectionFactory;
|
||||||
use phpOMS\DataStorage\Database\Connection\ConnectionInterface;
|
use phpOMS\DataStorage\Database\Connection\ConnectionInterface;
|
||||||
|
use phpOMS\DataStorage\Database\Connection\NullConnection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database pool handler.
|
* Database pool handler.
|
||||||
|
|
@ -34,7 +35,7 @@ class DatabasePool implements DataStoragePoolInterface
|
||||||
/**
|
/**
|
||||||
* Databases.
|
* Databases.
|
||||||
*
|
*
|
||||||
* @var ConnectionAbstract[]
|
* @var DataStorageConnectionInterface[]
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $pool = [];
|
private $pool = [];
|
||||||
|
|
@ -51,7 +52,7 @@ class DatabasePool implements DataStoragePoolInterface
|
||||||
/**
|
/**
|
||||||
* Add database.
|
* Add database.
|
||||||
*
|
*
|
||||||
* @param mixed $key Database key
|
* @param string $key Database key
|
||||||
* @param DataStorageConnectionInterface $db Database
|
* @param DataStorageConnectionInterface $db Database
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
|
|
@ -72,16 +73,16 @@ class DatabasePool implements DataStoragePoolInterface
|
||||||
/**
|
/**
|
||||||
* Get database.
|
* Get database.
|
||||||
*
|
*
|
||||||
* @param mixed $key Database key
|
* @param string $key Database key
|
||||||
*
|
*
|
||||||
* @return ConnectionInterface|null
|
* @return ConnectionAbstract
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function get(string $key = '') /* : ?ConnectionInterface */
|
public function get(string $key = '') : ConnectionAbstract
|
||||||
{
|
{
|
||||||
if ((!empty($key) && !isset($this->pool[$key])) || empty($this->pool)) {
|
if ((!empty($key) && !isset($this->pool[$key])) || empty($this->pool)) {
|
||||||
return null;
|
return new NullConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($key)) {
|
if (empty($key)) {
|
||||||
|
|
@ -94,7 +95,7 @@ class DatabasePool implements DataStoragePoolInterface
|
||||||
/**
|
/**
|
||||||
* Remove database.
|
* Remove database.
|
||||||
*
|
*
|
||||||
* @param mixed $key Database key
|
* @param string $key Database key
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -490,7 +490,7 @@ class Builder extends BuilderAbstract
|
||||||
throw new \InvalidArgumentException('Unknown operator.');
|
throw new \InvalidArgumentException('Unknown operator.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_string($columns)) {
|
if (!is_array($columns)) {
|
||||||
$columns = [$columns];
|
$columns = [$columns];
|
||||||
$operator = [$operator];
|
$operator = [$operator];
|
||||||
$values = [$values];
|
$values = [$values];
|
||||||
|
|
@ -703,6 +703,10 @@ class Builder extends BuilderAbstract
|
||||||
public function orderBy($columns, $order = 'DESC') : Builder
|
public function orderBy($columns, $order = 'DESC') : Builder
|
||||||
{
|
{
|
||||||
if (is_string($columns) || $columns instanceof \Closure) {
|
if (is_string($columns) || $columns instanceof \Closure) {
|
||||||
|
if (!is_string($order)) {
|
||||||
|
throw new \InvalidArgumentException();
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($this->orders[$order])) {
|
if (!isset($this->orders[$order])) {
|
||||||
$this->orders[$order] = [];
|
$this->orders[$order] = [];
|
||||||
}
|
}
|
||||||
|
|
@ -754,7 +758,7 @@ class Builder extends BuilderAbstract
|
||||||
/**
|
/**
|
||||||
* Union.
|
* Union.
|
||||||
*
|
*
|
||||||
* @param string|\phpOMS\DataStorage\Database\Query\Builder $query Query
|
* @param mixed $query Query
|
||||||
*
|
*
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*
|
*
|
||||||
|
|
@ -796,7 +800,7 @@ class Builder extends BuilderAbstract
|
||||||
/**
|
/**
|
||||||
* Create query string.
|
* Create query string.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return string
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -315,9 +315,9 @@ class Grammar extends GrammarAbstract
|
||||||
/**
|
/**
|
||||||
* Compile value.
|
* Compile value.
|
||||||
*
|
*
|
||||||
* @param Builder $query Query builder
|
* @param Builder $query Query builder
|
||||||
* @param array|string|\Closure $value Value
|
* @param mixed $value Value
|
||||||
* @param string $prefix Prefix in case value is a table
|
* @param string $prefix Prefix in case value is a table
|
||||||
*
|
*
|
||||||
* @return string Returns a string representation of the value.
|
* @return string Returns a string representation of the value.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,9 @@ class ConsoleSession implements SessionInterface
|
||||||
*/
|
*/
|
||||||
public function __construct($sid = false)
|
public function __construct($sid = false)
|
||||||
{
|
{
|
||||||
$this->sid = $sid;
|
if ($sid !== false) {
|
||||||
|
$this->sid = $sid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ interface SessionInterface
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function save(); /* : void */
|
public function save() : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int|string
|
* @return int|string
|
||||||
|
|
@ -87,7 +87,7 @@ interface SessionInterface
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function setSID($sid); /* : void */
|
public function setSID($sid) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lock session from further adjustments.
|
* Lock session from further adjustments.
|
||||||
|
|
@ -96,5 +96,5 @@ interface SessionInterface
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function lock(); /* : void */
|
public function lock() : void;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,9 @@ class SocketSession implements SessionInterface
|
||||||
*/
|
*/
|
||||||
public function __construct($sid = false)
|
public function __construct($sid = false)
|
||||||
{
|
{
|
||||||
$this->sid = $sid;
|
if ($sid !== false) {
|
||||||
|
$this->sid = $sid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ class Dispatcher
|
||||||
* Dispatch controller.
|
* Dispatch controller.
|
||||||
*
|
*
|
||||||
* @param string|array|\Closure $controller Controller string
|
* @param string|array|\Closure $controller Controller string
|
||||||
* @param mixed ...$data Data
|
* @param array|null ...$data Data
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
|
|
@ -93,8 +93,8 @@ class Dispatcher
|
||||||
/**
|
/**
|
||||||
* Dispatch string.
|
* Dispatch string.
|
||||||
*
|
*
|
||||||
* @param string|array|\Closure $controller Controller string
|
* @param string $controller Controller string
|
||||||
* @param array $data Data
|
* @param array|null $data Data
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
|
|
@ -126,8 +126,8 @@ class Dispatcher
|
||||||
/**
|
/**
|
||||||
* Dispatch array.
|
* Dispatch array.
|
||||||
*
|
*
|
||||||
* @param string|array|\Closure $controller Controller string
|
* @param array $controller Controller string
|
||||||
* @param array $data Data
|
* @param array|null $data Data
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
|
|
@ -146,14 +146,14 @@ class Dispatcher
|
||||||
/**
|
/**
|
||||||
* Dispatch closure.
|
* Dispatch closure.
|
||||||
*
|
*
|
||||||
* @param string|array|\Closure $controller Controller string
|
* @param \Closure $controller Controller string
|
||||||
* @param array $data Data
|
* @param array|null $data Data
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private function dispatchClosure(\Closure $controller, array $data = null) : void
|
private function dispatchClosure(\Closure $controller, array $data = null)
|
||||||
{
|
{
|
||||||
return $controller($this->app, ...$data);
|
return $controller($this->app, ...$data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ class L11nManager
|
||||||
/**
|
/**
|
||||||
* Language.
|
* Language.
|
||||||
*
|
*
|
||||||
* @var string[][]
|
* @var array
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $language = [];
|
private $language = [];
|
||||||
|
|
@ -65,9 +65,9 @@ class L11nManager
|
||||||
* One module can only be loaded once. Once the module got loaded it's not
|
* One module can only be loaded once. Once the module got loaded it's not
|
||||||
* possible to load more language files later on.
|
* possible to load more language files later on.
|
||||||
*
|
*
|
||||||
* @param string $language Language iso code
|
* @param string $language Language iso code
|
||||||
* @param string $from Module name
|
* @param string $from Module name
|
||||||
* @param string[][] $translation Language files content
|
* @param array $translation Language files content
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ class Localization
|
||||||
/**
|
/**
|
||||||
* Weight.
|
* Weight.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var array
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $weight = [];
|
private $weight = [];
|
||||||
|
|
@ -107,7 +107,7 @@ class Localization
|
||||||
/**
|
/**
|
||||||
* Speed.
|
* Speed.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var array
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $speed = [];
|
private $speed = [];
|
||||||
|
|
@ -115,7 +115,7 @@ class Localization
|
||||||
/**
|
/**
|
||||||
* Length.
|
* Length.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var array
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $length = [];
|
private $length = [];
|
||||||
|
|
@ -123,7 +123,7 @@ class Localization
|
||||||
/**
|
/**
|
||||||
* Area.
|
* Area.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var array
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $area = [];
|
private $area = [];
|
||||||
|
|
@ -131,7 +131,7 @@ class Localization
|
||||||
/**
|
/**
|
||||||
* Volume.
|
* Volume.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var array
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $volume = [];
|
private $volume = [];
|
||||||
|
|
@ -314,7 +314,7 @@ class Localization
|
||||||
*
|
*
|
||||||
* @param string $decimal Decimal char
|
* @param string $decimal Decimal char
|
||||||
*
|
*
|
||||||
* @return string
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -340,7 +340,7 @@ class Localization
|
||||||
*
|
*
|
||||||
* @param string $thousands Thousands char
|
* @param string $thousands Thousands char
|
||||||
*
|
*
|
||||||
* @return string
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -366,7 +366,7 @@ class Localization
|
||||||
*
|
*
|
||||||
* @param string $angle Angle
|
* @param string $angle Angle
|
||||||
*
|
*
|
||||||
* @return string
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -392,7 +392,7 @@ class Localization
|
||||||
*
|
*
|
||||||
* @param string $temperature Temperature
|
* @param string $temperature Temperature
|
||||||
*
|
*
|
||||||
* @return string
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -418,7 +418,7 @@ class Localization
|
||||||
*
|
*
|
||||||
* @param array $speed Speed
|
* @param array $speed Speed
|
||||||
*
|
*
|
||||||
* @return array
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -444,7 +444,7 @@ class Localization
|
||||||
*
|
*
|
||||||
* @param array $weight Weight type
|
* @param array $weight Weight type
|
||||||
*
|
*
|
||||||
* @return array
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -470,7 +470,7 @@ class Localization
|
||||||
*
|
*
|
||||||
* @param array $length Length type
|
* @param array $length Length type
|
||||||
*
|
*
|
||||||
* @return array
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -496,7 +496,7 @@ class Localization
|
||||||
*
|
*
|
||||||
* @param array $area Area type
|
* @param array $area Area type
|
||||||
*
|
*
|
||||||
* @return array
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -522,7 +522,7 @@ class Localization
|
||||||
*
|
*
|
||||||
* @param array $volume Volume type
|
* @param array $volume Volume type
|
||||||
*
|
*
|
||||||
* @return array
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ class Money implements \Serializable
|
||||||
|
|
||||||
$right = substr($right, 0, self::MAX_DECIMALS);
|
$right = substr($right, 0, self::MAX_DECIMALS);
|
||||||
|
|
||||||
return (int) (((int) $left) * 10 ** self::MAX_DECIMALS + (int) str_pad($right, self::MAX_DECIMALS, '0'));
|
return ((int) $left) * 10 ** self::MAX_DECIMALS + (int) str_pad($right, self::MAX_DECIMALS, '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -132,7 +132,7 @@ class Money implements \Serializable
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function setLocalization(string $thousands = ',', string $decimal = '.', string $symbol = '', int $position = 0) : void
|
public function setLocalization(string $thousands = ',', string $decimal = '.', string $symbol = '', int $position = 0) : Money
|
||||||
{
|
{
|
||||||
$this->thousands = $thousands;
|
$this->thousands = $thousands;
|
||||||
$this->decimal = $decimal;
|
$this->decimal = $decimal;
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ interface LoggerInterface
|
||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function emergency(string $message, array $context = []); /* : void */
|
public function emergency(string $message, array $context = []) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action must be taken immediately.
|
* Action must be taken immediately.
|
||||||
|
|
@ -46,7 +46,7 @@ interface LoggerInterface
|
||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function alert(string $message, array $context = []); /* : void */
|
public function alert(string $message, array $context = []) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Critical conditions.
|
* Critical conditions.
|
||||||
|
|
@ -58,7 +58,7 @@ interface LoggerInterface
|
||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function critical(string $message, array $context = []); /* : void */
|
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
|
||||||
|
|
@ -69,7 +69,7 @@ interface LoggerInterface
|
||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function error(string $message, array $context = []); /* : void */
|
public function error(string $message, array $context = []) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exceptional occurrences that are not errors.
|
* Exceptional occurrences that are not errors.
|
||||||
|
|
@ -82,7 +82,7 @@ interface LoggerInterface
|
||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function warning(string $message, array $context = []); /* : void */
|
public function warning(string $message, array $context = []) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Normal but significant events.
|
* Normal but significant events.
|
||||||
|
|
@ -92,7 +92,7 @@ interface LoggerInterface
|
||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function notice(string $message, array $context = []); /* : void */
|
public function notice(string $message, array $context = []) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interesting events.
|
* Interesting events.
|
||||||
|
|
@ -104,7 +104,7 @@ interface LoggerInterface
|
||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function info(string $message, array $context = []); /* : void */
|
public function info(string $message, array $context = []) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detailed debug information.
|
* Detailed debug information.
|
||||||
|
|
@ -114,7 +114,7 @@ interface LoggerInterface
|
||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function debug(string $message, array $context = []); /* : void */
|
public function debug(string $message, array $context = []) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs with an arbitrary level.
|
* Logs with an arbitrary level.
|
||||||
|
|
@ -125,5 +125,5 @@ interface LoggerInterface
|
||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function log(string $level, string $message, array $context = []); /* : void */
|
public function log(string $level, string $message, array $context = []) : void;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ interface EdgeInterface
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function setWeight($weight); /* : void */
|
public function setWeight($weight) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get vertices.
|
* Get vertices.
|
||||||
|
|
@ -72,5 +72,5 @@ interface EdgeInterface
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function setVertices(VerticeInterface $a, VerticeInterface $b); /* : void */
|
public function setVertices(VerticeInterface $a, VerticeInterface $b) : void;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ abstract class HeaderAbstract
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
abstract public function generate(int $statusCode); /* : void */
|
abstract public function generate(int $statusCode) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get status code
|
* Get status code
|
||||||
|
|
@ -203,7 +203,7 @@ abstract class HeaderAbstract
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
abstract public function set(string $key, string $value, bool $overwrite = false); /* : void */
|
abstract public function set(string $key, string $value, bool $overwrite = false) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get header by key.
|
* Get header by key.
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,10 @@ class Request extends RequestAbstract
|
||||||
$this->header = new Header();
|
$this->header = new Header();
|
||||||
$this->header->setL11n($l11n ?? new Localization());
|
$this->header->setL11n($l11n ?? new Localization());
|
||||||
|
|
||||||
$this->uri = $uri;
|
if ($uri !== null) {
|
||||||
|
$this->uri = $uri;
|
||||||
|
}
|
||||||
|
|
||||||
$this->source = RequestSource::WEB;
|
$this->source = RequestSource::WEB;
|
||||||
|
|
||||||
$this->init();
|
$this->init();
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,11 @@ interface MessageInterface
|
||||||
/**
|
/**
|
||||||
* Retrieves all message header values.
|
* Retrieves all message header values.
|
||||||
*
|
*
|
||||||
* @return HeaderAbstract
|
* @return HeaderAbstract|null
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function getHeader() : HeaderAbstract;
|
public function getHeader() : ?HeaderAbstract;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the body of the message.
|
* Gets the body of the message.
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,6 @@ use phpOMS\Uri\UriInterface;
|
||||||
/**
|
/**
|
||||||
* Request class.
|
* Request class.
|
||||||
*
|
*
|
||||||
* @property mixed request
|
|
||||||
*
|
|
||||||
* @package phpOMS\Message
|
* @package phpOMS\Message
|
||||||
* @license OMS License 1.0
|
* @license OMS License 1.0
|
||||||
* @link http://website.orange-management.de
|
* @link http://website.orange-management.de
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ class InfoManager
|
||||||
public function update() : void
|
public function update() : void
|
||||||
{
|
{
|
||||||
if (!file_exists($this->path)) {
|
if (!file_exists($this->path)) {
|
||||||
throw new PathException((string) $this->path);
|
throw new PathException($this->path);
|
||||||
}
|
}
|
||||||
|
|
||||||
file_put_contents($this->path, json_encode($this->info, JSON_PRETTY_PRINT));
|
file_put_contents($this->path, json_encode($this->info, JSON_PRETTY_PRINT));
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ interface SocketInterface
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function close(); /* : void */
|
public function close() : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run socket.
|
* Run socket.
|
||||||
|
|
@ -51,5 +51,5 @@ interface SocketInterface
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function run(); /* : void */
|
public function run() : void;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -329,5 +329,5 @@ interface ContainerInterface
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function index(); /* : void */
|
public function index() : void;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,11 +46,11 @@ interface DirectoryInterface extends ContainerInterface, \Iterator, \ArrayAccess
|
||||||
*
|
*
|
||||||
* @param string $name File/direcotry name
|
* @param string $name File/direcotry name
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return ContainerInterface|null
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function getNode(string $name);
|
public function getNode(string $name) : ?ContainerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add file or directory.
|
* Add file or directory.
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ class Directory extends FileAbstract implements DirectoryInterface
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getNode(string $name) : FileAbstract
|
public function getNode(string $name) : ?ContainerInterface
|
||||||
{
|
{
|
||||||
return $this->nodes[$name] ?? null;
|
return $this->nodes[$name] ?? null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ class Directory extends FileAbstract implements DirectoryInterface
|
||||||
new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS),
|
new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS),
|
||||||
\RecursiveIteratorIterator::SELF_FIRST) as $item
|
\RecursiveIteratorIterator::SELF_FIRST) as $item
|
||||||
) {
|
) {
|
||||||
$list[] = str_replace('\\', '/', $iterator->getSubPathName());
|
$list[] = str_replace('\\', '/', $iterator->getSubPathname());
|
||||||
}
|
}
|
||||||
|
|
||||||
return $list;
|
return $list;
|
||||||
|
|
@ -114,7 +114,7 @@ class Directory extends FileAbstract implements DirectoryInterface
|
||||||
\RecursiveIteratorIterator::SELF_FIRST) as $item
|
\RecursiveIteratorIterator::SELF_FIRST) as $item
|
||||||
) {
|
) {
|
||||||
if ($item->getExtension() === $extension) {
|
if ($item->getExtension() === $extension) {
|
||||||
$list[] = str_replace('\\', '/', $iterator->getSubPathName());
|
$list[] = str_replace('\\', '/', $iterator->getSubPathname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -319,9 +319,9 @@ class Directory extends FileAbstract implements DirectoryInterface
|
||||||
\RecursiveIteratorIterator::SELF_FIRST) as $item
|
\RecursiveIteratorIterator::SELF_FIRST) as $item
|
||||||
) {
|
) {
|
||||||
if ($item->isDir()) {
|
if ($item->isDir()) {
|
||||||
mkdir($to . '/' . $iterator->getSubPathName());
|
mkdir($to . '/' . $iterator->getSubPathname());
|
||||||
} else {
|
} else {
|
||||||
copy($from . '/' . $iterator->getSubPathName(), $to . '/' . $iterator->getSubPathName());
|
copy($from . '/' . $iterator->getSubPathname(), $to . '/' . $iterator->getSubPathname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -371,7 +371,7 @@ class Directory extends FileAbstract implements DirectoryInterface
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getNode(string $name) : FileAbstract
|
public function getNode(string $name) : ?ContainerInterface
|
||||||
{
|
{
|
||||||
return $this->nodes[$name] ?? null;
|
return $this->nodes[$name] ?? null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,15 +37,6 @@ class LocalStorage extends StorageAbstract
|
||||||
*/
|
*/
|
||||||
private static $instance = null;
|
private static $instance = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get instance.
|
* Get instance.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -34,27 +34,15 @@ abstract class StorageAbstract
|
||||||
*/
|
*/
|
||||||
protected $type = 0;
|
protected $type = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
* @codeCoverageIgnore
|
|
||||||
*/
|
|
||||||
private function __construct()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get instance.
|
* Get instance.
|
||||||
*
|
*
|
||||||
* @return mixed Storage instance.
|
* @return StorageAbstract Storage instance.
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public static function getInstance() : StorageAbstract
|
abstract public static function getInstance() : StorageAbstract;
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Get storage type.
|
* Get storage type.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ final class OperatingSystem
|
||||||
/**
|
/**
|
||||||
* Get OS.
|
* Get OS.
|
||||||
*
|
*
|
||||||
* @return int|SystemType
|
* @return int
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,6 @@ class SystemUtils
|
||||||
$freeArr = explode("\n", $free);
|
$freeArr = explode("\n", $free);
|
||||||
$mem = explode(" ", $freeArr[1]);
|
$mem = explode(" ", $freeArr[1]);
|
||||||
$mem = array_filter($mem);
|
$mem = array_filter($mem);
|
||||||
$mem = array_merge($mem);
|
|
||||||
$memUsage = $mem[2] / $mem[1] * 100;
|
$memUsage = $mem[2] / $mem[1] * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ interface UriInterface
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function setRootPath(string $root); /* : void */
|
public function setRootPath(string $root) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get path element.
|
* Get path element.
|
||||||
|
|
@ -213,5 +213,5 @@ interface UriInterface
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function set(string $uri); /* : void */
|
public function set(string $uri) : void;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,6 @@ namespace phpOMS\Utils\IO\Csv {
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function importCsv($path); /* : void */
|
public function importCsv($path) : void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -358,11 +358,11 @@ class Markdown
|
||||||
protected static function blockCode(array $lineArray, array $block = null) : ?array
|
protected static function blockCode(array $lineArray, array $block = null) : ?array
|
||||||
{
|
{
|
||||||
if ($block !== null && !isset($block['type']) && !isset($block['interrupted'])) {
|
if ($block !== null && !isset($block['type']) && !isset($block['interrupted'])) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($lineArray['indent'] < 4) {
|
if ($lineArray['indent'] < 4) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
@ -390,7 +390,7 @@ class Markdown
|
||||||
protected static function blockCodeContinue(array $lineArray, array $block) : ?array
|
protected static function blockCodeContinue(array $lineArray, array $block) : ?array
|
||||||
{
|
{
|
||||||
if ($lineArray['indent'] < 4) {
|
if ($lineArray['indent'] < 4) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($block['interrupted'])) {
|
if (isset($block['interrupted'])) {
|
||||||
|
|
@ -431,7 +431,7 @@ class Markdown
|
||||||
protected static function blockFencedCode(array $lineArray) : ?array
|
protected static function blockFencedCode(array $lineArray) : ?array
|
||||||
{
|
{
|
||||||
if (!preg_match('/^[' . $lineArray['text'][0] . ']{3,}[ ]*([^`]+)?[ ]*$/', $lineArray['text'], $matches)) {
|
if (!preg_match('/^[' . $lineArray['text'][0] . ']{3,}[ ]*([^`]+)?[ ]*$/', $lineArray['text'], $matches)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$elementArray = [
|
$elementArray = [
|
||||||
|
|
@ -468,7 +468,7 @@ class Markdown
|
||||||
protected static function blockFencedCodeContinue(array $lineArray, array $block) : ?array
|
protected static function blockFencedCodeContinue(array $lineArray, array $block) : ?array
|
||||||
{
|
{
|
||||||
if (isset($block['complete'])) {
|
if (isset($block['complete'])) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($block['interrupted'])) {
|
if (isset($block['interrupted'])) {
|
||||||
|
|
@ -515,7 +515,7 @@ class Markdown
|
||||||
protected static function blockHeader(array $lineArray) : ?array
|
protected static function blockHeader(array $lineArray) : ?array
|
||||||
{
|
{
|
||||||
if (!isset($lineArray['text'][1])) {
|
if (!isset($lineArray['text'][1])) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$level = 1;
|
$level = 1;
|
||||||
|
|
@ -524,7 +524,7 @@ class Markdown
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($level > 6) {
|
if ($level > 6) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
@ -550,7 +550,7 @@ class Markdown
|
||||||
list($name, $pattern) = $lineArray['text'][0] <= '-' ? ['ul', '[*+-]'] : ['ol', '[0-9]+[.]'];
|
list($name, $pattern) = $lineArray['text'][0] <= '-' ? ['ul', '[*+-]'] : ['ol', '[0-9]+[.]'];
|
||||||
|
|
||||||
if (!preg_match('/^(' . $pattern . '[ ]+)(.*)/', $lineArray['text'], $matches)) {
|
if (!preg_match('/^(' . $pattern . '[ ]+)(.*)/', $lineArray['text'], $matches)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$block = [
|
$block = [
|
||||||
|
|
@ -649,7 +649,7 @@ class Markdown
|
||||||
protected static function blockQuote(array $lineArray) : ?array
|
protected static function blockQuote(array $lineArray) : ?array
|
||||||
{
|
{
|
||||||
if (!preg_match('/^>[ ]?(.*)/', $lineArray['text'], $matches)) {
|
if (!preg_match('/^>[ ]?(.*)/', $lineArray['text'], $matches)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
@ -704,7 +704,7 @@ class Markdown
|
||||||
protected static function blockRule(array $lineArray) : ?array
|
protected static function blockRule(array $lineArray) : ?array
|
||||||
{
|
{
|
||||||
if (!preg_match('/^([' . $lineArray['text'][0] . '])([ ]*\1){2,}[ ]*$/', $lineArray['text'])) {
|
if (!preg_match('/^([' . $lineArray['text'][0] . '])([ ]*\1){2,}[ ]*$/', $lineArray['text'])) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
@ -727,11 +727,11 @@ class Markdown
|
||||||
protected static function blockSetextHeader(array $lineArray, array $block = null) : ?array
|
protected static function blockSetextHeader(array $lineArray, array $block = null) : ?array
|
||||||
{
|
{
|
||||||
if (!isset($block) || isset($block['type']) || isset($block['interrupted'])) {
|
if (!isset($block) || isset($block['type']) || isset($block['interrupted'])) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chop($lineArray['text'], $lineArray['text'][0]) !== '') {
|
if (chop($lineArray['text'], $lineArray['text'][0]) !== '') {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$block['element']['name'] = $lineArray['text'][0] === '=' ? 'h1' : 'h2';
|
$block['element']['name'] = $lineArray['text'][0] === '=' ? 'h1' : 'h2';
|
||||||
|
|
@ -751,7 +751,7 @@ class Markdown
|
||||||
protected static function blockReference(array $lineArray) : ?array
|
protected static function blockReference(array $lineArray) : ?array
|
||||||
{
|
{
|
||||||
if (!preg_match('/^\[(.+?)\]:[ ]*<?(\S+?)>?(?:[ ]+["\'(](.+)["\')])?[ ]*$/', $lineArray['text'], $matches)) {
|
if (!preg_match('/^\[(.+?)\]:[ ]*<?(\S+?)>?(?:[ ]+["\'(](.+)["\')])?[ ]*$/', $lineArray['text'], $matches)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
|
|
@ -777,7 +777,7 @@ class Markdown
|
||||||
protected static function blockTable($lineArray, array $block = null) : ?array
|
protected static function blockTable($lineArray, array $block = null) : ?array
|
||||||
{
|
{
|
||||||
if (!isset($block) || isset($block['type']) || isset($block['interrupted'])) {
|
if (!isset($block) || isset($block['type']) || isset($block['interrupted'])) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($block['element']['text'], '|') !== false && chop($lineArray['text'], ' -:|') === '') {
|
if (strpos($block['element']['text'], '|') !== false && chop($lineArray['text'], ' -:|') === '') {
|
||||||
|
|
@ -872,7 +872,7 @@ class Markdown
|
||||||
protected static function blockTableContinue(array $lineArray, array $block) : ?array
|
protected static function blockTableContinue(array $lineArray, array $block) : ?array
|
||||||
{
|
{
|
||||||
if (isset($block['interrupted'])) {
|
if (isset($block['interrupted'])) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($lineArray['text'][0] === '|' || strpos($lineArray['text'], '|')) {
|
if ($lineArray['text'][0] === '|' || strpos($lineArray['text'], '|')) {
|
||||||
|
|
@ -994,7 +994,7 @@ class Markdown
|
||||||
$marker = $excerpt['text'][0];
|
$marker = $excerpt['text'][0];
|
||||||
|
|
||||||
if (!preg_match('/^(' . $marker . '+)[ ]*(.+?)[ ]*(?<!' . $marker . ')\1(?!' . $marker . ')/s', $excerpt['text'], $matches)) {
|
if (!preg_match('/^(' . $marker . '+)[ ]*(.+?)[ ]*(?<!' . $marker . ')\1(?!' . $marker . ')/s', $excerpt['text'], $matches)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
@ -1018,7 +1018,7 @@ class Markdown
|
||||||
protected static function inlineEmailTag(array $excerpt) : ?array
|
protected static function inlineEmailTag(array $excerpt) : ?array
|
||||||
{
|
{
|
||||||
if (strpos($excerpt['text'], '>') === false || !preg_match('/^<((mailto:)?\S+?@\S+?)>/i', $excerpt['text'], $matches)) {
|
if (strpos($excerpt['text'], '>') === false || !preg_match('/^<((mailto:)?\S+?@\S+?)>/i', $excerpt['text'], $matches)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = $matches[1];
|
$url = $matches[1];
|
||||||
|
|
@ -1051,7 +1051,7 @@ class Markdown
|
||||||
protected static function inlineEmphasis(array $excerpt) : ?array
|
protected static function inlineEmphasis(array $excerpt) : ?array
|
||||||
{
|
{
|
||||||
if (!isset($excerpt['text'][1])) {
|
if (!isset($excerpt['text'][1])) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$marker = $excerpt['text'][0];
|
$marker = $excerpt['text'][0];
|
||||||
|
|
@ -1061,7 +1061,7 @@ class Markdown
|
||||||
} elseif (preg_match(self::$emRegex[$marker], $excerpt['text'], $matches)) {
|
} elseif (preg_match(self::$emRegex[$marker], $excerpt['text'], $matches)) {
|
||||||
$emphasis = 'em';
|
$emphasis = 'em';
|
||||||
} else {
|
} else {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
@ -1086,7 +1086,7 @@ class Markdown
|
||||||
protected static function inlineEscapeSequence(array $excerpt) : ?array
|
protected static function inlineEscapeSequence(array $excerpt) : ?array
|
||||||
{
|
{
|
||||||
if (!isset($excerpt['text'][1]) || !in_array($excerpt['text'][1], self::$specialCharacters)) {
|
if (!isset($excerpt['text'][1]) || !in_array($excerpt['text'][1], self::$specialCharacters)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
@ -1107,14 +1107,14 @@ class Markdown
|
||||||
protected static function inlineImage(array $excerpt) : ?array
|
protected static function inlineImage(array $excerpt) : ?array
|
||||||
{
|
{
|
||||||
if (!isset($excerpt['text'][1]) || $excerpt['text'][1] !== '[') {
|
if (!isset($excerpt['text'][1]) || $excerpt['text'][1] !== '[') {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$excerpt['text'] = substr($excerpt['text'], 1);
|
$excerpt['text'] = substr($excerpt['text'], 1);
|
||||||
$link = self::inlineLink($excerpt);
|
$link = self::inlineLink($excerpt);
|
||||||
|
|
||||||
if ($link === null) {
|
if ($link === null) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$inline = [
|
$inline = [
|
||||||
|
|
@ -1160,7 +1160,7 @@ class Markdown
|
||||||
$remainder = $excerpt['text'];
|
$remainder = $excerpt['text'];
|
||||||
|
|
||||||
if (!preg_match('/\[((?:[^][]++|(?R))*+)\]/', $remainder, $matches)) {
|
if (!preg_match('/\[((?:[^][]++|(?R))*+)\]/', $remainder, $matches)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$element['text'] = $matches[1];
|
$element['text'] = $matches[1];
|
||||||
|
|
@ -1186,7 +1186,7 @@ class Markdown
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset(self::$definitionData['Reference'][$definition])) {
|
if (!isset(self::$definitionData['Reference'][$definition])) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$def = self::$definitionData['Reference'][$definition];
|
$def = self::$definitionData['Reference'][$definition];
|
||||||
|
|
@ -1241,11 +1241,11 @@ class Markdown
|
||||||
protected static function inlineStrikethrough(array $excerpt) : ?array
|
protected static function inlineStrikethrough(array $excerpt) : ?array
|
||||||
{
|
{
|
||||||
if (!isset($excerpt['text'][1])) {
|
if (!isset($excerpt['text'][1])) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($excerpt['text'][1] !== '~' || !preg_match('/^~~(?=\S)(.+?)(?<=\S)~~/', $excerpt['text'], $matches)) {
|
if ($excerpt['text'][1] !== '~' || !preg_match('/^~~(?=\S)(.+?)(?<=\S)~~/', $excerpt['text'], $matches)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
@ -1270,11 +1270,11 @@ class Markdown
|
||||||
protected static function inlineUrl(array $excerpt) : ?array
|
protected static function inlineUrl(array $excerpt) : ?array
|
||||||
{
|
{
|
||||||
if (!isset($excerpt['text'][2]) || $excerpt['text'][2] !== '/') {
|
if (!isset($excerpt['text'][2]) || $excerpt['text'][2] !== '/') {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('/\bhttps?:[\/]{2}[^\s<]+\b\/*/ui', $excerpt['context'], $matches, PREG_OFFSET_CAPTURE)) {
|
if (!preg_match('/\bhttps?:[\/]{2}[^\s<]+\b\/*/ui', $excerpt['context'], $matches, PREG_OFFSET_CAPTURE)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
@ -1302,7 +1302,7 @@ class Markdown
|
||||||
protected static function inlineUrlTag(array $excerpt) : ?array
|
protected static function inlineUrlTag(array $excerpt) : ?array
|
||||||
{
|
{
|
||||||
if (strpos($excerpt['text'], '>') === false || !preg_match('/^<(\w+:\/{2}[^ >]+)>/i', $excerpt['text'], $matches)) {
|
if (strpos($excerpt['text'], '>') === false || !preg_match('/^<(\w+:\/{2}[^ >]+)>/i', $excerpt['text'], $matches)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
@ -1322,7 +1322,7 @@ class Markdown
|
||||||
*
|
*
|
||||||
* @param string $text Normal text
|
* @param string $text Normal text
|
||||||
*
|
*
|
||||||
* @return null|array
|
* @return string
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -1339,7 +1339,7 @@ class Markdown
|
||||||
*
|
*
|
||||||
* @param array $element Html element
|
* @param array $element Html element
|
||||||
*
|
*
|
||||||
* @return null|array
|
* @return string
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -1420,7 +1420,7 @@ class Markdown
|
||||||
*
|
*
|
||||||
* @param array $element Element to sanitize
|
* @param array $element Element to sanitize
|
||||||
*
|
*
|
||||||
* @return string
|
* @return array
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -1492,7 +1492,7 @@ class Markdown
|
||||||
* @param string $string Text to check against
|
* @param string $string Text to check against
|
||||||
* @param string $needle Needle to check
|
* @param string $needle Needle to check
|
||||||
*
|
*
|
||||||
* @return bool|string
|
* @return bool
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -280,7 +280,7 @@ class Text
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private function generateParagraph(int $length) : void
|
private function generateParagraph(int $length) : string
|
||||||
{
|
{
|
||||||
$minSentence = 3;
|
$minSentence = 3;
|
||||||
$maxSentence = 10;
|
$maxSentence = 10;
|
||||||
|
|
|
||||||
|
|
@ -620,7 +620,7 @@ class Interval implements \Serializable
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function serializeTime($time, $step) : void
|
public function serializeTime($time, $step) : string
|
||||||
{
|
{
|
||||||
if (($count = count($time)) > 0) {
|
if (($count = count($time)) > 0) {
|
||||||
$serialize = implode(',', $time);
|
$serialize = implode(',', $time);
|
||||||
|
|
@ -643,7 +643,7 @@ class Interval implements \Serializable
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function serializeDayOfMonth() : void
|
public function serializeDayOfMonth() : string
|
||||||
{
|
{
|
||||||
if (($count = count($this->dayOfMonth['dayOfMonth'])) > 0) {
|
if (($count = count($this->dayOfMonth['dayOfMonth'])) > 0) {
|
||||||
$serialize = implode(',', $this->dayOfMonth['dayOfMonth']);
|
$serialize = implode(',', $this->dayOfMonth['dayOfMonth']);
|
||||||
|
|
@ -670,7 +670,7 @@ class Interval implements \Serializable
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function serializeDayOfWeek() : void
|
public function serializeDayOfWeek() : string
|
||||||
{
|
{
|
||||||
if (($count = count($this->dayOfWeek['dayOfWeek'])) > 0) {
|
if (($count = count($this->dayOfWeek['dayOfWeek'])) > 0) {
|
||||||
$serialize = implode(',', $this->dayOfWeek['dayOfWeek']);
|
$serialize = implode(',', $this->dayOfWeek['dayOfWeek']);
|
||||||
|
|
|
||||||
|
|
@ -90,9 +90,9 @@ final class Validator extends ValidatorAbstract
|
||||||
/**
|
/**
|
||||||
* Validate variable by length.
|
* Validate variable by length.
|
||||||
*
|
*
|
||||||
* @param string $var Variable to validate
|
* @param string $var Variable to validate
|
||||||
* @param int|float $min Min. length
|
* @param int $min Min. length
|
||||||
* @param int|float $max Max. length
|
* @param int $max Max. length
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -62,5 +62,5 @@ interface ValidatorInterface
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public static function resetError(); /* : void */
|
public static function resetError() : void;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ class View extends ViewAbstract
|
||||||
/**
|
/**
|
||||||
* Application.
|
* Application.
|
||||||
*
|
*
|
||||||
* @var ApplicationAbstract
|
* @var ApplicationAbstract|null
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected $app = null;
|
protected $app = null;
|
||||||
|
|
@ -58,7 +58,7 @@ class View extends ViewAbstract
|
||||||
/**
|
/**
|
||||||
* Request.
|
* Request.
|
||||||
*
|
*
|
||||||
* @var RequestAbstract
|
* @var RequestAbstract|null
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected $request = null;
|
protected $request = null;
|
||||||
|
|
@ -66,7 +66,7 @@ class View extends ViewAbstract
|
||||||
/**
|
/**
|
||||||
* Request.
|
* Request.
|
||||||
*
|
*
|
||||||
* @var ResponseAbstract
|
* @var ResponseAbstract|null
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected $response = null;
|
protected $response = null;
|
||||||
|
|
@ -85,7 +85,7 @@ class View extends ViewAbstract
|
||||||
$this->app = $app;
|
$this->app = $app;
|
||||||
$this->request = $request;
|
$this->request = $request;
|
||||||
$this->response = $response;
|
$this->response = $response;
|
||||||
$this->l11n = $response !== null ? $response->getHeader()->getL11n() : null;
|
$this->l11n = $response !== null ? $response->getHeader()->getL11n() : new Localization();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -178,7 +178,7 @@ class View extends ViewAbstract
|
||||||
$match = '/Modules/';
|
$match = '/Modules/';
|
||||||
|
|
||||||
if (($start = strripos($this->template, $match)) === false) {
|
if (($start = strripos($this->template, $match)) === false) {
|
||||||
throw new InvalidModuleException($module);
|
throw new InvalidModuleException($module ?? '');
|
||||||
}
|
}
|
||||||
|
|
||||||
$start = $start + strlen($match);
|
$start = $start + strlen($match);
|
||||||
|
|
@ -190,7 +190,7 @@ class View extends ViewAbstract
|
||||||
$match = '/Theme/';
|
$match = '/Theme/';
|
||||||
|
|
||||||
if (($start = strripos($this->template, $match)) === false) {
|
if (($start = strripos($this->template, $match)) === false) {
|
||||||
throw new InvalidThemeException($theme);
|
throw new InvalidThemeException($theme ?? '');
|
||||||
}
|
}
|
||||||
|
|
||||||
$start = $start + strlen($match);
|
$start = $start + strlen($match);
|
||||||
|
|
@ -220,11 +220,11 @@ class View extends ViewAbstract
|
||||||
/**
|
/**
|
||||||
* Get request of view
|
* Get request of view
|
||||||
*
|
*
|
||||||
* @return RequestAbstract
|
* @return RequestAbstract|null
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function getRequest() : RequestAbstract
|
public function getRequest() : ?RequestAbstract
|
||||||
{
|
{
|
||||||
return $this->request;
|
return $this->request;
|
||||||
}
|
}
|
||||||
|
|
@ -232,11 +232,11 @@ class View extends ViewAbstract
|
||||||
/**
|
/**
|
||||||
* Get response of view
|
* Get response of view
|
||||||
*
|
*
|
||||||
* @return ResponseAbstract
|
* @return ResponseAbstract|null
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function getResponse() : ResponseAbstract
|
public function getResponse() : ?ResponseAbstract
|
||||||
{
|
{
|
||||||
return $this->response;
|
return $this->response;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user