@@ -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 | $this->_eventHandlerCount++; |
| 142 | 142 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | protected function weakCustomRemove(object $object) |
| 154 | 154 | { |
| 155 | - if($object instanceof TEventHandler) { |
|
| 155 | + if ($object instanceof TEventHandler) { |
|
| 156 | 156 | $object = $object->getHandlerObject(); |
| 157 | 157 | $this->_eventHandlerCount--; |
| 158 | 158 | } |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $handler = null; |
| 190 | 190 | } |
| 191 | 191 | } elseif (is_object($handler)) { |
| 192 | - if($handler instanceof WeakReference) { |
|
| 192 | + if ($handler instanceof WeakReference) { |
|
| 193 | 193 | $handler = $handler->get(); |
| 194 | 194 | } elseif (($handler instanceof TEventHandler) && !$handler->hasHandler()) { |
| 195 | 195 | $handler = null; |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | */ |
| 289 | 289 | public function setDiscardInvalid($value): void |
| 290 | 290 | { |
| 291 | - if($value === $this->_discardInvalid) { |
|
| 291 | + if ($value === $this->_discardInvalid) { |
|
| 292 | 292 | return; |
| 293 | 293 | } |
| 294 | 294 | if ($this->_discardInvalid !== null && !Prado::isCallingSelf()) { |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | $obj = $obj->getHandlerObject(true); |
| 308 | 308 | } |
| 309 | 309 | if ($obj instanceof WeakReference) { |
| 310 | - if($obj = $obj->get()) { |
|
| 310 | + if ($obj = $obj->get()) { |
|
| 311 | 311 | $this->weakAdd($obj); |
| 312 | 312 | } else { |
| 313 | 313 | parent::removeAtIndexInPriority($i, $priority); |
@@ -660,7 +660,7 @@ discard block |
||
| 660 | 660 | $this->flattenPriorities(); |
| 661 | 661 | |
| 662 | 662 | if (($index = array_search($item, $this->_fd, true)) === false && $this->_eventHandlerCount) { |
| 663 | - foreach($this->_fd as $index => $pItem) { |
|
| 663 | + foreach ($this->_fd as $index => $pItem) { |
|
| 664 | 664 | if (($pItem instanceof TEventHandler) && $pItem->isSameHandler($item, true)) { |
| 665 | 665 | break; |
| 666 | 666 | } |
@@ -712,8 +712,8 @@ discard block |
||
| 712 | 712 | $absindex = 0; |
| 713 | 713 | foreach (array_keys($this->_d) as $priority) { |
| 714 | 714 | $index = false; |
| 715 | - foreach($this->_d[$priority] as $index => $pItem) { |
|
| 716 | - if(($pItem instanceof TEventHandler) && $pItem->isSameHandler($item, true)) { |
|
| 715 | + foreach ($this->_d[$priority] as $index => $pItem) { |
|
| 716 | + if (($pItem instanceof TEventHandler) && $pItem->isSameHandler($item, true)) { |
|
| 717 | 717 | break; |
| 718 | 718 | } |
| 719 | 719 | $index = false; |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | protected function weakCustomAdd(object $object) |
| 123 | 123 | { |
| 124 | - if($object instanceof TEventHandler) { |
|
| 124 | + if ($object instanceof TEventHandler) { |
|
| 125 | 125 | $object = $object->getHandlerObject(); |
| 126 | 126 | $this->_eventHandlerCount++; |
| 127 | 127 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | protected function weakCustomRemove(object $object) |
| 139 | 139 | { |
| 140 | - if($object instanceof TEventHandler) { |
|
| 140 | + if ($object instanceof TEventHandler) { |
|
| 141 | 141 | $object = $object->getHandlerObject(); |
| 142 | 142 | $this->_eventHandlerCount--; |
| 143 | 143 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $this->filterItemForOutput($item[$key]); |
| 157 | 157 | } |
| 158 | 158 | } elseif (is_object($item)) { |
| 159 | - if($item instanceof WeakReference) { |
|
| 159 | + if ($item instanceof WeakReference) { |
|
| 160 | 160 | $item = $item->get(); |
| 161 | 161 | } elseif (($item instanceof TEventHandler) && !$item->hasHandler()) { |
| 162 | 162 | $item = null; |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | if ($isEventHandler = ($object instanceof TEventHandler)) { |
| 198 | 198 | $object = $object->getHandlerObject(true); |
| 199 | 199 | } |
| 200 | - if(($object instanceof WeakReference) && $object->get() === null) { |
|
| 200 | + if (($object instanceof WeakReference) && $object->get() === null) { |
|
| 201 | 201 | $this->_c--; |
| 202 | 202 | if ($i === $this->_c) { |
| 203 | 203 | array_pop($this->_d); |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | */ |
| 238 | 238 | public function setDiscardInvalid($value): void |
| 239 | 239 | { |
| 240 | - if($value === $this->_discardInvalid) { |
|
| 240 | + if ($value === $this->_discardInvalid) { |
|
| 241 | 241 | return; |
| 242 | 242 | } |
| 243 | 243 | if ($this->_discardInvalid !== null && !Prado::isCallingSelf()) { |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $object = $object->get(); |
| 257 | 257 | } |
| 258 | 258 | if ($object === null) { |
| 259 | - $this->_c--; //on read only, parent::removeAt won't remove for scrub. |
|
| 259 | + $this->_c--; //on read only, parent::removeAt won't remove for scrub. |
|
| 260 | 260 | if ($i === $this->_c) { |
| 261 | 261 | array_pop($this->_d); |
| 262 | 262 | } else { |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | $this->filterItemForInput($item); |
| 436 | 436 | if (($index = parent::indexOf($item)) === -1 && $this->_eventHandlerCount) { |
| 437 | 437 | $index = false; |
| 438 | - foreach($this->_d as $index => $dItem) { |
|
| 438 | + foreach ($this->_d as $index => $dItem) { |
|
| 439 | 439 | if (($dItem instanceof TEventHandler) && $dItem->isSameHandler($item, true)) { |
| 440 | 440 | break; |
| 441 | 441 | } |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | foreach ($classes as $class) { |
| 514 | 514 | if (isset(self::$_um[$class])) { |
| 515 | 515 | foreach (self::$_um[$class] as $name => $behavior) { |
| 516 | - if(is_numeric($name)) { |
|
| 516 | + if (is_numeric($name)) { |
|
| 517 | 517 | continue; |
| 518 | 518 | } |
| 519 | 519 | if (!array_key_exists($name, $classBehaviors)) { |
@@ -1396,7 +1396,7 @@ discard block |
||
| 1396 | 1396 | $name = strtolower($name); |
| 1397 | 1397 | $responses = []; |
| 1398 | 1398 | |
| 1399 | - if($param instanceof IEventParameter) { |
|
| 1399 | + if ($param instanceof IEventParameter) { |
|
| 1400 | 1400 | $param->setEventName($name); |
| 1401 | 1401 | } |
| 1402 | 1402 | |
@@ -1757,7 +1757,7 @@ discard block |
||
| 1757 | 1757 | $behaviorObject->setName($name); |
| 1758 | 1758 | $isClassBehavior = $behaviorObject instanceof IClassBehavior; |
| 1759 | 1759 | unset(self::$_um[$class][$name]); |
| 1760 | - if(empty(self::$_um[$class])) { |
|
| 1760 | + if (empty(self::$_um[$class])) { |
|
| 1761 | 1761 | unset(self::$_um[$class]); |
| 1762 | 1762 | } |
| 1763 | 1763 | $results = $behaviorObject->raiseEvent('fxDetachClassBehavior', null, $param); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | public function __construct(mixed $handler, mixed $data = null) |
| 109 | 109 | { |
| 110 | - if(!is_callable($handler)) { |
|
| 110 | + if (!is_callable($handler)) { |
|
| 111 | 111 | throw new TInvalidDataTypeException('eventhandler_not_callable'); |
| 112 | 112 | } |
| 113 | 113 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | * @param bool $weak Return the handler with WeakReference instead of objects. Default false. |
| 160 | 160 | * @return null|array|object|string The callable event handler. |
| 161 | 161 | */ |
| 162 | - public function getHandler(bool $weak = false): null|string|object|array |
|
| 162 | + public function getHandler(bool $weak = false): null | string | object | array |
|
| 163 | 163 | { |
| 164 | 164 | $handler = $this->_handler; |
| 165 | 165 | if (!$weak && $this->_weakObject) { |
@@ -209,13 +209,13 @@ discard block |
||
| 209 | 209 | $handler = null; |
| 210 | 210 | if (is_array($this->_handler) && is_object($this->_handler[0])) { |
| 211 | 211 | $handler = $this->_handler[0]; |
| 212 | - } elseif($this->_handler instanceof TEventHandler) { |
|
| 212 | + } elseif ($this->_handler instanceof TEventHandler) { |
|
| 213 | 213 | return $this->_handler->getHandlerObject($weak); |
| 214 | - } elseif(is_object($this->_handler)) { |
|
| 214 | + } elseif (is_object($this->_handler)) { |
|
| 215 | 215 | $handler = $this->_handler; |
| 216 | 216 | |
| 217 | 217 | } |
| 218 | - if(!$weak && $this->_weakObject) { |
|
| 218 | + if (!$weak && $this->_weakObject) { |
|
| 219 | 219 | $handler = $handler->get(); |
| 220 | 220 | } |
| 221 | 221 | return $handler; |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | */ |
| 229 | 229 | public function hasHandler(): bool |
| 230 | 230 | { |
| 231 | - if($this->_handler instanceof TEventHandler) { |
|
| 231 | + if ($this->_handler instanceof TEventHandler) { |
|
| 232 | 232 | return $this->_handler->hasHandler(); |
| 233 | 233 | } |
| 234 | 234 | return $this->getHandler() !== null; |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | */ |
| 266 | 266 | public function hasWeakObject(): bool |
| 267 | 267 | { |
| 268 | - if($this->_handler instanceof TEventHandler) { |
|
| 268 | + if ($this->_handler instanceof TEventHandler) { |
|
| 269 | 269 | return $this->_handler->hasWeakObject(); |
| 270 | 270 | } |
| 271 | 271 | return $this->_weakObject; |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | $offset = (int) $offset; |
| 327 | 327 | if ($offset === 2) { |
| 328 | 328 | return $this->_data; |
| 329 | - } elseif(is_array($this->_handler)) { |
|
| 329 | + } elseif (is_array($this->_handler)) { |
|
| 330 | 330 | if ($offset === 0) { |
| 331 | 331 | if ($this->_weakObject) { |
| 332 | 332 | return $this->_handler[$offset]->get(); |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | array_shift($args); |
| 57 | 57 | $n = count($args); |
| 58 | 58 | $previous = null; |
| 59 | - if($n > 0 && ($args[$n - 1] instanceof Throwable)) { |
|
| 59 | + if ($n > 0 && ($args[$n - 1] instanceof Throwable)) { |
|
| 60 | 60 | $previous = array_pop($args); |
| 61 | 61 | $n--; |
| 62 | 62 | } |