aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Access
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Access')
-rw-r--r--Zotlabs/Access/AccessList.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/Zotlabs/Access/AccessList.php b/Zotlabs/Access/AccessList.php
index a7da1274f..3f5271e87 100644
--- a/Zotlabs/Access/AccessList.php
+++ b/Zotlabs/Access/AccessList.php
@@ -18,28 +18,28 @@ class AccessList {
* @brief Allow contacts
* @var string
*/
- private $allow_cid;
+ private ?string $allow_cid;
/**
* @brief Allow groups
* @var string
*/
- private $allow_gid;
+ private ?string $allow_gid;
/**
* @brief Deny contacts
* @var string
*/
- private $deny_cid;
+ private ?string $deny_cid;
/**
* @brief Deny groups
* @var string
*/
- private $deny_gid;
+ private ?string $deny_gid;
/**
* @brief Indicates if we are using the default constructor values or
* values that have been set explicitly.
* @var boolean
*/
- private $explicit;
+ private bool $explicit;
/**
* @brief Keys required by the constructor if the channel array is given.
@@ -91,7 +91,7 @@ class AccessList {
$this->explicit = false;
}
- private function validate_input_array(array $arr, array $required_keys) {
+ private function validate_input_array(array $arr, array $required_keys) : void {
$missing_keys = array_diff($required_keys, array_keys($arr));
if (!empty($missing_keys)) {
@@ -108,7 +108,7 @@ class AccessList {
*
* @return boolean
*/
- function get_explicit() {
+ function get_explicit() : bool {
return $this->explicit;
}
@@ -126,7 +126,7 @@ class AccessList {
* * \e string \b deny_gid => string of denied gids
* @param boolean $explicit (optional) default true
*/
- function set(array $arr, bool $explicit = true) {
+ function set(array $arr, bool $explicit = true) : void {
$this->validate_input_array($arr, self::REQUIRED_KEYS_SET);
$this->allow_cid = $arr['allow_cid'];
@@ -146,7 +146,7 @@ class AccessList {
* * \e string \b deny_cid => string of denied cids
* * \e string \b deny_gid => string of denied gids
*/
- function get() {
+ function get() : array {
return [
'allow_cid' => $this->allow_cid,
'allow_gid' => $this->allow_gid,
@@ -172,7 +172,7 @@ class AccessList {
* * \e array|string \b group_deny => array with gids or comma-seperated string
* @param boolean $explicit (optional) default true
*/
- function set_from_array(array $arr, bool $explicit = true) {
+ function set_from_array(array $arr, bool $explicit = true) : void {
$arr['contact_allow'] = $arr['contact_allow'] ?? [];
$arr['group_allow'] = $arr['group_allow'] ?? [];
$arr['contact_deny'] = $arr['contact_deny'] ?? [];
@@ -195,7 +195,7 @@ class AccessList {
*
* @return boolean Return true if any of allow_* deny_* values is set.
*/
- function is_private() {
+ function is_private() : bool {
return (($this->allow_cid || $this->allow_gid || $this->deny_cid || $this->deny_gid) ? true : false);
}