Merge branch 'develop' of https://github.com/Orange-Management/phpOMS into develop

This commit is contained in:
Dennis Eichhorn 2021-02-06 13:47:19 +01:00
commit 244672c64e
65 changed files with 280 additions and 281 deletions

View File

@ -90,7 +90,6 @@ final class BasicOcr
throw new PathException($path); // @codeCoverageIgnore throw new PathException($path); // @codeCoverageIgnore
} }
if (($read = \fread($fp, 4)) === false || ($unpack = \unpack('N', $read)) === false) { if (($read = \fread($fp, 4)) === false || ($unpack = \unpack('N', $read)) === false) {
return []; // @codeCoverageIgnore return []; // @codeCoverageIgnore
} }
@ -105,7 +104,6 @@ final class BasicOcr
$numberOfImages = \min($numberOfImages, $limit); $numberOfImages = \min($numberOfImages, $limit);
} }
if (($read = \fread($fp, 4)) === false || ($unpack = \unpack('N', $read)) === false) { if (($read = \fread($fp, 4)) === false || ($unpack = \unpack('N', $read)) === false) {
return []; // @codeCoverageIgnore return []; // @codeCoverageIgnore
} }
@ -118,7 +116,6 @@ final class BasicOcr
$images = []; $images = [];
for ($i = 0; $i < $numberOfImages; ++$i) { for ($i = 0; $i < $numberOfImages; ++$i) {
if (($read = \fread($fp, $numberOfRows * $numberOfColumns)) === false if (($read = \fread($fp, $numberOfRows * $numberOfColumns)) === false
|| ($unpack = \unpack('C*', $read)) === false || ($unpack = \unpack('C*', $read)) === false
) { ) {
@ -153,7 +150,6 @@ final class BasicOcr
throw new PathException($path); // @codeCoverageIgnore throw new PathException($path); // @codeCoverageIgnore
} }
if (($read = \fread($fp, 4)) === false || ($unpack = \unpack('N', $read)) === false) { if (($read = \fread($fp, 4)) === false || ($unpack = \unpack('N', $read)) === false) {
return []; // @codeCoverageIgnore return []; // @codeCoverageIgnore
} }
@ -170,7 +166,6 @@ final class BasicOcr
$labels = []; $labels = [];
for ($i = 0; $i < $numberOfLabels; ++$i) { for ($i = 0; $i < $numberOfLabels; ++$i) {
if (($read = \fread($fp, 1)) === false || ($unpack = \unpack('C', $read)) === false) { if (($read = \fread($fp, 1)) === false || ($unpack = \unpack('C', $read)) === false) {
return []; // @codeCoverageIgnore return []; // @codeCoverageIgnore
} }

View File

@ -73,7 +73,7 @@ class Point implements PointInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getCoordinate(int $index) : int|float public function getCoordinate(int $index) : int | float
{ {
return $this->coordinates[$index]; return $this->coordinates[$index];
} }
@ -81,7 +81,7 @@ class Point implements PointInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function setCoordinate(int $index, int|float $value) : void public function setCoordinate(int $index, int | float $value) : void
{ {
$this->coordinates[$index] = $value; $this->coordinates[$index] = $value;
} }

View File

@ -46,7 +46,7 @@ interface PointInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getCoordinate(int $index) : int|float; public function getCoordinate(int $index) : int | float;
/** /**
* Set the coordinate of the point * Set the coordinate of the point
@ -58,5 +58,5 @@ interface PointInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setCoordinate(int $index, int|float $value) : void; public function setCoordinate(int $index, int | float $value) : void;
} }

View File

@ -54,7 +54,7 @@ final class DependencyResolver
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private static function dependencyResolve(int|string $item, array $items, array &$resolved, array &$unresolved) : void private static function dependencyResolve(int | string $item, array $items, array &$resolved, array &$unresolved) : void
{ {
$unresolved[] = $item; $unresolved[] = $item;

View File

@ -104,7 +104,7 @@ class Backpack implements BackpackInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function addItem(ItemInterface $item, int|float $quantity = 1) : void public function addItem(ItemInterface $item, int | float $quantity = 1) : void
{ {
$this->items[] = ['item' => $item, 'quantity' => $quantity]; $this->items[] = ['item' => $item, 'quantity' => $quantity];
$this->value += $item->getValue() * $quantity; $this->value += $item->getValue() * $quantity;

View File

@ -71,5 +71,5 @@ interface BackpackInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function addItem(ItemInterface $item, int|float $quantity = 1) : void; public function addItem(ItemInterface $item, int | float $quantity = 1) : void;
} }

View File

@ -33,7 +33,7 @@ interface OptionsInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function exists(int|string $key) : bool; public function exists(int | string $key) : bool;
/** /**
* Updating or adding settings. * Updating or adding settings.
@ -46,7 +46,7 @@ interface OptionsInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setOption(int|string $key, mixed $value, bool $overwrite = true) : bool; public function setOption(int | string $key, mixed $value, bool $overwrite = true) : bool;
/** /**
* Updating or adding settings. * Updating or adding settings.
@ -69,5 +69,5 @@ interface OptionsInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getOption(int|string $key) : mixed; public function getOption(int | string $key) : mixed;
} }

View File

@ -43,7 +43,7 @@ trait OptionsTrait
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function exists(int|string $key) : bool public function exists(int | string $key) : bool
{ {
return isset($this->options[$key]); return isset($this->options[$key]);
} }
@ -57,7 +57,7 @@ trait OptionsTrait
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getOption(int|string $key) : mixed public function getOption(int | string $key) : mixed
{ {
return $this->options[$key] ?? null; return $this->options[$key] ?? null;
} }
@ -95,7 +95,7 @@ trait OptionsTrait
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setOption(int|string $key, mixed $value, bool $overwrite = true) : bool public function setOption(int | string $key, mixed $value, bool $overwrite = true) : bool
{ {
if ($overwrite || !isset($this->options[$key])) { if ($overwrite || !isset($this->options[$key])) {
$this->options[$key] = $value; $this->options[$key] = $value;

View File

@ -43,7 +43,7 @@ interface SettingsInterface extends OptionsInterface
*/ */
public function get( public function get(
mixed $ids = null, mixed $ids = null,
string|array $names = null, string | array $names = null,
string $module = null, string $module = null,
int $group = null, int $group = null,
int $account = null int $account = null

View File

@ -37,7 +37,7 @@ interface ConnectionInterface extends DataStorageConnectionInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function set(int|string $key, mixed $value, int $expire = -1) : void; public function set(int | string $key, mixed $value, int $expire = -1) : void;
/** /**
* Increment value. * Increment value.
@ -49,7 +49,7 @@ interface ConnectionInterface extends DataStorageConnectionInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function increment(int|string $key, int $value = 1) : void; public function increment(int | string $key, int $value = 1) : void;
/** /**
* Decrement value. * Decrement value.
@ -61,7 +61,7 @@ interface ConnectionInterface extends DataStorageConnectionInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function decrement(int|string $key, int $value = 1) : void; public function decrement(int | string $key, int $value = 1) : void;
/** /**
* Rename cache key. * Rename cache key.
@ -74,7 +74,7 @@ interface ConnectionInterface extends DataStorageConnectionInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function rename(int|string $old, int|string $new, int $expire = -1) : void; public function rename(int | string $old, int | string $new, int $expire = -1) : void;
/** /**
* Adding new data if it doesn't exist. * Adding new data if it doesn't exist.
@ -87,7 +87,7 @@ interface ConnectionInterface extends DataStorageConnectionInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function add(int|string $key, mixed $value, int $expire = -1) : bool; public function add(int | string $key, mixed $value, int $expire = -1) : bool;
/** /**
* Get cache by key. * Get cache by key.
@ -99,7 +99,7 @@ interface ConnectionInterface extends DataStorageConnectionInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function get(int|string $key, int $expire = -1) : mixed; public function get(int | string $key, int $expire = -1) : mixed;
/** /**
* Get cache by pattern. * Get cache by pattern.
@ -123,7 +123,7 @@ interface ConnectionInterface extends DataStorageConnectionInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function exists(int|string $key, int $expire = -1) : bool; public function exists(int | string $key, int $expire = -1) : bool;
/** /**
* Remove value by key. * Remove value by key.
@ -135,7 +135,7 @@ interface ConnectionInterface extends DataStorageConnectionInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function delete(int|string $key, int $expire = -1) : bool; public function delete(int | string $key, int $expire = -1) : bool;
/** /**
* Remove value by pattern. * Remove value by pattern.
@ -180,7 +180,7 @@ interface ConnectionInterface extends DataStorageConnectionInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function replace(int|string $key, mixed $value, int $expire = -1) : bool; public function replace(int | string $key, mixed $value, int $expire = -1) : bool;
/** /**
* Updating expire. * Updating expire.
@ -192,7 +192,7 @@ interface ConnectionInterface extends DataStorageConnectionInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function updateExpire(int|string $key, int $expire = -1) : bool; public function updateExpire(int | string $key, int $expire = -1) : bool;
/** /**
* Requesting cache stats. * Requesting cache stats.

View File

@ -147,7 +147,7 @@ final class FileCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function set(int|string $key, mixed $value, int $expire = -1) : void public function set(int | string $key, mixed $value, int $expire = -1) : void
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return; return;
@ -168,7 +168,7 @@ final class FileCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function add(int|string $key, mixed $value, int $expire = -1) : bool public function add(int | string $key, mixed $value, int $expire = -1) : bool
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return false; return false;
@ -261,7 +261,7 @@ final class FileCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function get(int|string $key, int $expire = -1) : mixed public function get(int | string $key, int $expire = -1) : mixed
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return null; return null;
@ -362,7 +362,7 @@ final class FileCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function delete(int|string $key, int $expire = -1) : bool public function delete(int | string $key, int $expire = -1) : bool
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return false; return false;
@ -406,7 +406,7 @@ final class FileCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function exists(int|string $key, int $expire = -1) : bool public function exists(int | string $key, int $expire = -1) : bool
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return false; return false;
@ -452,7 +452,7 @@ final class FileCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function increment(int|string $key, int $value = 1) : void public function increment(int | string $key, int $value = 1) : void
{ {
$path = $this->getPath($key); $path = $this->getPath($key);
if (!File::exists($path)) { if (!File::exists($path)) {
@ -485,7 +485,7 @@ final class FileCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function decrement(int|string $key, int $value = 1) : void public function decrement(int | string $key, int $value = 1) : void
{ {
$path = $this->getPath($key); $path = $this->getPath($key);
if (!File::exists($path)) { if (!File::exists($path)) {
@ -518,7 +518,7 @@ final class FileCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function rename(int|string $old, int|string $new, int $expire = -1) : void public function rename(int | string $old, int | string $new, int $expire = -1) : void
{ {
$value = $this->get($old); $value = $this->get($old);
$this->set($new, $value, $expire); $this->set($new, $value, $expire);
@ -622,7 +622,7 @@ final class FileCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function updateExpire(int|string $key, int $expire = -1) : bool public function updateExpire(int | string $key, int $expire = -1) : bool
{ {
$value = $this->get($key, $expire); $value = $this->get($key, $expire);
$this->delete($key); $this->delete($key);
@ -660,7 +660,7 @@ final class FileCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function replace(int|string $key, mixed $value, int $expire = -1) : bool public function replace(int | string $key, mixed $value, int $expire = -1) : bool
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return false; return false;
@ -693,7 +693,7 @@ final class FileCache extends ConnectionAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function getPath(int|string $key) : string private function getPath(int | string $key) : string
{ {
$path = Directory::sanitize((string) $key, self::SANITIZE); $path = Directory::sanitize((string) $key, self::SANITIZE);
return $this->con . '/' . \trim($path, '/') . '.cache'; return $this->con . '/' . \trim($path, '/') . '.cache';

View File

@ -80,7 +80,7 @@ final class MemCached extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function set(int|string $key, mixed $value, int $expire = -1) : void public function set(int | string $key, mixed $value, int $expire = -1) : void
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return; return;
@ -96,7 +96,7 @@ final class MemCached extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function add(int|string $key, mixed $value, int $expire = -1) : bool public function add(int | string $key, mixed $value, int $expire = -1) : bool
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return false; return false;
@ -112,7 +112,7 @@ final class MemCached extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function get(int|string $key, int $expire = -1) : mixed public function get(int | string $key, int $expire = -1) : mixed
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return null; return null;
@ -130,7 +130,7 @@ final class MemCached extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function delete(int|string $key, int $expire = -1) : bool public function delete(int | string $key, int $expire = -1) : bool
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return false; return false;
@ -142,7 +142,7 @@ final class MemCached extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function exists(int|string $key, int $expire = -1) : bool public function exists(int | string $key, int $expire = -1) : bool
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return false; return false;
@ -154,7 +154,7 @@ final class MemCached extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function increment(int|string $key, int $value = 1) : void public function increment(int | string $key, int $value = 1) : void
{ {
$this->con->increment($key, $value); $this->con->increment($key, $value);
} }
@ -162,7 +162,7 @@ final class MemCached extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function decrement(int|string $key, int $value = 1) : void public function decrement(int | string $key, int $value = 1) : void
{ {
$this->con->decrement($key, $value); $this->con->decrement($key, $value);
} }
@ -170,7 +170,7 @@ final class MemCached extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function rename(int|string $old, int|string $new, int $expire = -1) : void public function rename(int | string $old, int | string $new, int $expire = -1) : void
{ {
$value = $this->get($old); $value = $this->get($old);
$this->set($new, $value, $expire); $this->set($new, $value, $expire);
@ -227,7 +227,7 @@ final class MemCached extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function updateExpire(int|string $key, int $expire = -1) : bool public function updateExpire(int | string $key, int $expire = -1) : bool
{ {
if ($expire > 0) { if ($expire > 0) {
$this->con->touch($key, $expire); $this->con->touch($key, $expire);
@ -261,7 +261,7 @@ final class MemCached extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function replace(int|string $key, mixed $value, int $expire = -1) : bool public function replace(int | string $key, mixed $value, int $expire = -1) : bool
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return false; return false;

View File

@ -34,28 +34,28 @@ final class NullCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function set(int|string $key, mixed $value, int $expire = -1) : void public function set(int | string $key, mixed $value, int $expire = -1) : void
{ {
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function increment(int|string $key, int $value = 1) : void public function increment(int | string $key, int $value = 1) : void
{ {
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function decrement(int|string $key, int $value = 1) : void public function decrement(int | string $key, int $value = 1) : void
{ {
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function add(int|string $key, mixed $value, int $expire = -1) : bool public function add(int | string $key, mixed $value, int $expire = -1) : bool
{ {
return true; return true;
} }
@ -63,7 +63,7 @@ final class NullCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function get(int|string $key, int $expire = -1) : mixed public function get(int | string $key, int $expire = -1) : mixed
{ {
return null; return null;
} }
@ -71,7 +71,7 @@ final class NullCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function delete(int|string $key, int $expire = -1) : bool public function delete(int | string $key, int $expire = -1) : bool
{ {
return true; return true;
} }
@ -95,7 +95,7 @@ final class NullCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function replace(int|string $key, mixed $value, int $expire = -1) : bool public function replace(int | string $key, mixed $value, int $expire = -1) : bool
{ {
return true; return true;
} }
@ -119,7 +119,7 @@ final class NullCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function exists(int|string $key, int $expire = -1) : bool public function exists(int | string $key, int $expire = -1) : bool
{ {
return false; return false;
} }
@ -127,7 +127,7 @@ final class NullCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function rename(int|string $old, int|string $new, int $expire = -1) : void public function rename(int | string $old, int | string $new, int $expire = -1) : void
{ {
} }
@ -150,7 +150,7 @@ final class NullCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function updateExpire(int|string $key, int $expire = -1) : bool public function updateExpire(int | string $key, int $expire = -1) : bool
{ {
return true; return true;
} }

View File

@ -104,7 +104,7 @@ final class RedisCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function set(int|string $key, mixed $value, int $expire = -1) : void public function set(int | string $key, mixed $value, int $expire = -1) : void
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return; return;
@ -122,7 +122,7 @@ final class RedisCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function add(int|string $key, mixed $value, int $expire = -1) : bool public function add(int | string $key, mixed $value, int $expire = -1) : bool
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return false; return false;
@ -138,7 +138,7 @@ final class RedisCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function get(int|string $key, int $expire = -1) : mixed public function get(int | string $key, int $expire = -1) : mixed
{ {
if ($this->status !== CacheStatus::OK || $this->con->exists($key) < 1) { if ($this->status !== CacheStatus::OK || $this->con->exists($key) < 1) {
return null; return null;
@ -158,7 +158,7 @@ final class RedisCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function delete(int|string $key, int $expire = -1) : bool public function delete(int | string $key, int $expire = -1) : bool
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return false; return false;
@ -170,7 +170,7 @@ final class RedisCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function exists(int|string $key, int $expire = -1) : bool public function exists(int | string $key, int $expire = -1) : bool
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return false; return false;
@ -182,7 +182,7 @@ final class RedisCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function increment(int|string $key, int $value = 1) : void public function increment(int | string $key, int $value = 1) : void
{ {
$this->con->incrBy($key, $value); $this->con->incrBy($key, $value);
} }
@ -190,7 +190,7 @@ final class RedisCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function decrement(int|string $key, int $value = 1) : void public function decrement(int | string $key, int $value = 1) : void
{ {
$this->con->decrBy($key, $value); $this->con->decrBy($key, $value);
} }
@ -198,7 +198,7 @@ final class RedisCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function rename(int|string $old, int|string $new, int $expire = -1) : void public function rename(int | string $old, int | string $new, int $expire = -1) : void
{ {
$this->con->rename($old, $new); $this->con->rename($old, $new);
@ -257,7 +257,7 @@ final class RedisCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function updateExpire(int|string $key, int $expire = -1) : bool public function updateExpire(int | string $key, int $expire = -1) : bool
{ {
if ($expire > 0) { if ($expire > 0) {
$this->con->expire($key, $expire); $this->con->expire($key, $expire);
@ -291,7 +291,7 @@ final class RedisCache extends ConnectionAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function replace(int|string $key, mixed $value, int $expire = -1) : bool public function replace(int | string $key, mixed $value, int $expire = -1) : bool
{ {
if ($this->status !== CacheStatus::OK) { if ($this->status !== CacheStatus::OK) {
return false; return false;

View File

@ -333,7 +333,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function bind(string|array $binds) : self public function bind(string | array $binds) : self
{ {
if (\is_array($binds)) { if (\is_array($binds)) {
$this->binds += $binds; $this->binds += $binds;
@ -541,7 +541,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function where(string|array|Where $columns, string|array $operator = null, mixed $values = null, string|array $boolean = 'and') : self public function where(string | array | Where $columns, string | array $operator = null, mixed $values = null, string | array $boolean = 'and') : self
{ {
if (!\is_array($columns)) { if (!\is_array($columns)) {
$columns = [$columns]; $columns = [$columns];
@ -580,7 +580,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function andWhere(string|array|Where $where, string|array $operator = null, mixed $values = null) : self public function andWhere(string | array | Where $where, string | array $operator = null, mixed $values = null) : self
{ {
return $this->where($where, $operator, $values, 'and'); return $this->where($where, $operator, $values, 'and');
} }
@ -596,7 +596,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function orWhere(string|array|Where $where, string|array $operator = null, mixed $values = null) : self public function orWhere(string | array | Where $where, string | array $operator = null, mixed $values = null) : self
{ {
return $this->where($where, $operator, $values, 'or'); return $this->where($where, $operator, $values, 'or');
} }
@ -612,7 +612,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function whereIn(string|array|Where $column, mixed $values = null, string $boolean = 'and') : self public function whereIn(string | array | Where $column, mixed $values = null, string $boolean = 'and') : self
{ {
$this->where($column, 'in', $values, $boolean); $this->where($column, 'in', $values, $boolean);
@ -629,7 +629,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function whereNull(string|array|Where $column, string $boolean = 'and') : self public function whereNull(string | array | Where $column, string $boolean = 'and') : self
{ {
$this->where($column, '=', null, $boolean); $this->where($column, '=', null, $boolean);
@ -646,7 +646,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function whereNotNull(string|array|Where $column, string $boolean = 'and') : self public function whereNotNull(string | array | Where $column, string $boolean = 'and') : self
{ {
$this->where($column, '!=', null, $boolean); $this->where($column, '!=', null, $boolean);
@ -719,7 +719,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function orderBy(string|array $columns, string|array $order = 'DESC') : self public function orderBy(string | array $columns, string | array $order = 'DESC') : self
{ {
if (\is_string($columns)) { if (\is_string($columns)) {
if (!\is_string($order)) { if (!\is_string($order)) {
@ -1112,7 +1112,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function join(string|self $table, string $type = JoinType::JOIN, string $alias = null) : self public function join(string | self $table, string $type = JoinType::JOIN, string $alias = null) : self
{ {
$this->joins[$alias ?? $table] = ['type' => $type, 'table' => $table, 'alias' => $alias]; $this->joins[$alias ?? $table] = ['type' => $type, 'table' => $table, 'alias' => $alias];
@ -1129,7 +1129,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function leftJoin(string|self $column, string $alias = null) : self public function leftJoin(string | self $column, string $alias = null) : self
{ {
return $this->join($column, JoinType::LEFT_JOIN, $alias); return $this->join($column, JoinType::LEFT_JOIN, $alias);
} }
@ -1144,7 +1144,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function leftOuterJoin(string|self $column, string $alias = null) : self public function leftOuterJoin(string | self $column, string $alias = null) : self
{ {
return $this->join($column, JoinType::LEFT_OUTER_JOIN, $alias); return $this->join($column, JoinType::LEFT_OUTER_JOIN, $alias);
} }
@ -1159,7 +1159,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function leftInnerJoin(string|self $column, string $alias = null) : self public function leftInnerJoin(string | self $column, string $alias = null) : self
{ {
return $this->join($column, JoinType::LEFT_INNER_JOIN, $alias); return $this->join($column, JoinType::LEFT_INNER_JOIN, $alias);
} }
@ -1174,7 +1174,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function rightJoin(string|self $column, string $alias = null) : self public function rightJoin(string | self $column, string $alias = null) : self
{ {
return $this->join($column, JoinType::RIGHT_JOIN, $alias); return $this->join($column, JoinType::RIGHT_JOIN, $alias);
} }
@ -1189,7 +1189,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function rightOuterJoin(string|self $column, string $alias = null) : self public function rightOuterJoin(string | self $column, string $alias = null) : self
{ {
return $this->join($column, JoinType::RIGHT_OUTER_JOIN, $alias); return $this->join($column, JoinType::RIGHT_OUTER_JOIN, $alias);
} }
@ -1204,7 +1204,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function rightInnerJoin(string|self $column, string $alias = null) : self public function rightInnerJoin(string | self $column, string $alias = null) : self
{ {
return $this->join($column, JoinType::RIGHT_INNER_JOIN, $alias); return $this->join($column, JoinType::RIGHT_INNER_JOIN, $alias);
} }
@ -1219,7 +1219,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function outerJoin(string|self $column, string $alias = null) : self public function outerJoin(string | self $column, string $alias = null) : self
{ {
return $this->join($column, JoinType::OUTER_JOIN, $alias); return $this->join($column, JoinType::OUTER_JOIN, $alias);
} }
@ -1234,7 +1234,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function innerJoin(string|self $column, string $alias = null) : self public function innerJoin(string | self $column, string $alias = null) : self
{ {
return $this->join($column, JoinType::INNER_JOIN, $alias); return $this->join($column, JoinType::INNER_JOIN, $alias);
} }
@ -1249,7 +1249,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function crossJoin(string|self $column, string $alias = null) : self public function crossJoin(string | self $column, string $alias = null) : self
{ {
return $this->join($column, JoinType::CROSS_JOIN, $alias); return $this->join($column, JoinType::CROSS_JOIN, $alias);
} }
@ -1264,7 +1264,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function fullJoin(string|self $column, string $alias = null) : self public function fullJoin(string | self $column, string $alias = null) : self
{ {
return $this->join($column, JoinType::FULL_JOIN, $alias); return $this->join($column, JoinType::FULL_JOIN, $alias);
} }
@ -1279,7 +1279,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function fullOuterJoin(string|self $column, string $alias = null) : self public function fullOuterJoin(string | self $column, string $alias = null) : self
{ {
return $this->join($column, JoinType::FULL_OUTER_JOIN, $alias); return $this->join($column, JoinType::FULL_OUTER_JOIN, $alias);
} }
@ -1309,7 +1309,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function on(string|array $columns, string|array $operator = null, string|array $values = null, string|array $boolean = 'and', string $table = null) : self public function on(string | array $columns, string | array $operator = null, string | array $values = null, string | array $boolean = 'and', string $table = null) : self
{ {
if ($operator !== null && !\is_array($operator) && !\in_array(\strtolower($operator), self::OPERATORS)) { if ($operator !== null && !\is_array($operator) && !\in_array(\strtolower($operator), self::OPERATORS)) {
throw new \InvalidArgumentException('Unknown operator.'); throw new \InvalidArgumentException('Unknown operator.');
@ -1355,7 +1355,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function orOn(string|array $columns, string|array $operator = null, string|array $values = null) : self public function orOn(string | array $columns, string | array $operator = null, string | array $values = null) : self
{ {
return $this->on($columns, $operator, $values, 'or'); return $this->on($columns, $operator, $values, 'or');
} }
@ -1371,7 +1371,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function andOn(string|array $columns, string|array $operator = null, string|array $values = null) : self public function andOn(string | array $columns, string | array $operator = null, string | array $values = null) : self
{ {
return $this->on($columns, $operator, $values, 'and'); return $this->on($columns, $operator, $values, 'and');
} }
@ -1413,7 +1413,7 @@ class Builder extends BuilderAbstract
$sth->execute(); $sth->execute();
} catch (\Throwable $t) { } catch (\Throwable $t) {
var_dump($this->toSql()); \var_dump($this->toSql());
} }
return $sth; return $sth;

View File

@ -62,7 +62,7 @@ final class Dispatcher implements DispatcherInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function dispatch(array|string|\Closure $controller, ...$data) : array public function dispatch(array | string | \Closure $controller, ...$data) : array
{ {
$views = []; $views = [];

View File

@ -36,5 +36,5 @@ interface DispatcherInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function dispatch(array|string|\Closure $controller, ...$data) : array; public function dispatch(array | string | \Closure $controller, ...$data) : array;
} }

View File

@ -70,7 +70,7 @@ final class EventManager implements \Countable
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function dispatch(array|string|\Closure $func, ...$data) : array public function dispatch(array | string | \Closure $func, ...$data) : array
{ {
if (!($func instanceof \Closure)) { if (!($func instanceof \Closure)) {
return []; return [];
@ -132,7 +132,7 @@ final class EventManager implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function attach(string $group, string|\Closure $callback, bool $remove = false, bool $reset = false) : bool public function attach(string $group, string | \Closure $callback, bool $remove = false, bool $reset = false) : bool
{ {
if (!isset($this->callbacks[$group])) { if (!isset($this->callbacks[$group])) {
$this->callbacks[$group] = ['remove' => $remove, 'reset' => $reset, 'callbacks' => []]; $this->callbacks[$group] = ['remove' => $remove, 'reset' => $reset, 'callbacks' => []];

View File

@ -211,7 +211,7 @@ final class L11nManager
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getNumeric(Localization $l11n, int|float $numeric, string $format = null) : string public function getNumeric(Localization $l11n, int | float $numeric, string $format = null) : string
{ {
return \number_format( return \number_format(
$numeric, $numeric,
@ -254,7 +254,7 @@ final class L11nManager
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getCurrency(Localization $l11n, int|float $currency, string $format = null, string $symbol = null, int $divide = 1) : string public function getCurrency(Localization $l11n, int | float $currency, string $format = null, string $symbol = null, int $divide = 1) : string
{ {
$language = $l11n->getLanguage() ?? 'en'; $language = $l11n->getLanguage() ?? 'en';
$symbol ??= $l11n->getCurrency(); $symbol ??= $l11n->getCurrency();

View File

@ -83,7 +83,7 @@ final class Money implements \Serializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function __construct(int|float|string $value = 0, string $thousands = ',', string $decimal = '.', string $symbol = '', int $position = 0) public function __construct(int | float | string $value = 0, string $thousands = ',', string $decimal = '.', string $symbol = '', int $position = 0)
{ {
$this->value = \is_int($value) ? $value : self::toInt((string) $value); $this->value = \is_int($value) ? $value : self::toInt((string) $value);
$this->thousands = $thousands; $this->thousands = $thousands;
@ -222,7 +222,7 @@ final class Money implements \Serializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function add(int|float|string|self $value) : self public function add(int | float | string | self $value) : self
{ {
if (\is_string($value) || \is_float($value)) { if (\is_string($value) || \is_float($value)) {
$this->value += self::toInt((string) $value, $this->thousands, $this->decimal); $this->value += self::toInt((string) $value, $this->thousands, $this->decimal);
@ -256,7 +256,7 @@ final class Money implements \Serializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function sub(int|float|string|self $value) : self public function sub(int | float | string | self $value) : self
{ {
if (\is_string($value) || \is_float($value)) { if (\is_string($value) || \is_float($value)) {
$this->value -= self::toInt((string) $value, $this->thousands, $this->decimal); $this->value -= self::toInt((string) $value, $this->thousands, $this->decimal);
@ -278,7 +278,7 @@ final class Money implements \Serializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function mult(int|float $value) : self public function mult(int | float $value) : self
{ {
$this->value = (int) ($this->value * $value); $this->value = (int) ($this->value * $value);
@ -294,7 +294,7 @@ final class Money implements \Serializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function div(int|float $value) : self public function div(int | float $value) : self
{ {
$this->value = (int) ($this->value / $value); $this->value = (int) ($this->value / $value);
@ -324,7 +324,7 @@ final class Money implements \Serializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function pow(int|float $value) : self public function pow(int | float $value) : self
{ {
$this->value = (int) ($this->value ** $value); $this->value = (int) ($this->value ** $value);

View File

@ -43,7 +43,7 @@ final class Gamma
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function gamma(int|float $z) : float public static function gamma(int | float $z) : float
{ {
return \exp(self::logGamma($z)); return \exp(self::logGamma($z));
} }
@ -68,7 +68,7 @@ final class Gamma
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function lanczosApproximationReal(int|float $z) : float public static function lanczosApproximationReal(int | float $z) : float
{ {
if ($z < 0.5) { if ($z < 0.5) {
return \M_PI / (\sin(\M_PI * $z) * self::lanczosApproximationReal(1 - $z)); return \M_PI / (\sin(\M_PI * $z) * self::lanczosApproximationReal(1 - $z));
@ -94,7 +94,7 @@ final class Gamma
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function stirlingApproximation(int|float $x) : float public static function stirlingApproximation(int | float $x) : float
{ {
return \sqrt(2.0 * \M_PI / $x) * \pow($x / \M_E, $x); return \sqrt(2.0 * \M_PI / $x) * \pow($x / \M_E, $x);
} }
@ -108,7 +108,7 @@ final class Gamma
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function spougeApproximation(int|float $z) : float public static function spougeApproximation(int | float $z) : float
{ {
$k1_fact = 1.0; $k1_fact = 1.0;
$c = [\sqrt(2.0 * \M_PI)]; $c = [\sqrt(2.0 * \M_PI)];
@ -139,7 +139,7 @@ final class Gamma
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function logGamma(int|float $z) : float public static function logGamma(int | float $z) : float
{ {
static $approx = [ static $approx = [
76.18009172947146,-86.50532032941677, 76.18009172947146,-86.50532032941677,

View File

@ -109,7 +109,7 @@ class Matrix implements \ArrayAccess, \Iterator
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function set(int $m, int $n, int|float $value) : void public function set(int $m, int $n, int | float $value) : void
{ {
if (!isset($this->matrix[$m], $this->matrix[$m][$n])) { if (!isset($this->matrix[$m], $this->matrix[$m][$n])) {
throw new InvalidDimensionException($m . 'x' . $n); throw new InvalidDimensionException($m . 'x' . $n);
@ -130,7 +130,7 @@ class Matrix implements \ArrayAccess, \Iterator
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function get(int $m, int $n = 0) : int|float public function get(int $m, int $n = 0) : int | float
{ {
if (!isset($this->matrix[$m], $this->matrix[$m][$n])) { if (!isset($this->matrix[$m], $this->matrix[$m][$n])) {
throw new InvalidDimensionException($m . 'x' . $n); throw new InvalidDimensionException($m . 'x' . $n);
@ -382,7 +382,7 @@ class Matrix implements \ArrayAccess, \Iterator
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function sub(int|float|self $value) : self public function sub(int | float | self $value) : self
{ {
if (\is_numeric($value)) { if (\is_numeric($value)) {
return $this->addScalar(-$value); return $this->addScalar(-$value);
@ -400,7 +400,7 @@ class Matrix implements \ArrayAccess, \Iterator
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function add(int|float|self $value) : self public function add(int | float | self $value) : self
{ {
if (\is_numeric($value)) { if (\is_numeric($value)) {
return $this->addScalar($value); return $this->addScalar($value);
@ -472,7 +472,7 @@ class Matrix implements \ArrayAccess, \Iterator
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function addScalar(int|float $scalar) : self private function addScalar(int | float $scalar) : self
{ {
$newMatrixArr = $this->matrix; $newMatrixArr = $this->matrix;
@ -497,7 +497,7 @@ class Matrix implements \ArrayAccess, \Iterator
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function mult(int|float|self $value) : self public function mult(int | float | self $value) : self
{ {
if (\is_numeric($value)) { if (\is_numeric($value)) {
return $this->multScalar($value); return $this->multScalar($value);
@ -554,7 +554,7 @@ class Matrix implements \ArrayAccess, \Iterator
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function multScalar(int|float $scalar) : self private function multScalar(int | float $scalar) : self
{ {
$newMatrixArr = $this->matrix; $newMatrixArr = $this->matrix;

View File

@ -51,7 +51,7 @@ final class Vector extends Matrix
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setV(int $m, int|float $value) : void public function setV(int $m, int | float $value) : void
{ {
parent::set($m , 0, $value); parent::set($m , 0, $value);
} }
@ -65,7 +65,7 @@ final class Vector extends Matrix
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getV(int $m) : int|float public function getV(int $m) : int | float
{ {
return parent::get($m, 0); return parent::get($m, 0);
} }

View File

@ -48,7 +48,7 @@ final class Complex
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function __construct(int|float $re = 0, int|float $im = 0) public function __construct(int | float $re = 0, int | float $im = 0)
{ {
$this->re = $re; $this->re = $re;
$this->im = $im; $this->im = $im;
@ -61,7 +61,7 @@ final class Complex
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function re() : int|float public function re() : int | float
{ {
return $this->re; return $this->re;
} }
@ -73,7 +73,7 @@ final class Complex
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function im() : int|float public function im() : int | float
{ {
return $this->im; return $this->im;
} }
@ -129,7 +129,7 @@ final class Complex
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function abs() : int|float public function abs() : int | float
{ {
return \sqrt($this->re ** 2 + $this->im ** 2); return \sqrt($this->re ** 2 + $this->im ** 2);
} }
@ -155,7 +155,7 @@ final class Complex
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function pow(int|float|self $value) : self public function pow(int | float | self $value) : self
{ {
if (\is_int($value)) { if (\is_int($value)) {
return $this->powInteger($value); return $this->powInteger($value);
@ -209,7 +209,7 @@ final class Complex
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function powScalar(int|float $value) : self public function powScalar(int | float $value) : self
{ {
return $this; return $this;
} }
@ -223,7 +223,7 @@ final class Complex
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function add(int|float|self $value) : self public function add(int | float | self $value) : self
{ {
if (\is_numeric($value)) { if (\is_numeric($value)) {
return $this->addScalar($value); return $this->addScalar($value);
@ -255,7 +255,7 @@ final class Complex
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function addScalar(int|float $val) : self private function addScalar(int | float $val) : self
{ {
return new self($this->re + $val, $this->im); return new self($this->re + $val, $this->im);
} }
@ -269,7 +269,7 @@ final class Complex
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function sub(int|float|self $value) : self public function sub(int | float | self $value) : self
{ {
if (\is_numeric($value)) { if (\is_numeric($value)) {
return $this->subScalar($value); return $this->subScalar($value);
@ -301,7 +301,7 @@ final class Complex
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function subScalar(int|float $val) : self private function subScalar(int | float $val) : self
{ {
return new self($this->re - $val, $this->im); return new self($this->re - $val, $this->im);
} }
@ -315,7 +315,7 @@ final class Complex
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function mult(int|float|self $value) : self public function mult(int | float | self $value) : self
{ {
if (\is_numeric($value)) { if (\is_numeric($value)) {
return $this->multScalar($value); return $this->multScalar($value);
@ -350,7 +350,7 @@ final class Complex
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function multScalar(int|float $val) : self private function multScalar(int | float $val) : self
{ {
return new self($this->re * $val, $this->im * $val); return new self($this->re * $val, $this->im * $val);
} }
@ -366,7 +366,7 @@ final class Complex
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function div(int|float|self $value) : self public function div(int | float | self $value) : self
{ {
if (\is_numeric($value)) { if (\is_numeric($value)) {
return $this->divScalar($value); return $this->divScalar($value);
@ -401,7 +401,7 @@ final class Complex
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function divScalar(int|float $val) : self private function divScalar(int | float $val) : self
{ {
return new self($this->re / $val, $this->im / $val); return new self($this->re / $val, $this->im / $val);
} }

View File

@ -144,7 +144,7 @@ final class CubicSplineInterpolation implements InterpolationInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function interpolate(int|float $x) : float public function interpolate(int | float $x) : float
{ {
$n = \count($this->points); $n = \count($this->points);
$xPos = $n - 1; $xPos = $n - 1;

View File

@ -33,5 +33,5 @@ interface InterpolationInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function interpolate(int|float $x) : float; public function interpolate(int | float $x) : float;
} }

View File

@ -46,7 +46,7 @@ final class LagrangeInterpolation implements InterpolationInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function interpolate(int|float $x) : float public function interpolate(int | float $x) : float
{ {
$n = \count($this->points); $n = \count($this->points);
$result = 0.0; $result = 0.0;

View File

@ -96,7 +96,7 @@ final class LinearInterpolation implements InterpolationInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function interpolate(int|float $x) : float public function interpolate(int | float $x) : float
{ {
$n = \count($this->points); $n = \count($this->points);
$xPos = $n - 1; $xPos = $n - 1;

View File

@ -81,7 +81,7 @@ final class Evaluator
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private static function parseValue(int|float|string $value) : int|float private static function parseValue(int | float | string $value) : int | float
{ {
return !\is_string($value) return !\is_string($value)
? $value ? $value

View File

@ -20,11 +20,11 @@ declare(strict_types=1);
namespace phpOMS\Message\Mail; namespace phpOMS\Message\Mail;
use phpOMS\System\CharsetType; use phpOMS\System\CharsetType;
use phpOMS\System\MimeType;
use phpOMS\Validation\Network\Email as EmailValidator;
use phpOMS\System\File\FileUtils; use phpOMS\System\File\FileUtils;
use phpOMS\Utils\MbStringUtils; use phpOMS\System\MimeType;
use phpOMS\System\SystemUtils; use phpOMS\System\SystemUtils;
use phpOMS\Utils\MbStringUtils;
use phpOMS\Validation\Network\Email as EmailValidator;
/** /**
* Mail class. * Mail class.
@ -563,8 +563,8 @@ class Email implements MessageInterface
* Parse and validate a string containing one or more RFC822-style comma-separated email addresses * Parse and validate a string containing one or more RFC822-style comma-separated email addresses
* of the form "display name <address>" into an array of name/address pairs. * of the form "display name <address>" into an array of name/address pairs.
* *
* @param string $addrstr Address line * @param string $addrstr Address line
* @param bool $useImap Use imap for parsing * @param bool $useImap Use imap for parsing
* *
* @return array * @return array
* *
@ -580,7 +580,7 @@ class Email implements MessageInterface
&& EmailValidator::isValid($address->mailbox . '@' . $address->host) && EmailValidator::isValid($address->mailbox . '@' . $address->host)
) { ) {
$addresses[] = [ $addresses[] = [
'name' => (\property_exists($address, 'personal') ? $address->personal : ''), 'name' => (\property_exists($address, 'personal') ? $address->personal : ''),
'address' => $address->mailbox . '@' . $address->host, 'address' => $address->mailbox . '@' . $address->host,
]; ];
} }
@ -591,11 +591,11 @@ class Email implements MessageInterface
$list = \explode(',', $addrstr); $list = \explode(',', $addrstr);
foreach ($list as $address) { foreach ($list as $address) {
$address = trim($address); $address = \trim($address);
if (\strpos($address, '<') === false) { if (\strpos($address, '<') === false) {
if (EmailValidator::isValid($address)) { if (EmailValidator::isValid($address)) {
$addresses[] = [ $addresses[] = [
'name' => '', 'name' => '',
'address' => $address, 'address' => $address,
]; ];
} }
@ -605,7 +605,7 @@ class Email implements MessageInterface
if (EmailValidator::isValid($email)) { if (EmailValidator::isValid($email)) {
$addresses[] = [ $addresses[] = [
'name' => \trim(\str_replace(['"', "'"], '', $name)), 'name' => \trim(\str_replace(['"', "'"], '', $name)),
'address' => $email, 'address' => $email,
]; ];
} }
@ -670,7 +670,7 @@ class Email implements MessageInterface
$this->bodyMime $this->bodyMime
); );
$this->headerMime = rtrim($this->headerMime, " \r\n\t") . self::$LE . $this->headerMime = \rtrim($this->headerMime, " \r\n\t") . self::$LE .
self::normalizeBreaks($headerDkim, self::$LE) . self::$LE; self::normalizeBreaks($headerDkim, self::$LE) . self::$LE;
} }
@ -876,7 +876,7 @@ class Email implements MessageInterface
$domain = \mb_convert_encoding($domain, 'UTF-8', $charset); $domain = \mb_convert_encoding($domain, 'UTF-8', $charset);
$errorcode = 0; $errorcode = 0;
if (defined('INTL_IDNA_VARIANT_UTS46')) { if (\defined('INTL_IDNA_VARIANT_UTS46')) {
$punycode = \idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_UTS46); $punycode = \idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_UTS46);
} else { } else {
$punycode = \idn_to_ascii($domain, $errorcode); $punycode = \idn_to_ascii($domain, $errorcode);
@ -999,7 +999,7 @@ class Email implements MessageInterface
$body .= $mimePre; $body .= $mimePre;
$body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, MimeType::M_TEXT, $altBodyEncoding); $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, MimeType::M_TEXT, $altBodyEncoding);
$body .= $this->encodeString($this->bodyAlt, $altBodyEncoding) . self::$LE; $body .= $this->encodeString($this->bodyAlt, $altBodyEncoding) . self::$LE;
$body .= $this->getBoundary( $this->boundary[1], $bodyCharSet, MimeType::M_HTML, $bodyEncoding); $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, MimeType::M_HTML, $bodyEncoding);
$body .= $this->encodeString($this->body, $bodyEncoding) . self::$LE; $body .= $this->encodeString($this->body, $bodyEncoding) . self::$LE;
if (!empty($this->ical)) { if (!empty($this->ical)) {
@ -1085,7 +1085,7 @@ class Email implements MessageInterface
} }
if (!empty($this->signKeyFile)) { if (!empty($this->signKeyFile)) {
if (!defined('PKCS7_TEXT')) { if (!\defined('PKCS7_TEXT')) {
return ''; return '';
} }
@ -1104,7 +1104,7 @@ class Email implements MessageInterface
'file://' . \realpath($this->signCertFile), 'file://' . \realpath($this->signCertFile),
['file://' . \realpath($this->signKeyFile), $this->signKeyPass], ['file://' . \realpath($this->signKeyFile), $this->signKeyPass],
[], [],
PKCS7_DETACHED, \PKCS7_DETACHED,
$this->signExtracertFiles $this->signExtracertFiles
); );
@ -1235,7 +1235,7 @@ class Email implements MessageInterface
// Allow for bypassing the Content-Disposition header // Allow for bypassing the Content-Disposition header
if (!empty($disposition)) { if (!empty($disposition)) {
$encodedName = $this->encodeHeader(\trim(\str_replace(["\r", "\n"], '', $name))); $encodedName = $this->encodeHeader(\trim(\str_replace(["\r", "\n"], '', $name)));
$mime[] = !empty($encodedName) $mime[] = !empty($encodedName)
? \sprintf('Content-Disposition: %s; filename=%s%s', ? \sprintf('Content-Disposition: %s; filename=%s%s',
$disposition, $disposition,
self::quotedString($encodedName), self::quotedString($encodedName),
@ -1317,7 +1317,7 @@ class Email implements MessageInterface
private function encodeString(string $str, string $encoding = EncodingType::E_BASE64) : string private function encodeString(string $str, string $encoding = EncodingType::E_BASE64) : string
{ {
$encoded = ''; $encoded = '';
switch (strtolower($encoding)) { switch (\strtolower($encoding)) {
case EncodingType::E_BASE64: case EncodingType::E_BASE64:
$encoded = \chunk_split(\base64_encode($str), self::STD_LINE_LENGTH, self::$LE); $encoded = \chunk_split(\base64_encode($str), self::STD_LINE_LENGTH, self::$LE);
break; break;
@ -1406,7 +1406,6 @@ class Email implements MessageInterface
return false; return false;
} }
/** /**
* Create address list * Create address list
* *
@ -1424,7 +1423,7 @@ class Email implements MessageInterface
$addresses[] = $this->addrFormat($address); $addresses[] = $this->addrFormat($address);
} }
return $type . ': ' . implode(', ', $addresses) . static::$LE; return $type . ': ' . \implode(', ', $addresses) . static::$LE;
} }
/** /**
@ -1582,7 +1581,7 @@ class Email implements MessageInterface
return $str === $encoded && !\preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str) return $str === $encoded && !\preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)
? $encoded ? $encoded
: "\"$encoded\""; : "\"${encoded}\"";
} }
$matchcount = \preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); $matchcount = \preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
@ -1628,13 +1627,13 @@ class Email implements MessageInterface
$maxLen -= $maxLen % 4; $maxLen -= $maxLen % 4;
$encoded = \trim(\chunk_split($encoded, $maxLen, "\n")); $encoded = \trim(\chunk_split($encoded, $maxLen, "\n"));
} }
$encoded = \preg_replace('/^(.*)$/m', ' =?' . $charset . "?$encoding?\\1?=", $encoded); $encoded = \preg_replace('/^(.*)$/m', ' =?' . $charset . "?${encoding}?\\1?=", $encoded);
break; break;
case 'Q': case 'Q':
$encoded = $this->encodeQ($str, $position); $encoded = $this->encodeQ($str, $position);
$encoded = $this->wrapText($encoded, $maxLen, true); $encoded = $this->wrapText($encoded, $maxLen, true);
$encoded = \str_replace('=' . self::$LE, "\n", \trim($encoded)); $encoded = \str_replace('=' . self::$LE, "\n", \trim($encoded));
$encoded = \preg_replace('/^(.*)$/m', ' =?' . $charset . "?$encoding?\\1?=", $encoded); $encoded = \preg_replace('/^(.*)$/m', ' =?' . $charset . "?${encoding}?\\1?=", $encoded);
break; break;
default: default:
return $str; return $str;
@ -1710,7 +1709,7 @@ class Email implements MessageInterface
$end = '?='; $end = '?=';
$encoded = ''; $encoded = '';
$mbLength = \mb_strlen($str, $this->charset); $mbLength = \mb_strlen($str, $this->charset);
$length = 75 - \strlen($start) - \strlen($end); $length = 75 - \strlen($start) - \strlen($end);
$ratio = $mbLength / \strlen($str); $ratio = $mbLength / \strlen($str);
$avgLength = \floor($length * $ratio * .75); $avgLength = \floor($length * $ratio * .75);
@ -1721,8 +1720,8 @@ class Email implements MessageInterface
do { do {
$offset = $avgLength - $lookBack; $offset = $avgLength - $lookBack;
$chunk = \mb_substr($str, $i, $offset, $this->charset); $chunk = \mb_substr($str, $i, $offset, $this->charset);
$chunk = \base64_encode($chunk); $chunk = \base64_encode($chunk);
++$lookBack; ++$lookBack;
} while (\strlen($chunk) > $length); } while (\strlen($chunk) > $length);
@ -1732,7 +1731,6 @@ class Email implements MessageInterface
return \substr($encoded, 0, -\strlen($linebreak)); return \substr($encoded, 0, -\strlen($linebreak));
} }
/** /**
* Add an attachment from a path on the filesystem. * Add an attachment from a path on the filesystem.
* *
@ -2181,7 +2179,7 @@ class Email implements MessageInterface
*/ */
public function dkimSign(string $signHeader) : string public function dkimSign(string $signHeader) : string
{ {
if (!defined('PKCS7_TEXT')) { if (!\defined('PKCS7_TEXT')) {
return ''; return '';
} }
@ -2319,7 +2317,7 @@ class Email implements MessageInterface
foreach ($parsedHeaders as $header) { foreach ($parsedHeaders as $header) {
if (\in_array(\strtolower($header['label']), $autoSignHeaders, true)) { if (\in_array(\strtolower($header['label']), $autoSignHeaders, true)) {
$headersToSignKeys[] = $header['label']; $headersToSignKeys[] = $header['label'];
$headersToSign[] = $header['label'] . ': ' . $header['value']; $headersToSign[] = $header['label'] . ': ' . $header['value'];
if ($this->dkimCopyHeader) { if ($this->dkimCopyHeader) {
$copiedHeaders[] = $header['label'] . ':' $copiedHeaders[] = $header['label'] . ':'
@ -2333,7 +2331,7 @@ class Email implements MessageInterface
foreach ($this->customHeader as $customHeader) { foreach ($this->customHeader as $customHeader) {
if ($customHeader[0] === $header['label']) { if ($customHeader[0] === $header['label']) {
$headersToSignKeys[] = $header['label']; $headersToSignKeys[] = $header['label'];
$headersToSign[] = $header['label'] . ': ' . $header['value']; $headersToSign[] = $header['label'] . ': ' . $header['value'];
if ($this->dkimCopyHeader) { if ($this->dkimCopyHeader) {
$copiedHeaders[] = $header['label'] . ':' $copiedHeaders[] = $header['label'] . ':'

View File

@ -112,12 +112,12 @@ class Imap extends MailHandler implements MailBoxInterface
return \imap_num_recent($this->mailbox); return \imap_num_recent($this->mailbox);
} }
public function copyMail(string|array $messages, string $box) : bool public function copyMail(string | array $messages, string $box) : bool
{ {
return \imap_mail_copy($this->mailbox, !\is_string($messages) ? \implode(',', $messages) : $messages, $box); return \imap_mail_copy($this->mailbox, !\is_string($messages) ? \implode(',', $messages) : $messages, $box);
} }
public function moveMail(string|array $messages, string $box) : bool public function moveMail(string | array $messages, string $box) : bool
{ {
return \imap_mail_copy($this->mailbox, !\is_string($messages) ? \implode(',', $messages) : $messages, $box); return \imap_mail_copy($this->mailbox, !\is_string($messages) ? \implode(',', $messages) : $messages, $box);
} }

View File

@ -18,10 +18,10 @@ declare(strict_types=1);
namespace phpOMS\Message\Mail; namespace phpOMS\Message\Mail;
use phpOMS\Validation\Network\Email as EmailValidator;
use phpOMS\Utils\StringUtils;
use phpOMS\Validation\Network\Hostname;
use phpOMS\System\SystemUtils; use phpOMS\System\SystemUtils;
use phpOMS\Utils\StringUtils;
use phpOMS\Validation\Network\Email as EmailValidator;
use phpOMS\Validation\Network\Hostname;
/** /**
* Mail class. * Mail class.
@ -410,11 +410,11 @@ class MailHandler
/** /**
* Call mail() in a safe_mode-aware fashion. * Call mail() in a safe_mode-aware fashion.
* *
* @param string $to To * @param string $to To
* @param Email $mail Mail * @param Email $mail Mail
* @param string $body Message Body * @param string $body Message Body
* @param string $header Additional Header(s) * @param string $header Additional Header(s)
* @param null|string $params Params * @param null|string $params Params
* *
* @return bool * @return bool
* *
@ -502,7 +502,7 @@ class MailHandler
} }
$this->smtp->timeout = $this->timeout; $this->smtp->timeout = $this->timeout;
$this->smtp->doVerp = $this->useVerp; $this->smtp->doVerp = $this->useVerp;
$hosts = \explode(';', $this->host); $hosts = \explode(';', $this->host);
foreach ($hosts as $hostentry) { foreach ($hosts as $hostentry) {
@ -540,7 +540,7 @@ class MailHandler
} }
//Do we need the OpenSSL extension? //Do we need the OpenSSL extension?
$sslExt = defined('OPENSSL_ALGO_SHA256'); $sslExt = \defined('OPENSSL_ALGO_SHA256');
if (($secure === EncryptionType::TLS || $secure === EncryptionType::SMTPS) if (($secure === EncryptionType::TLS || $secure === EncryptionType::SMTPS)
&& !$sslExt && !$sslExt
) { ) {
@ -580,7 +580,7 @@ class MailHandler
} }
return !($this->useSMTPAuth return !($this->useSMTPAuth
&& !$this->smtp->authenticate($this->username, $this->password, $this->authType, $this->oauth ) && !$this->smtp->authenticate($this->username, $this->password, $this->authType, $this->oauth)
); );
} }
} }

View File

@ -120,12 +120,12 @@ class Pop3 extends MailHandler implements MailBoxInterface
return \imap_num_recent($this->mailbox); return \imap_num_recent($this->mailbox);
} }
public function copyMail(string|array $messages, string $box) : bool public function copyMail(string | array $messages, string $box) : bool
{ {
return \imap_mail_copy($this->mailbox, !\is_string($messages) ? \implode(',', $messages) : $messages, $box); return \imap_mail_copy($this->mailbox, !\is_string($messages) ? \implode(',', $messages) : $messages, $box);
} }
public function moveMail(string|array $messages, string $box) : bool public function moveMail(string | array $messages, string $box) : bool
{ {
return \imap_mail_copy($this->mailbox, !\is_string($messages) ? \implode(',', $messages) : $messages, $box); return \imap_mail_copy($this->mailbox, !\is_string($messages) ? \implode(',', $messages) : $messages, $box);
} }

View File

@ -210,7 +210,7 @@ class Smtp
} }
$crypto_method = \STREAM_CRYPTO_METHOD_TLS_CLIENT; $crypto_method = \STREAM_CRYPTO_METHOD_TLS_CLIENT;
if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) { if (\defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
$crypto_method |= \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; $crypto_method |= \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
$crypto_method |= \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; $crypto_method |= \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
} }
@ -342,13 +342,13 @@ class Smtp
// Creates an md5 HMAC. // Creates an md5 HMAC.
// by Lance Rushing // by Lance Rushing
$byteLen = 64; $byteLen = 64;
if (strlen($key) > $byteLen) { if (\strlen($key) > $byteLen) {
$key = \pack('H*', \md5($key)); $key = \pack('H*', \md5($key));
} }
$key = \str_pad($key, $byteLen, \chr(0x00)); $key = \str_pad($key, $byteLen, \chr(0x00));
$ipad = \str_pad('', $byteLen, \chr(0x36)); $ipad = \str_pad('', $byteLen, \chr(0x36));
$opad = \str_pad('', $byteLen, \chr(0x5c)); $opad = \str_pad('', $byteLen, \chr(0x5c));
$k_ipad = $key ^ $ipad; $k_ipad = $key ^ $ipad;
$k_opad = $key ^ $opad; $k_opad = $key ^ $opad;
@ -392,7 +392,7 @@ class Smtp
$this->heloRply = ''; $this->heloRply = '';
if (\is_resource($this->con)) { if (\is_resource($this->con)) {
fclose($this->con); \fclose($this->con);
$this->con = null; $this->con = null;
} }
} }
@ -526,7 +526,7 @@ class Smtp
protected function parseHelloFields(string $type) : void protected function parseHelloFields(string $type) : void
{ {
$this->serverCaps = []; $this->serverCaps = [];
$lines = \explode("\n", $this->heloRply); $lines = \explode("\n", $this->heloRply);
foreach ($lines as $n => $s) { foreach ($lines as $n => $s) {
//First 4 chars contain response code followed by - or space //First 4 chars contain response code followed by - or space
@ -538,7 +538,7 @@ class Smtp
$fields = \explode(' ', $s); $fields = \explode(' ', $s);
if (!empty($fields)) { if (!empty($fields)) {
if (!$n) { if (!$n) {
$name = $type; $name = $type;
$fields = $fields[0]; $fields = $fields[0];
} else { } else {
$name = \array_shift($fields); $name = \array_shift($fields);
@ -650,7 +650,7 @@ class Smtp
* *
* @since 1.0.0 * @since 1.0.0
*/ */
protected function sendCommand(string $command, string $commandstring, int|array $expect) : bool protected function sendCommand(string $command, string $commandstring, int | array $expect) : bool
{ {
if (!$this->isConnected()) { if (!$this->isConnected()) {
return false; return false;
@ -703,7 +703,7 @@ class Smtp
*/ */
public function sendAndMail(string $from) : bool public function sendAndMail(string $from) : bool
{ {
return $this->sendCommand('SAML', "SAML FROM:$from", 250); return $this->sendCommand('SAML', "SAML FROM:${from}", 250);
} }
/** /**
@ -717,7 +717,7 @@ class Smtp
*/ */
public function verify(string $name) : bool public function verify(string $name) : bool
{ {
return $this->sendCommand('VRFY', "VRFY $name", [250, 251]); return $this->sendCommand('VRFY', "VRFY ${name}", [250, 251]);
} }
/** /**
@ -877,7 +877,7 @@ class Smtp
$this->lastSmtpTransactionId = ''; $this->lastSmtpTransactionId = '';
} else { } else {
$this->lastSmtpTransactionId = ''; $this->lastSmtpTransactionId = '';
$patterns = SmtpTransactionPattern::getConstants(); $patterns = SmtpTransactionPattern::getConstants();
foreach ($patterns as $pattern) { foreach ($patterns as $pattern) {
$matches = []; $matches = [];

View File

@ -25,11 +25,11 @@ namespace phpOMS\Message;
interface MessageInterface interface MessageInterface
{ {
/** /**
* Gets the body of the message. * Gets the body of the message.
* *
* @return string * @return string
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getBody() : string; public function getBody() : string;
} }

View File

@ -46,14 +46,14 @@ final class SocketResponse extends ResponseAbstract implements RenderableInterfa
} }
/** /**
* Remove response by ID. * Remove response by ID.
* *
* @param mixed $id Response ID * @param mixed $id Response ID
* *
* @return bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function remove($id) : bool public function remove($id) : bool
{ {
if (isset($this->response[$id])) { if (isset($this->response[$id])) {
@ -66,8 +66,8 @@ final class SocketResponse extends ResponseAbstract implements RenderableInterfa
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getJsonData() : array public function getJsonData() : array
{ {
return \json_decode($this->getRaw(), true); return \json_decode($this->getRaw(), true);

View File

@ -320,7 +320,7 @@ abstract class ModuleAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
protected function updateModel(int $account, mixed $old, mixed $new, string|\Closure $mapper, string $trigger, string $ip) : void protected function updateModel(int $account, mixed $old, mixed $new, string | \Closure $mapper, string $trigger, string $ip) : void
{ {
$this->app->eventManager->triggerSimilar('PRE:Module:' . static::MODULE_NAME . '-' . $trigger . '-update', '', $old); $this->app->eventManager->triggerSimilar('PRE:Module:' . static::MODULE_NAME . '-' . $trigger . '-update', '', $old);
$id = 0; $id = 0;

View File

@ -710,7 +710,7 @@ final class ModuleManager
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function initModule(string|array $modules) : void public function initModule(string | array $modules) : void
{ {
$modules = (array) $modules; $modules = (array) $modules;
foreach ($modules as $module) { foreach ($modules as $module) {

View File

@ -14,15 +14,15 @@ declare(strict_types=1);
namespace phpOMS\Module; namespace phpOMS\Module;
use phpOMS\Application\ApplicationInfo;
use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\DataStorage\Database\Query\Builder;
use phpOMS\System\File\Local\Directory; use phpOMS\System\File\Local\Directory;
use phpOMS\System\File\Local\File; use phpOMS\System\File\Local\File;
use phpOMS\System\File\PathException; use phpOMS\System\File\PathException;
use phpOMS\System\File\PermissionException; use phpOMS\System\File\PermissionException;
use phpOMS\Utils\Parser\Php\ArrayParser;
use phpOMS\Application\ApplicationInfo;
use phpOMS\Utils\ArrayUtils; use phpOMS\Utils\ArrayUtils;
use phpOMS\Utils\Parser\Php\ArrayParser;
/** /**
* Status abstract class. * Status abstract class.

View File

@ -102,7 +102,7 @@ abstract class Enum
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function getName(string $value) : bool|int|string public static function getName(string $value) : bool | int | string
{ {
$arr = self::getConstants(); $arr = self::getConstants();

View File

@ -88,7 +88,7 @@ class Graph
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getNode(int|string $key) : ?Node public function getNode(int | string $key) : ?Node
{ {
return $this->nodes[$key] ?? null; return $this->nodes[$key] ?? null;
} }
@ -117,7 +117,7 @@ class Graph
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function hasNode(int|string $key) : bool public function hasNode(int | string $key) : bool
{ {
return isset($this->nodes[$key]); return isset($this->nodes[$key]);
} }
@ -167,7 +167,7 @@ class Graph
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getCost() : int|float public function getCost() : int | float
{ {
$edges = $this->getEdges(); $edges = $this->getEdges();
$costs = 0; $costs = 0;
@ -555,7 +555,7 @@ class Graph
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function longestPathBetweenNodes(int|string|Node $node1, int|string|Node $node2) : array public function longestPathBetweenNodes(int | string | Node $node1, int | string | Node $node2) : array
{ {
if (!($node1 instanceof Node)) { if (!($node1 instanceof Node)) {
$node1 = $this->getNode($node1); $node1 = $this->getNode($node1);

View File

@ -182,7 +182,7 @@ final class MultiMap implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function get(int|string|array $key) : mixed public function get(int | string | array $key) : mixed
{ {
if ($this->keyType === KeyType::MULTIPLE || \is_array($key)) { if ($this->keyType === KeyType::MULTIPLE || \is_array($key)) {
return $this->getMultiple($key); return $this->getMultiple($key);
@ -200,7 +200,7 @@ final class MultiMap implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function getSingle(int|string $key) : mixed private function getSingle(int | string $key) : mixed
{ {
return isset($this->keys[$key]) ? $this->values[$this->keys[$key]] ?? null : null; return isset($this->keys[$key]) ? $this->values[$this->keys[$key]] ?? null : null;
} }
@ -214,7 +214,7 @@ final class MultiMap implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function getMultiple(int|string|array $key) : mixed private function getMultiple(int | string | array $key) : mixed
{ {
if (\is_array($key)) { if (\is_array($key)) {
if ($this->orderType === OrderType::LOOSE) { if ($this->orderType === OrderType::LOOSE) {
@ -248,7 +248,7 @@ final class MultiMap implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function set(int|string|array $key, mixed $value) : bool public function set(int | string | array $key, mixed $value) : bool
{ {
if ($this->keyType === KeyType::MULTIPLE || \is_array($key)) { if ($this->keyType === KeyType::MULTIPLE || \is_array($key)) {
return $this->setMultiple($key, $value); return $this->setMultiple($key, $value);
@ -267,7 +267,7 @@ final class MultiMap implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function setMultiple(int|string|array $key, mixed $value) : bool private function setMultiple(int | string | array $key, mixed $value) : bool
{ {
$key = \is_array($key) ? $key : [$key]; $key = \is_array($key) ? $key : [$key];
@ -297,7 +297,7 @@ final class MultiMap implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function setSingle(int|string $key, mixed $value) : bool private function setSingle(int | string $key, mixed $value) : bool
{ {
if (isset($this->keys[$key])) { if (isset($this->keys[$key])) {
$this->values[$this->keys[$key]] = $value; $this->values[$this->keys[$key]] = $value;
@ -317,7 +317,7 @@ final class MultiMap implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function remove(int|string|array $key) : bool public function remove(int | string | array $key) : bool
{ {
if ($this->keyType === KeyType::MULTIPLE || \is_array($key)) { if ($this->keyType === KeyType::MULTIPLE || \is_array($key)) {
return $this->removeMultiple($key); return $this->removeMultiple($key);
@ -335,7 +335,7 @@ final class MultiMap implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function removeMultiple(int|string|array $key) : bool private function removeMultiple(int | string | array $key) : bool
{ {
$key = \is_array($key) ? $key : [$key]; $key = \is_array($key) ? $key : [$key];
@ -367,7 +367,7 @@ final class MultiMap implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function removeSingle(int|string $key) : bool private function removeSingle(int | string $key) : bool
{ {
if (isset($this->keys[$key])) { if (isset($this->keys[$key])) {
$id = $this->keys[$key]; $id = $this->keys[$key];
@ -394,7 +394,7 @@ final class MultiMap implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function remap(int|string $old, int|string $new) : bool public function remap(int | string $old, int | string $new) : bool
{ {
if ($this->keyType === KeyType::MULTIPLE) { if ($this->keyType === KeyType::MULTIPLE) {
return false; return false;
@ -422,7 +422,7 @@ final class MultiMap implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function removeKey(int|string $key) : bool public function removeKey(int | string $key) : bool
{ {
if ($this->keyType === KeyType::MULTIPLE) { if ($this->keyType === KeyType::MULTIPLE) {
return false; return false;
@ -442,7 +442,7 @@ final class MultiMap implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function removeKeySingle(int|string $key) : bool private function removeKeySingle(int | string $key) : bool
{ {
if (isset($this->keys[$key])) { if (isset($this->keys[$key])) {
unset($this->keys[$key]); unset($this->keys[$key]);
@ -464,7 +464,7 @@ final class MultiMap implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getSiblings(int|string|array $key) : array public function getSiblings(int | string | array $key) : array
{ {
if ($this->keyType === KeyType::MULTIPLE || \is_array($key)) { if ($this->keyType === KeyType::MULTIPLE || \is_array($key)) {
return $this->getSiblingsMultiple($key); return $this->getSiblingsMultiple($key);
@ -482,7 +482,7 @@ final class MultiMap implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getSiblingsMultiple(int|string|array $key) : array public function getSiblingsMultiple(int | string | array $key) : array
{ {
if ($this->orderType === OrderType::LOOSE) { if ($this->orderType === OrderType::LOOSE) {
$key = \is_array($key) ? $key : [$key]; $key = \is_array($key) ? $key : [$key];
@ -502,7 +502,7 @@ final class MultiMap implements \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function getSiblingsSingle(int|string $key) : array private function getSiblingsSingle(int | string $key) : array
{ {
$siblings = []; $siblings = [];
if (!isset($this->keys[$key])) { if (!isset($this->keys[$key])) {

View File

@ -202,7 +202,7 @@ final class FileUtils
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function mb_pathinfo(string $path, int|string $options = null) : string|array public static function mb_pathinfo(string $path, int | string $options = null) : string | array
{ {
$ret = ['dirname' => '', 'basename' => '', 'extension' => '', 'filename' => '']; $ret = ['dirname' => '', 'basename' => '', 'extension' => '', 'filename' => ''];
$pathinfo = []; $pathinfo = [];

View File

@ -694,7 +694,7 @@ class Directory extends FileAbstract implements DirectoryInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function next() public function next() : void
{ {
$next = \next($this->nodes); $next = \next($this->nodes);
if ($next instanceof self) { if ($next instanceof self) {

View File

@ -517,7 +517,7 @@ final class Directory extends FileAbstract implements DirectoryInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function next() public function next() : void
{ {
$next = \next($this->nodes); $next = \next($this->nodes);
if ($next instanceof self) { if ($next instanceof self) {

View File

@ -138,7 +138,7 @@ final class SystemUtils
{ {
if (isset($_SERVER['SERVER_NAME'])) { if (isset($_SERVER['SERVER_NAME'])) {
return $_SERVER['SERVER_NAME']; return $_SERVER['SERVER_NAME'];
} elseif (($result = gethostname()) !== false) { } elseif (($result = \gethostname()) !== false) {
return $result; return $result;
} elseif (\php_uname('n') !== false) { } elseif (\php_uname('n') !== false) {
return \php_uname('n'); return \php_uname('n');

View File

@ -334,7 +334,7 @@ final class ArrayUtils
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function arraySum(array $array, int $start = 0, int $count = 0) : int|float public static function arraySum(array $array, int $start = 0, int $count = 0) : int | float
{ {
$count = $count === 0 ? \count($array) : $start + $count; $count = $count === 0 ? \count($array) : $start + $count;
$sum = 0; $sum = 0;
@ -391,7 +391,7 @@ final class ArrayUtils
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function power(array $values, int|float $exp = 2) : array public static function power(array $values, int | float $exp = 2) : array
{ {
$squared = []; $squared = [];

View File

@ -292,7 +292,7 @@ class Repository
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function add(string|array $files = '*') : string public function add(string | array $files = '*') : string
{ {
$files = $this->parseFileList($files); $files = $this->parseFileList($files);
@ -309,7 +309,7 @@ class Repository
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function rm(string|array $files = '*', bool $cached = false) : string public function rm(string | array $files = '*', bool $cached = false) : string
{ {
$files = $this->parseFileList($files); $files = $this->parseFileList($files);
@ -327,7 +327,7 @@ class Repository
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function parseFileList(string|array $files) : string private function parseFileList(string | array $files) : string
{ {
if (\is_array($files)) { if (\is_array($files)) {
return '"' . \implode('" "', $files) . '"'; return '"' . \implode('" "', $files) . '"';

View File

@ -35,7 +35,7 @@ interface ArchiveInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function pack(string|array $sources, string $destination, bool $overwrite = false) : bool; public static function pack(string | array $sources, string $destination, bool $overwrite = false) : bool;
/** /**
* Unpack archive. * Unpack archive.

View File

@ -29,7 +29,7 @@ class Gz implements ArchiveInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function pack(string|array $source, string $destination, bool $overwrite = false) : bool public static function pack(string | array $source, string $destination, bool $overwrite = false) : bool
{ {
$destination = \str_replace('\\', '/', $destination); $destination = \str_replace('\\', '/', $destination);
if ($destination === false if ($destination === false

View File

@ -31,7 +31,7 @@ class Tar implements ArchiveInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function pack(string|array $sources, string $destination, bool $overwrite = false) : bool public static function pack(string | array $sources, string $destination, bool $overwrite = false) : bool
{ {
$destination = FileUtils::absolute(\str_replace('\\', '/', $destination)); $destination = FileUtils::absolute(\str_replace('\\', '/', $destination));
if (!$overwrite && \is_file($destination)) { if (!$overwrite && \is_file($destination)) {

View File

@ -31,7 +31,7 @@ class TarGz implements ArchiveInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function pack(string|array $source, string $destination, bool $overwrite = false) : bool public static function pack(string | array $source, string $destination, bool $overwrite = false) : bool
{ {
$destination = \str_replace('\\', '/', $destination); $destination = \str_replace('\\', '/', $destination);
if (!$overwrite && \is_file($destination)) { if (!$overwrite && \is_file($destination)) {

View File

@ -31,7 +31,7 @@ class Zip implements ArchiveInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function pack(string|array $sources, string $destination, bool $overwrite = false) : bool public static function pack(string | array $sources, string $destination, bool $overwrite = false) : bool
{ {
$destination = FileUtils::absolute(\str_replace('\\', '/', $destination)); $destination = FileUtils::absolute(\str_replace('\\', '/', $destination));
if (!$overwrite && \is_file($destination) if (!$overwrite && \is_file($destination)

View File

@ -80,7 +80,7 @@ final class MbStringUtils
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function mb_startsWith(string $haystack, string|array $needles) : bool public static function mb_startsWith(string $haystack, string | array $needles) : bool
{ {
if (\is_string($needles)) { if (\is_string($needles)) {
$needles = [$needles]; $needles = [$needles];
@ -112,7 +112,7 @@ final class MbStringUtils
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function mb_endsWith(string $haystack, string|array $needles) : bool public static function mb_endsWith(string $haystack, string | array $needles) : bool
{ {
if (\is_string($needles)) { if (\is_string($needles)) {
$needles = [$needles]; $needles = [$needles];

View File

@ -109,7 +109,7 @@ final class Permutation
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function permutate(string|array $toPermute, array $key) : string|array public static function permutate(string | array $toPermute, array $key) : string | array
{ {
$length = \is_array($toPermute) ? \count($toPermute) : \strlen($toPermute); $length = \is_array($toPermute) ? \count($toPermute) : \strlen($toPermute);

View File

@ -82,7 +82,7 @@ final class StringUtils
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function endsWith(string $haystack, string|array $needles) : bool public static function endsWith(string $haystack, string | array $needles) : bool
{ {
if (\is_string($needles)) { if (\is_string($needles)) {
$needles = [$needles]; $needles = [$needles];
@ -114,7 +114,7 @@ final class StringUtils
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function startsWith(string $haystack, string|array $needles) : bool public static function startsWith(string $haystack, string | array $needles) : bool
{ {
if (\is_string($needles)) { if (\is_string($needles)) {
$needles = [$needles]; $needles = [$needles];
@ -412,7 +412,7 @@ final class StringUtils
public static function isShellSafe(string $string) public static function isShellSafe(string $string)
{ {
if (\escapeshellcmd($string) !== $string if (\escapeshellcmd($string) !== $string
|| !\in_array(\escapeshellarg($string), ["'$string'", "\"$string\""]) || !\in_array(\escapeshellarg($string), ["'${string}'", "\"${string}\""])
) { ) {
return false; return false;
} }

View File

@ -72,7 +72,7 @@ final class Validator extends ValidatorAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function isType(mixed $var, string|array $constraint) : bool public static function isType(mixed $var, string | array $constraint) : bool
{ {
if (!\is_array($constraint)) { if (!\is_array($constraint)) {
$constraint = [$constraint]; $constraint = [$constraint];
@ -119,7 +119,7 @@ final class Validator extends ValidatorAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function contains(string $var, string|array $substr) : bool public static function contains(string $var, string | array $substr) : bool
{ {
return \is_string($substr) ? \strpos($var, $substr) !== false : StringUtils::contains($var, $substr); return \is_string($substr) ? \strpos($var, $substr) !== false : StringUtils::contains($var, $substr);
} }
@ -150,7 +150,7 @@ final class Validator extends ValidatorAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function hasLimit(int|float $var, int|float $min = 0, int|float $max = \PHP_INT_MAX) : bool public static function hasLimit(int | float $var, int | float $min = 0, int | float $max = \PHP_INT_MAX) : bool
{ {
if ($var <= $max && $var >= $min) { if ($var <= $max && $var >= $min) {
return true; return true;

View File

@ -304,7 +304,7 @@ class View extends ViewAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getNumeric(int|float $numeric, string $format = null) : string public function getNumeric(int | float $numeric, string $format = null) : string
{ {
return $this->l11nManager->getNumeric($this->l11n, $numeric, $format); return $this->l11nManager->getNumeric($this->l11n, $numeric, $format);
} }
@ -336,7 +336,7 @@ class View extends ViewAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getCurrency(int|float $currency, string $format = null, string $symbol = null, int $divide = 1) : string public function getCurrency(int | float $currency, string $format = null, string $symbol = null, int $divide = 1) : string
{ {
return $this->l11nManager->getCurrency($this->l11n, $currency, $format, $symbol, $divide); return $this->l11nManager->getCurrency($this->l11n, $currency, $format, $symbol, $divide);
} }

View File

@ -127,7 +127,7 @@ abstract class ViewAbstract implements RenderableInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getView(string $id) : bool|self public function getView(string $id) : bool | self
{ {
if (!isset($this->views[$id])) { if (!isset($this->views[$id])) {
return false; return false;

View File

@ -21,9 +21,11 @@ require_once __DIR__ . '/../../Autoloader.php';
class NumericElement implements SortableInterface class NumericElement implements SortableInterface
{ {
public int|float $value = 0; public int |
public function __construct(int|float $value) float $value = 0;
public function __construct(int | float $value)
{ {
$this->value = $value; $this->value = $value;
} }
@ -38,12 +40,12 @@ class NumericElement implements SortableInterface
return $this->value === $obj->getValue(); return $this->value === $obj->getValue();
} }
public function getValue() : int|float public function getValue() : int | float
{ {
return $this->value; return $this->value;
} }
public static function max(array $list) : int|float public static function max(array $list) : int | float
{ {
$values = []; $values = [];
foreach ($list as $element) { foreach ($list as $element) {
@ -53,7 +55,7 @@ class NumericElement implements SortableInterface
return \max($values); return \max($values);
} }
public static function min(array $list) : int|float public static function min(array $list) : int | float
{ {
$values = []; $values = [];
foreach ($list as $element) { foreach ($list as $element) {

View File

@ -44,12 +44,12 @@ class ApplicationManagerTest extends \PHPUnit\Framework\TestCase
$app->dbPool = $GLOBALS['dbpool']; $app->dbPool = $GLOBALS['dbpool'];
$app->router = new WebRouter(); $app->router = new WebRouter();
$app->dispatcher = new Dispatcher($app); $app->dispatcher = new Dispatcher($app);
$app->appSettings = new class implements SettingsInterface { $app->appSettings = new class() implements SettingsInterface {
use OptionsTrait; use OptionsTrait;
public function get( public function get(
mixed $ids = null, mixed $ids = null,
string|array $names = null, string | array $names = null,
string $module = null, string $module = null,
int $group = null, int $group = null,
int $account = null int $account = null

View File

@ -14,8 +14,8 @@ declare(strict_types=1);
namespace phpOMS\tests\DataStorage\Cache\Connection; namespace phpOMS\tests\DataStorage\Cache\Connection;
use phpOMS\DataStorage\Cache\CacheType;
use phpOMS\DataStorage\Cache\CacheStatus; use phpOMS\DataStorage\Cache\CacheStatus;
use phpOMS\DataStorage\Cache\CacheType;
use phpOMS\DataStorage\Cache\Connection\NullCache; use phpOMS\DataStorage\Cache\Connection\NullCache;
/** /**

View File

@ -19,9 +19,9 @@ use phpOMS\Dispatcher\Dispatcher;
use phpOMS\Localization\Localization; use phpOMS\Localization\Localization;
use phpOMS\Message\Http\HttpRequest; use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse; use phpOMS\Message\Http\HttpResponse;
use phpOMS\Module\ModuleAbstract;
use phpOMS\Router\WebRouter; use phpOMS\Router\WebRouter;
use phpOMS\Uri\HttpUri; use phpOMS\Uri\HttpUri;
use phpOMS\Module\ModuleAbstract;
require_once __DIR__ . '/../Autoloader.php'; require_once __DIR__ . '/../Autoloader.php';
@ -36,7 +36,7 @@ class DispatcherTest extends \PHPUnit\Framework\TestCase
protected function setUp() : void protected function setUp() : void
{ {
$this->app = new class() extends ApplicationAbstract { $this->app = new class() extends ApplicationAbstract {
protected string $appName = 'Api'; protected string $appName = 'Api';
}; };
@ -56,7 +56,11 @@ class DispatcherTest extends \PHPUnit\Framework\TestCase
public function testControllerInputOutput() : void public function testControllerInputOutput() : void
{ {
$this->app->dispatcher->set(new class extends ModuleAbstract { public string $name = 'test'; public function testFunction() { return $this->name; } }, 'test'); $this->app->dispatcher->set(new class() extends ModuleAbstract {
public string $name = 'test';
public function testFunction() { return $this->name; }
}, 'test');
$localization = new Localization(); $localization = new Localization();

View File

@ -28,7 +28,7 @@ class EmailTestTest extends \PHPUnit\Framework\TestCase
{ {
protected Email $mail; protected Email $mail;
public function setUp() : void protected function setUp() : void
{ {
$this->mail = new Email(); $this->mail = new Email();
} }
@ -58,9 +58,9 @@ class EmailTestTest extends \PHPUnit\Framework\TestCase
public function testHtml() : void public function testHtml() : void
{ {
$message = \file_get_contents(__DIR__ . '/files/utf8.html'); $message = \file_get_contents(__DIR__ . '/files/utf8.html');
$this->mail->charset = CharsetType::UTF_8; $this->mail->charset = CharsetType::UTF_8;
$this->mail->body = ''; $this->mail->body = '';
$this->mail->bodyAlt = ''; $this->mail->bodyAlt = '';
$this->mail->msgHTML($message, __DIR__ . '/files'); $this->mail->msgHTML($message, __DIR__ . '/files');

View File

@ -16,10 +16,10 @@ namespace phpOMS\tests\Message;
require_once __DIR__ . '/../../Autoloader.php'; require_once __DIR__ . '/../../Autoloader.php';
use phpOMS\Message\Mail\MailHandler;
use phpOMS\Message\Mail\SubmitType;
use phpOMS\Message\Mail\Email; use phpOMS\Message\Mail\Email;
use phpOMS\Message\Mail\Imap; use phpOMS\Message\Mail\Imap;
use phpOMS\Message\Mail\MailHandler;
use phpOMS\Message\Mail\SubmitType;
use phpOMS\System\CharsetType; use phpOMS\System\CharsetType;
/** /**
@ -31,7 +31,7 @@ class MailHandlerTest extends \PHPUnit\Framework\TestCase
{ {
protected MailHandler $handler; protected MailHandler $handler;
public function setUp() : void protected function setUp() : void
{ {
$this->handler = new MailHandler(); $this->handler = new MailHandler();
} }
@ -93,9 +93,9 @@ class MailHandlerTest extends \PHPUnit\Framework\TestCase
$mail->addBCC('test3@orange-management.email', 'Dennis Eichhorn'); $mail->addBCC('test3@orange-management.email', 'Dennis Eichhorn');
$mail->addReplyTo('test4@orange-management.email', 'Dennis Eichhorn'); $mail->addReplyTo('test4@orange-management.email', 'Dennis Eichhorn');
$mail->subject = 'testSendHtmlWithMail'; $mail->subject = 'testSendHtmlWithMail';
$message = \file_get_contents(__DIR__ . '/files/utf8.html'); $message = \file_get_contents(__DIR__ . '/files/utf8.html');
$mail->charset = CharsetType::UTF_8; $mail->charset = CharsetType::UTF_8;
$mail->body = ''; $mail->body = '';
$mail->bodyAlt = ''; $mail->bodyAlt = '';
$mail->msgHTML($message, __DIR__ . '/files'); $mail->msgHTML($message, __DIR__ . '/files');
@ -119,9 +119,9 @@ class MailHandlerTest extends \PHPUnit\Framework\TestCase
$mail->addBCC('test3@orange-management.email', 'Dennis Eichhorn'); $mail->addBCC('test3@orange-management.email', 'Dennis Eichhorn');
$mail->addReplyTo('test4@orange-management.email', 'Dennis Eichhorn'); $mail->addReplyTo('test4@orange-management.email', 'Dennis Eichhorn');
$mail->subject = 'testSendHtmlWithSendmail'; $mail->subject = 'testSendHtmlWithSendmail';
$message = \file_get_contents(__DIR__ . '/files/utf8.html'); $message = \file_get_contents(__DIR__ . '/files/utf8.html');
$mail->charset = CharsetType::UTF_8; $mail->charset = CharsetType::UTF_8;
$mail->body = ''; $mail->body = '';
$mail->bodyAlt = ''; $mail->bodyAlt = '';
$mail->msgHTML($message, __DIR__ . '/files'); $mail->msgHTML($message, __DIR__ . '/files');