@@ -56,7 +56,7 @@ |
||
56 | 56 | * |
57 | 57 | * Any error will trigger midcom_error. |
58 | 58 | */ |
59 | - public function __construct(string|int|midgard_group $id) |
|
59 | + public function __construct(string | int | midgard_group $id) |
|
60 | 60 | { |
61 | 61 | if (is_object($id)) { |
62 | 62 | $this->_storage = $id; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * The Default constructor creates an empty privilege, if you specify |
76 | 76 | * another privilege object in the constructor, a copy is constructed. |
77 | 77 | */ |
78 | - public function __construct(midcom_core_privilege_db|array|string $src = null) |
|
78 | + public function __construct(midcom_core_privilege_db | array | string $src = null) |
|
79 | 79 | { |
80 | 80 | if (is_array($src)) { |
81 | 81 | // Store given values to our privilege array |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * - Any midcom_core_user or midcom_core_group object or subtype thereof. |
211 | 211 | * - Any string identifier which can be resolved using midcom_services_auth::get_assignee(). |
212 | 212 | */ |
213 | - public function set_assignee(midcom_core_group|midcom_core_user|string $assignee) : bool |
|
213 | + public function set_assignee(midcom_core_group | midcom_core_user | string $assignee) : bool |
|
214 | 214 | { |
215 | 215 | if (is_string($assignee)) { |
216 | 216 | if ($this->is_magic_assignee($assignee)) { |
@@ -266,12 +266,12 @@ discard block |
||
266 | 266 | } |
267 | 267 | } |
268 | 268 | |
269 | - if ( !$this->is_magic_assignee() |
|
269 | + if (!$this->is_magic_assignee() |
|
270 | 270 | && !$this->get_assignee()) { |
271 | 271 | debug_add("The assignee identifier '{$this->assignee}' is invalid.", MIDCOM_LOG_INFO); |
272 | 272 | return false; |
273 | 273 | } |
274 | - if ( $this->assignee == 'OWNER' |
|
274 | + if ($this->assignee == 'OWNER' |
|
275 | 275 | && $this->privilegename == 'midgard:owner') { |
276 | 276 | debug_add("Tried to assign midgard:owner to the OWNER magic assignee, this is invalid.", MIDCOM_LOG_INFO); |
277 | 277 | return false; |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | MIDCOM_LOG_INFO); |
284 | 284 | return false; |
285 | 285 | } |
286 | - if ( !$object->can_do('midgard:update') |
|
286 | + if (!$object->can_do('midgard:update') |
|
287 | 287 | || !$object->can_do('midgard:privileges')) { |
288 | 288 | debug_add("Insufficient privileges on the content object with the GUID '{$this->__guid}', midgard:update and midgard:privileges required.", |
289 | 289 | MIDCOM_LOG_INFO); |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | return new midcom_core_privilege($result[0]); |
445 | 445 | } |
446 | 446 | |
447 | - private function _load(midcom_core_privilege_db|string $src = null) |
|
447 | + private function _load(midcom_core_privilege_db | string $src = null) |
|
448 | 448 | { |
449 | 449 | if ($src instanceof midcom_core_privilege_db) { |
450 | 450 | // Got a privilege object as argument, use that |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function set_privilege($privilege, $assignee = null, int $value = MIDCOM_PRIVILEGE_ALLOW, string $classname = '') : bool |
68 | 68 | { |
69 | - if ( !$this->can_do('midgard:update') |
|
69 | + if (!$this->can_do('midgard:update') |
|
70 | 70 | || !$this->can_do('midgard:privileges')) { |
71 | 71 | debug_add("Failed to set a privilege, midgard:update or midgard:privileges on " . static::class . " {$this->guid} not granted for the current user.", |
72 | 72 | MIDCOM_LOG_ERROR); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function unset_privilege($privilege, $assignee = null, string $classname = '') : bool |
98 | 98 | { |
99 | - if ( !$this->can_do('midgard:update') |
|
99 | + if (!$this->can_do('midgard:update') |
|
100 | 100 | || !$this->can_do('midgard:privileges')) { |
101 | 101 | debug_add("Failed to unset a privilege, midgard:update or midgard:privileges on " . static::class . " {$this->guid} not granted for the current user.", |
102 | 102 | MIDCOM_LOG_ERROR); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * midcom_core_group object or subtype thereof. |
126 | 126 | * @param string $classname An optional class name to which a SELF privilege is restricted to. |
127 | 127 | */ |
128 | - public function get_privilege(string $privilege, midcom_core_user|midcom_core_group|string $assignee, string $classname = '') |
|
128 | + public function get_privilege(string $privilege, midcom_core_user | midcom_core_group | string $assignee, string $classname = '') |
|
129 | 129 | { |
130 | 130 | if (!$this->can_do('midgard:privileges')) { |
131 | 131 | debug_add("Failed to get a privilege, midgard:update or midgard:privileges on " . static::class . " {$this->guid} not granted for the current user.", |