@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @param ?bool $autoSubscribe |
50 | 50 | * @param mixed $index |
51 | 51 | */ |
52 | - public function __construct(?TComponent $component = null, mixed $event = null, mixed $handler = null, null|int|float $priority = null, ?bool $autoSubscribe = null, mixed $index = null) |
|
52 | + public function __construct(?TComponent $component = null, mixed $event = null, mixed $handler = null, null | int | float $priority = null, ?bool $autoSubscribe = null, mixed $index = null) |
|
53 | 53 | { |
54 | 54 | if ($component) { |
55 | 55 | $this->setComponent($component); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @param bool $weak |
66 | 66 | * @return null|array|ArrayAccess|WeakReference The Event Handler from the component. |
67 | 67 | */ |
68 | - public function &getArray(bool $weak = false): array|ArrayAccess|WeakReference|null |
|
68 | + public function &getArray(bool $weak = false): array | ArrayAccess | WeakReference | null |
|
69 | 69 | { |
70 | 70 | if ($handlers = parent::getArray($weak)) { |
71 | 71 | return $handlers; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @param null|array|ArrayAccess $value |
101 | 101 | * @throws TInvalidOperationException This property cannot be set directly. |
102 | 102 | */ |
103 | - public function setArray(null|array|ArrayAccess &$value): static |
|
103 | + public function setArray(null | array | ArrayAccess & $value): static |
|
104 | 104 | { |
105 | 105 | if ($value !== null) { |
106 | 106 | throw new TInvalidOperationException('eventsubscription_no_setarray'); |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * @return bool is the array a list. |
29 | 29 | * @link https://www.php.net/manual/en/function.array-is-list.php |
30 | 30 | */ |
31 | - public static function array_is_list(array|Traversable $array): bool |
|
31 | + public static function array_is_list(array | Traversable $array): bool |
|
32 | 32 | { |
33 | 33 | if (function_exists('array_is_list') && !($array instanceof Traversable)) { |
34 | 34 | return array_is_list($array); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | /** |
79 | 79 | * @var null|int|string The key that the item is added to the array. |
80 | 80 | */ |
81 | - private null|int|string $_key = null; |
|
81 | + private null | int | string $_key = null; |
|
82 | 82 | |
83 | 83 | /** |
84 | 84 | * @var mixed The item subscribing to the array. |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @var null|bool|int Is the array an associative array. False for a "list" style array. |
96 | 96 | * null for discovery of the style of array on subscribe. default true. |
97 | 97 | */ |
98 | - protected null|bool|int $_isAssoc = true; |
|
98 | + protected null | bool | int $_isAssoc = true; |
|
99 | 99 | |
100 | 100 | /** |
101 | 101 | * @var bool Is the item inserted into the collection. |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * the item. Default 1 for true except for TList. |
136 | 136 | * @param bool $autoSubscribe Should the |
137 | 137 | */ |
138 | - public function __construct(mixed &$array = null, mixed $key = null, mixed $item = null, null|int|float $priority = null, null|bool|int $isAssociative = 1, ?bool $autoSubscribe = null) |
|
138 | + public function __construct(mixed &$array = null, mixed $key = null, mixed $item = null, null | int | float $priority = null, null | bool | int $isAssociative = 1, ?bool $autoSubscribe = null) |
|
139 | 139 | { |
140 | 140 | $this->setArray($array); |
141 | 141 | $this->setKey($key); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | * @param bool $weak |
178 | 178 | * @return array|ArrayAccess The subscribed array-collection, passed by reference. |
179 | 179 | */ |
180 | - public function &getArray(bool $weak = false): array|ArrayAccess|WeakReference|null |
|
180 | + public function &getArray(bool $weak = false): array | ArrayAccess | WeakReference | null |
|
181 | 181 | { |
182 | 182 | if ($this->_array instanceof WeakReference) { |
183 | 183 | if ($weak) { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * @throws TInvalidOperationException If the item is already subscribed. |
203 | 203 | * @return static The current object. |
204 | 204 | */ |
205 | - public function setArray(null|array|ArrayAccess &$value): static |
|
205 | + public function setArray(null | array | ArrayAccess & $value): static |
|
206 | 206 | { |
207 | 207 | if ($this->_isSubscribed) { |
208 | 208 | throw new TInvalidOperationException('arraysubscription_no_change', 'Array'); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | * with the TList (by {@see \Prado\Collections\TList::indexOf()}) or array (by array_search). |
224 | 224 | * @return null|int|string The key for the item subscription to the array. |
225 | 225 | */ |
226 | - public function getKey(): null|int|string |
|
226 | + public function getKey(): null | int | string |
|
227 | 227 | { |
228 | 228 | $collection = &$this->getArray(); |
229 | 229 | if ($this->_isSubscribed && $this->_key === null) { |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | * as a list from (0, ..., count() - 1). if null, where needed, the "list"ness |
323 | 323 | * of the array will be determined by {@see \Prado\Util\Helpers\TArrayHelper::array_is_list()}. |
324 | 324 | */ |
325 | - public function getIsAssociative(): null|bool|int |
|
325 | + public function getIsAssociative(): null | bool | int |
|
326 | 326 | { |
327 | 327 | return $this->_isAssoc; |
328 | 328 | } |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | * @throws TInvalidOperationException If the item is already subscribed. |
335 | 335 | * @return static The current object. |
336 | 336 | */ |
337 | - public function setIsAssociative(null|bool|int $value = null): static |
|
337 | + public function setIsAssociative(null | bool | int $value = null): static |
|
338 | 338 | { |
339 | 339 | if ($this->_isSubscribed) { |
340 | 340 | throw new TInvalidOperationException('arraysubscription_no_change', 'Key'); |