@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | protected function weakCustomAdd(object $object) |
138 | 138 | { |
139 | - if($object instanceof TEventHandler) { |
|
139 | + if ($object instanceof TEventHandler) { |
|
140 | 140 | $object = $object->getHandlerObject(); |
141 | 141 | if (!$object) { |
142 | 142 | return; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | protected function weakCustomRemove(object $object) |
157 | 157 | { |
158 | - if($object instanceof TEventHandler) { |
|
158 | + if ($object instanceof TEventHandler) { |
|
159 | 159 | $object = $object->getHandlerObject(); |
160 | 160 | if (!$object) { |
161 | 161 | return; |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $handler = null; |
196 | 196 | } |
197 | 197 | } elseif (is_object($handler)) { |
198 | - if($handler instanceof WeakReference) { |
|
198 | + if ($handler instanceof WeakReference) { |
|
199 | 199 | $handler = $handler->get(); |
200 | 200 | } elseif (($handler instanceof TEventHandler) && !$handler->hasHandler()) { |
201 | 201 | $handler = null; |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | */ |
295 | 295 | public function setDiscardInvalid($value): void |
296 | 296 | { |
297 | - if($value === $this->_discardInvalid) { |
|
297 | + if ($value === $this->_discardInvalid) { |
|
298 | 298 | return; |
299 | 299 | } |
300 | 300 | if ($this->_discardInvalid !== null && !Prado::isCallingSelf()) { |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | $obj = $obj->getHandlerObject(true); |
314 | 314 | } |
315 | 315 | if ($obj instanceof WeakReference) { |
316 | - if($obj = $obj->get()) { |
|
316 | + if ($obj = $obj->get()) { |
|
317 | 317 | $this->weakAdd($obj); |
318 | 318 | } else { |
319 | 319 | parent::removeAtIndexInPriority($i, $priority); |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | throw new TInvalidDataValueException('weakcallablecollection_callable_required'); |
525 | 525 | } |
526 | 526 | $return = null; |
527 | - foreach($items as $item) { |
|
527 | + foreach ($items as $item) { |
|
528 | 528 | $itemPriority = null; |
529 | 529 | if (($isPriorityItem = ($item instanceof IPriorityItem)) && ($priority === null || !is_numeric($priority))) { |
530 | 530 | $itemPriority = $priority = $item->getPriority(); |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | $result = parent::insertAtIndexInPriority($item, $index, $priority, $preserveCache); |
541 | 541 | if ($return === null) { |
542 | 542 | $return = $result; |
543 | - } elseif(!is_array($return)) { |
|
543 | + } elseif (!is_array($return)) { |
|
544 | 544 | $return = [$return, $result]; |
545 | 545 | } else { |
546 | 546 | $return[] = $result; |
@@ -713,7 +713,7 @@ discard block |
||
713 | 713 | continue; |
714 | 714 | } elseif ($p == $priority) { |
715 | 715 | $index = false; |
716 | - foreach($this->_d[$p] as $index => $pItem) { |
|
716 | + foreach ($this->_d[$p] as $index => $pItem) { |
|
717 | 717 | if ($item === $pItem || ($pItem instanceof TEventHandler) && $pItem->isSameHandler($item, true)) { |
718 | 718 | break; |
719 | 719 | } |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | $this->flattenPriorities(); |
732 | 732 | |
733 | 733 | if (($index = array_search($item, $this->_fd, true)) === false && $this->_eventHandlerCount) { |
734 | - foreach($this->_fd as $index => $pItem) { |
|
734 | + foreach ($this->_fd as $index => $pItem) { |
|
735 | 735 | if (($pItem instanceof TEventHandler) && $pItem->isSameHandler($item, true)) { |
736 | 736 | break; |
737 | 737 | } |
@@ -783,8 +783,8 @@ discard block |
||
783 | 783 | $absindex = 0; |
784 | 784 | foreach (array_keys($this->_d) as $priority) { |
785 | 785 | $index = false; |
786 | - foreach($this->_d[$priority] as $index => $pItem) { |
|
787 | - if(($pItem instanceof TEventHandler) && $pItem->isSameHandler($item, true)) { |
|
786 | + foreach ($this->_d[$priority] as $index => $pItem) { |
|
787 | + if (($pItem instanceof TEventHandler) && $pItem->isSameHandler($item, true)) { |
|
788 | 788 | break; |
789 | 789 | } |
790 | 790 | $index = false; |
@@ -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); |