diff --git a/Account/Account.php b/Account/Account.php index 1c81af972..01cd4f65d 100644 --- a/Account/Account.php +++ b/Account/Account.php @@ -306,19 +306,19 @@ class Account implements ArrayableInterface, \JsonSerializable * * Checks if the account has a permission defined * - * @param int $permission Permission to check - * @param int $unit Unit Unit to check (null if all are acceptable) - * @param string $app App App to check (null if all are acceptable) - * @param string $module Module Module to check (null if all are acceptable) - * @param int $type Type (e.g. customer) (null if all are acceptable) - * @param int $element (e.g. customer id) (null if all are acceptable) - * @param int $component (e.g. address) (null if all are acceptable) + * @param int $permission Permission to check + * @param int|null $unit Unit Unit to check (null if all are acceptable) + * @param string|null $app App App to check (null if all are acceptable) + * @param string|null $module Module Module to check (null if all are acceptable) + * @param int|null $type Type (e.g. customer) (null if all are acceptable) + * @param int|null $element (e.g. customer id) (null if all are acceptable) + * @param int|null $component (e.g. address) (null if all are acceptable) * * @return bool Returns true if the account has the permission, false otherwise * * @since 1.0.0 */ - public function hasPermission(int $permission, int $unit = null, string $app = null, string $module = null, int $type = null, $element = null, $component = null) : bool + public function hasPermission(int $permission, ?int $unit = null, ?string $app = null, ?string $module = null, ?int $type = null, ?int $element = null, ?int $component = null) : bool { $app = $app !== null ? strtolower($app) : $app; diff --git a/Account/Group.php b/Account/Group.php index e92e89216..56a67d8e4 100644 --- a/Account/Group.php +++ b/Account/Group.php @@ -15,6 +15,7 @@ declare(strict_types=1); namespace phpOMS\Account; use phpOMS\Contract\ArrayableInterface; +use phpOMS\Stdlib\Base\Exception\InvalidEnumValue; /** * Account group class. @@ -54,7 +55,7 @@ class Group implements ArrayableInterface, \JsonSerializable /** * Account name. * - * @var int + * @var array * @since 1.0.0 */ protected $members = []; diff --git a/Account/PermissionAbstract.php b/Account/PermissionAbstract.php index 5a750b194..8caa71cd1 100644 --- a/Account/PermissionAbstract.php +++ b/Account/PermissionAbstract.php @@ -38,7 +38,7 @@ class PermissionAbstract /** * Unit id. * - * @var int + * @var int|null * @since 1.0.0 */ protected $unit = null; @@ -46,7 +46,7 @@ class PermissionAbstract /** * App name. * - * @var string + * @var string|null * @since 1.0.0 */ protected $app = null; @@ -54,7 +54,7 @@ class PermissionAbstract /** * Module id. * - * @var int + * @var int|null * @since 1.0.0 */ protected $module = null; @@ -62,7 +62,7 @@ class PermissionAbstract /** * Providing module id. * - * @var int + * @var int|null * @since 1.0.0 */ protected $from = 0; @@ -70,7 +70,7 @@ class PermissionAbstract /** * Type. * - * @var int + * @var int|null * @since 1.0.0 */ protected $type = null; @@ -78,7 +78,7 @@ class PermissionAbstract /** * Element id. * - * @var int + * @var int|null * @since 1.0.0 */ protected $element = null; @@ -86,7 +86,7 @@ class PermissionAbstract /** * Component id. * - * @var int + * @var int|null * @since 1.0.0 */ protected $component = null; @@ -114,7 +114,7 @@ class PermissionAbstract /** * Get unit id. * - * @return int + * @return int|null * * @since 1.0.0 */ @@ -126,7 +126,7 @@ class PermissionAbstract /** * Set unit id. * - * @param int $unit Unit + * @param int|null $unit Unit * * @return void * @@ -140,7 +140,7 @@ class PermissionAbstract /** * Get app name. * - * @return string + * @return string|null * * @since 1.0.0 */ @@ -166,7 +166,7 @@ class PermissionAbstract /** * Get module id. * - * @return int + * @return int|null * * @since 1.0.0 */ @@ -192,7 +192,7 @@ class PermissionAbstract /** * Get providing module id. * - * @return int + * @return int|null * * @since 1.0.0 */ @@ -218,7 +218,7 @@ class PermissionAbstract /** * Get type. * - * @return int + * @return int|null * * @since 1.0.0 */ @@ -244,7 +244,7 @@ class PermissionAbstract /** * Get element id. * - * @return int + * @return int|null * * @since 1.0.0 */ @@ -270,7 +270,7 @@ class PermissionAbstract /** * Get component id. * - * @return int + * @return int|null * * @since 1.0.0 */ diff --git a/DataStorage/Cache/Connection/MemCached.php b/DataStorage/Cache/Connection/MemCached.php index 403870bb9..b34bb5135 100644 --- a/DataStorage/Cache/Connection/MemCached.php +++ b/DataStorage/Cache/Connection/MemCached.php @@ -40,7 +40,6 @@ class MemCached extends ConnectionAbstract * @since 1.0.0 */ private $threshold = 10; - private $status; /** * Constructor. @@ -52,6 +51,14 @@ class MemCached extends ConnectionAbstract $this->memc = null; } + /** + * {@inheritdoc} + */ + public function connect(array $data) /* : void */ + { + $this->status = CacheStatus::ACTIVE; + } + /** * Adding server to server pool. * diff --git a/DataStorage/Cache/Connection/RedisCache.php b/DataStorage/Cache/Connection/RedisCache.php index 75c119fdf..c69837876 100644 --- a/DataStorage/Cache/Connection/RedisCache.php +++ b/DataStorage/Cache/Connection/RedisCache.php @@ -27,6 +27,14 @@ namespace phpOMS\DataStorage\Cache\Connection; class RedisCache extends ConnectionAbstract { + /** + * {@inheritdoc} + */ + public function connect(array $data) /* : void */ + { + $this->status = CacheStatus::ACTIVE; + } + /** * {@inheritdoc} */ diff --git a/DataStorage/Cache/Connection/WinCache.php b/DataStorage/Cache/Connection/WinCache.php index 776838507..ae080cc32 100644 --- a/DataStorage/Cache/Connection/WinCache.php +++ b/DataStorage/Cache/Connection/WinCache.php @@ -26,6 +26,13 @@ namespace phpOMS\DataStorage\Cache\Connection; */ class WinCache extends ConnectionAbstract { + /** + * {@inheritdoc} + */ + public function connect(array $data) /* : void */ + { + $this->status = CacheStatus::ACTIVE; + } /** * {@inheritdoc}