@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | $this->language = $language; |
24 | 24 | } |
25 | 25 | |
26 | - public function number(int|float $value, int $precision = 2) |
|
26 | + public function number(int | float $value, int $precision = 2) |
|
27 | 27 | { |
28 | 28 | // The fallback implementation in Intl only supports DECIMAL, so we hardcode the style here.. |
29 | 29 | $formatter = new NumberFormatter($this->get_locale(), NumberFormatter::DECIMAL); |
@@ -31,24 +31,24 @@ discard block |
||
31 | 31 | return $formatter->format($value); |
32 | 32 | } |
33 | 33 | |
34 | - public function date(int|string|null|DateTimeInterface $value = null, int|string $dateformat = 'medium') |
|
34 | + public function date(int | string | null | DateTimeInterface $value = null, int | string $dateformat = 'medium') |
|
35 | 35 | { |
36 | 36 | return $this->datetime($value, $dateformat, IntlDateFormatter::NONE); |
37 | 37 | } |
38 | 38 | |
39 | - public function time(int|string|null|DateTimeInterface $value = null, int|string $timeformat = 'short') |
|
39 | + public function time(int | string | null | DateTimeInterface $value = null, int | string $timeformat = 'short') |
|
40 | 40 | { |
41 | 41 | return $this->datetime($value, IntlDateFormatter::NONE, $timeformat); |
42 | 42 | } |
43 | 43 | |
44 | - public function datetime(int|string|null|DateTimeInterface $value = null, int|string $dateformat = 'medium', int|string $timeformat = 'short') |
|
44 | + public function datetime(int | string | null | DateTimeInterface $value = null, int | string $dateformat = 'medium', int | string $timeformat = 'short') |
|
45 | 45 | { |
46 | 46 | $value ??= time(); |
47 | 47 | $formatter = new IntlDateFormatter($this->get_locale(), $this->constant($dateformat), $this->constant($timeformat)); |
48 | 48 | return $formatter->format($value); |
49 | 49 | } |
50 | 50 | |
51 | - public function customdate(int|string|DateTimeInterface $value, string $pattern) |
|
51 | + public function customdate(int | string | DateTimeInterface $value, string $pattern) |
|
52 | 52 | { |
53 | 53 | $formatter = new IntlDateFormatter($this->get_locale(), IntlDateFormatter::FULL, IntlDateFormatter::FULL); |
54 | 54 | $formatter->setPattern($pattern); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | return $ranger->format($start, $end); |
71 | 71 | } |
72 | 72 | |
73 | - private function constant(int|string $input) : int |
|
73 | + private function constant(int | string $input) : int |
|
74 | 74 | { |
75 | 75 | if (is_int($input)) { |
76 | 76 | return $input; |
@@ -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|null $src = null) |
|
78 | + public function __construct(midcom_core_privilege_db | array | string | null $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|null $src = null) |
|
447 | + private function _load(midcom_core_privilege_db | string | null $src = null) |
|
448 | 448 | { |
449 | 449 | if ($src instanceof midcom_core_privilege_db) { |
450 | 450 | // Got a privilege object as argument, use that |