@@ -176,7 +176,7 @@ |
||
| 176 | 176 | $writer->addAttribute('value', $text); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - switch($this->getAutoCompleteType()) { |
|
| 179 | + switch ($this->getAutoCompleteType()) { |
|
| 180 | 180 | case TTextBoxAutoCompleteType::Enabled: |
| 181 | 181 | $writer->addAttribute('autocomplete', 'on'); |
| 182 | 182 | break; |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | */ |
| 92 | 92 | public static function parseEncodingLanguage(string &$encoding, &$lang) |
| 93 | 93 | { |
| 94 | - if(strpos($encoding, '.') !== false) { |
|
| 94 | + if (strpos($encoding, '.') !== false) { |
|
| 95 | 95 | $parts = explode($encoding, '.', 1); |
| 96 | 96 | $encoding = $parts[0]; |
| 97 | 97 | $lang = $parts[1]; |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | throw new TInvalidOperationException('classbehavior_detach_wrong_owner', $this->getName()); |
| 128 | 128 | } |
| 129 | 129 | parent::detach($component); |
| 130 | - if($this->_owners->remove($component) === 0 && !$this->_owners->getCount()) { |
|
| 130 | + if ($this->_owners->remove($component) === 0 && !$this->_owners->getCount()) { |
|
| 131 | 131 | $this->_owners = null; |
| 132 | 132 | $this->_name = null; |
| 133 | 133 | $this->_handlersInstalled = null; |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | protected function setHandlersStatus(TComponent $component, bool $attach): bool |
| 229 | 229 | { |
| 230 | 230 | $ref = is_array($this->_handlersInstalled) ? spl_object_id($component) : $component; |
| 231 | - if($attach) { |
|
| 231 | + if ($attach) { |
|
| 232 | 232 | if ($this->_owners && $this->_owners->contains($component) && !isset($this->_handlersInstalled[$ref])) { |
| 233 | 233 | $this->_handlersInstalled[$ref] = true; |
| 234 | 234 | return true; |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | public static function mergeHandlers(...$args): array |
| 150 | 150 | { |
| 151 | - if(empty($args)) { |
|
| 151 | + if (empty($args)) { |
|
| 152 | 152 | return []; |
| 153 | 153 | } |
| 154 | 154 | $combined = []; |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | $strict = $this->getStrictEvents(); |
| 336 | 336 | foreach ($this->eventsLog() as $event => $handlers) { |
| 337 | 337 | if ($strict || $this->hasEvent($event)) { |
| 338 | - foreach($handlers as $handler) { |
|
| 338 | + foreach ($handlers as $handler) { |
|
| 339 | 339 | $component->attachEventHandler($event, is_string($handler) ? [$this, $handler] : $handler, $priority); |
| 340 | 340 | } |
| 341 | 341 | } |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | $strict = $this->getStrictEvents(); |
| 356 | 356 | foreach ($this->eventsLog() as $event => $handlers) { |
| 357 | 357 | if ($strict || $this->hasEvent($event)) { |
| 358 | - foreach($handlers as $handler) { |
|
| 358 | + foreach ($handlers as $handler) { |
|
| 359 | 359 | $component->detachEventHandler($event, is_string($handler) ? [$this, $handler] : $handler); |
| 360 | 360 | } |
| 361 | 361 | } |
@@ -221,7 +221,7 @@ |
||
| 221 | 221 | if ($this->getOwner() !== $component) { |
| 222 | 222 | return false; |
| 223 | 223 | } |
| 224 | - if($attach ^ $this->_handlersInstalled) { |
|
| 224 | + if ($attach ^ $this->_handlersInstalled) { |
|
| 225 | 225 | $this->_handlersInstalled = $attach; |
| 226 | 226 | return true; |
| 227 | 227 | } |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | if ($value === null) { |
| 83 | 83 | return; |
| 84 | 84 | } |
| 85 | - if($this->_r === null || Prado::isCallingSelf()) { |
|
| 85 | + if ($this->_r === null || Prado::isCallingSelf()) { |
|
| 86 | 86 | $this->_r = TPropertyValue::ensureBoolean($value); |
| 87 | 87 | } else { |
| 88 | 88 | throw new TInvalidOperationException('map_readonly_set', $this::class); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | if ($value === $this->_dp) { |
| 102 | 102 | return; |
| 103 | 103 | } |
| 104 | - if($this->_dp === null || Prado::isCallingSelf()) { |
|
| 104 | + if ($this->_dp === null || Prado::isCallingSelf()) { |
|
| 105 | 105 | $this->_dp = (string) round(TPropertyValue::ensureFloat($value), $this->getPrecision()); |
| 106 | 106 | } else { |
| 107 | 107 | throw new TInvalidOperationException('prioritytrait_no_set_default_priority'); |
@@ -130,13 +130,13 @@ discard block |
||
| 130 | 130 | if ($value === $this->_p) { |
| 131 | 131 | return; |
| 132 | 132 | } |
| 133 | - if($this->_p !== null && !Prado::isCallingSelf()) { |
|
| 133 | + if ($this->_p !== null && !Prado::isCallingSelf()) { |
|
| 134 | 134 | throw new TInvalidOperationException('prioritytrait_no_set_precision'); |
| 135 | 135 | } |
| 136 | 136 | $this->_p = TPropertyValue::ensureInteger($value); |
| 137 | 137 | $this->setDefaultPriority($this->_dp); |
| 138 | 138 | $_d = []; |
| 139 | - foreach(array_keys($this->_d) as $priority) { |
|
| 139 | + foreach (array_keys($this->_d) as $priority) { |
|
| 140 | 140 | $newPriority = $this->ensurePriority($priority); |
| 141 | 141 | if (array_key_exists($newPriority, $_d)) { |
| 142 | 142 | if ($this->getPriorityCombineStyle()) { |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | } |
| 283 | 283 | $items[] = $itemsatpriority; |
| 284 | 284 | } |
| 285 | - if(empty($items)) { |
|
| 285 | + if (empty($items)) { |
|
| 286 | 286 | return []; |
| 287 | 287 | } |
| 288 | 288 | if ($this->getPriorityCombineStyle()) { |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | } |
| 310 | 310 | $items[] = $itemsatpriority; |
| 311 | 311 | } |
| 312 | - if(empty($items)) { |
|
| 312 | + if (empty($items)) { |
|
| 313 | 313 | return []; |
| 314 | 314 | } |
| 315 | 315 | if ($this->getPriorityCombineStyle()) { |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | if ($value === null) { |
| 90 | 90 | return; |
| 91 | 91 | } |
| 92 | - if($this->_r === null || Prado::isCallingSelf()) { |
|
| 92 | + if ($this->_r === null || Prado::isCallingSelf()) { |
|
| 93 | 93 | $this->_r = TPropertyValue::ensureBoolean($value); |
| 94 | 94 | } else { |
| 95 | 95 | throw new TInvalidOperationException('list_readonly_set', $this::class); |
@@ -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; |