@@ -825,7 +825,7 @@ |
||
825 | 825 | * @param array $urlParams The decoded url parameters to be updated or replaced |
826 | 826 | * @return array|false|string |
827 | 827 | */ |
828 | - public function onResolveRequest(array $serviceIDs, array $urlParams): false|string|array |
|
828 | + public function onResolveRequest(array $serviceIDs, array $urlParams): false | string | array |
|
829 | 829 | { |
830 | 830 | $results = $this->raiseEvent('onResolveRequest', $this, new THttpRequestParameter($serviceIDs, $urlParams), TEventResults::EVENT_REVERSE); |
831 | 831 | while (count($results)) { |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * @var false|string The Prefix for openlog() |
31 | 31 | */ |
32 | - private string|false $_sysLogPrefix = false; |
|
32 | + private string | false $_sysLogPrefix = false; |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * @var ?int The flags for openlog(), default null for `LOG_ODELAY | LOG_PID` |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | /** |
92 | 92 | * @return string The prefix for syslog. Defaults to false |
93 | 93 | */ |
94 | - public function getSysLogPrefix(): string|false |
|
94 | + public function getSysLogPrefix(): string | false |
|
95 | 95 | { |
96 | 96 | return $this->_sysLogPrefix; |
97 | 97 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | ]; |
137 | 137 | |
138 | 138 | if ($value === null || is_int($value)) { |
139 | - $invalidFlags = ~array_reduce($_flagsMap, function ($flags, $flag) { |
|
139 | + $invalidFlags = ~array_reduce($_flagsMap, function($flags, $flag) { |
|
140 | 140 | return $flags | $flag; |
141 | 141 | }, 0); |
142 | 142 | if ($invalidFlags & ((int) $value)) { |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | } |
152 | 152 | $options = array_map('trim', $value); |
153 | 153 | $this->_sysLogFlags = 0; |
154 | - while(count($options)) { |
|
154 | + while (count($options)) { |
|
155 | 155 | $option = array_pop($options); |
156 | 156 | if (isset($_flagsMap[$option])) { |
157 | 157 | $this->_sysLogFlags |= $_flagsMap[$option]; |
@@ -176,24 +176,24 @@ discard block |
||
176 | 176 | public function setFacility($value): static |
177 | 177 | { |
178 | 178 | static $_facilitiesMap = [ |
179 | - 'LOG_AUTH' => LOG_AUTH, // 0x20 |
|
180 | - 'LOG_CRON' => LOG_CRON, // 0x48 |
|
181 | - 'LOG_DAEMON' => LOG_DAEMON, // 0x18 |
|
182 | - 'LOG_KERN' => LOG_KERN, // 0x00 |
|
183 | - 'LOG_LOCAL0' => LOG_LOCAL0, // 0x80 |
|
184 | - 'LOG_LOCAL1' => LOG_LOCAL1, // 0x88 |
|
185 | - 'LOG_LOCAL2' => LOG_LOCAL2, // 0x90 |
|
186 | - 'LOG_LOCAL3' => LOG_LOCAL3, // 0x98 |
|
187 | - 'LOG_LOCAL4' => LOG_LOCAL4, // 0xa0 |
|
188 | - 'LOG_LOCAL5' => LOG_LOCAL5, // 0xa8 |
|
189 | - 'LOG_LOCAL6' => LOG_LOCAL6, // 0xb0 |
|
190 | - 'LOG_LOCAL7' => LOG_LOCAL7, // 0xb8 |
|
191 | - 'LOG_LPR' => LOG_LPR, // 0x30 |
|
192 | - 'LOG_MAIL' => LOG_MAIL, // 0x10 |
|
193 | - 'LOG_NEWS' => LOG_NEWS, // 0x38 |
|
179 | + 'LOG_AUTH' => LOG_AUTH, // 0x20 |
|
180 | + 'LOG_CRON' => LOG_CRON, // 0x48 |
|
181 | + 'LOG_DAEMON' => LOG_DAEMON, // 0x18 |
|
182 | + 'LOG_KERN' => LOG_KERN, // 0x00 |
|
183 | + 'LOG_LOCAL0' => LOG_LOCAL0, // 0x80 |
|
184 | + 'LOG_LOCAL1' => LOG_LOCAL1, // 0x88 |
|
185 | + 'LOG_LOCAL2' => LOG_LOCAL2, // 0x90 |
|
186 | + 'LOG_LOCAL3' => LOG_LOCAL3, // 0x98 |
|
187 | + 'LOG_LOCAL4' => LOG_LOCAL4, // 0xa0 |
|
188 | + 'LOG_LOCAL5' => LOG_LOCAL5, // 0xa8 |
|
189 | + 'LOG_LOCAL6' => LOG_LOCAL6, // 0xb0 |
|
190 | + 'LOG_LOCAL7' => LOG_LOCAL7, // 0xb8 |
|
191 | + 'LOG_LPR' => LOG_LPR, // 0x30 |
|
192 | + 'LOG_MAIL' => LOG_MAIL, // 0x10 |
|
193 | + 'LOG_NEWS' => LOG_NEWS, // 0x38 |
|
194 | 194 | 'LOG_SYSLOG' => LOG_SYSLOG, // 0x28 |
195 | - 'LOG_USER' => LOG_USER, // 0x08 |
|
196 | - 'LOG_UUCP' => LOG_UUCP, // 0x40 |
|
195 | + 'LOG_USER' => LOG_USER, // 0x08 |
|
196 | + 'LOG_UUCP' => LOG_UUCP, // 0x40 |
|
197 | 197 | ]; |
198 | 198 | if (defined('LOG_AUTHPRIV')) { |
199 | 199 | $_facilitiesMap['LOG_AUTH'] = LOG_AUTHPRIV; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | public function setLevels($levels): static |
150 | 150 | { |
151 | 151 | if (is_int($levels)) { |
152 | - $invalidLevels = ~array_reduce(static::$_levelValues, function ($levels, $level) { |
|
152 | + $invalidLevels = ~array_reduce(static::$_levelValues, function($levels, $level) { |
|
153 | 153 | return $levels | $level; |
154 | 154 | }, 0); |
155 | 155 | if ($invalidLevels & $levels) { |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $next = []; |
445 | 445 | $nextNext = []; |
446 | 446 | |
447 | - foreach(array_reverse(array_keys($logs)) as $key) { |
|
447 | + foreach (array_reverse(array_keys($logs)) as $key) { |
|
448 | 448 | $next[$key] = $nextNext[$logs[$key][TLogger::LOG_PID]] ?? null; |
449 | 449 | $nextNext[$logs[$key][TLogger::LOG_PID]] = $key; |
450 | 450 | } |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | $profileLast = []; |
455 | 455 | $profileTotal = []; |
456 | 456 | $startTime = $_SERVER["REQUEST_TIME_FLOAT"]; |
457 | - foreach(array_keys($logs) as $key) { |
|
457 | + foreach (array_keys($logs) as $key) { |
|
458 | 458 | if (isset($next[$key])) { |
459 | 459 | $logs[$key]['delta'] = $logs[$next[$key]][TLogger::LOG_TIME] - $logs[$key][TLogger::LOG_TIME]; |
460 | 460 | $total = $logs[$key]['total'] = $logs[$key][TLogger::LOG_TIME] - $startTime; |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | if ($total > $this->_totalTime) { |
466 | 466 | $this->_totalTime = $total; |
467 | 467 | } |
468 | - if(($logs[$key][TLogger::LOG_LEVEL] & TLogger::PROFILE_BEGIN) === TLogger::PROFILE_BEGIN) { |
|
468 | + if (($logs[$key][TLogger::LOG_LEVEL] & TLogger::PROFILE_BEGIN) === TLogger::PROFILE_BEGIN) { |
|
469 | 469 | $profileToken = $logs[$key][TLogger::LOG_MESSAGE] . $logs[$key][TLogger::LOG_PID]; |
470 | 470 | $profile[$profileToken] = $logs[$key]; |
471 | 471 | $profileLast[$profileToken] = false; |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | $logs[$key]['total'] = 0; |
475 | 475 | $logs[$key][TLogger::LOG_MESSAGE] = 'Profile Begin: ' . $logs[$key][TLogger::LOG_MESSAGE]; |
476 | 476 | |
477 | - } elseif(($logs[$key][TLogger::LOG_LEVEL] & TLogger::PROFILE_END) === TLogger::PROFILE_END) { |
|
477 | + } elseif (($logs[$key][TLogger::LOG_LEVEL] & TLogger::PROFILE_END) === TLogger::PROFILE_END) { |
|
478 | 478 | $profileToken = $logs[$key][TLogger::LOG_MESSAGE] . $logs[$key][TLogger::LOG_PID]; |
479 | 479 | if (isset($profile[$profileToken])) { |
480 | 480 | if ($profileLast[$profileToken] !== false) { |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | * @param TLogger $logger logger instance |
502 | 502 | * @param bool $final is the final collection of logs |
503 | 503 | */ |
504 | - public function collectLogs(null|bool|TLogger $logger = null, bool $final = false) |
|
504 | + public function collectLogs(null | bool | TLogger $logger = null, bool $final = false) |
|
505 | 505 | { |
506 | 506 | if (is_bool($logger)) { |
507 | 507 | $final = $logger; |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | $final |= $this instanceof IOutputLogRoute; |
517 | 517 | if ($count > 0 && ($final || $this->_processInterval > 0 && $count >= $this->_processInterval)) { |
518 | 518 | $logs = $this->_logs; |
519 | - $meta = ['maxdelta' => $this->_maxDelta, 'total' => $this->_totalTime] ; |
|
519 | + $meta = ['maxdelta' => $this->_maxDelta, 'total' => $this->_totalTime]; |
|
520 | 520 | $this->_logs = []; |
521 | 521 | $this->_maxDelta = 0; |
522 | 522 | $this->_totalTime = 0; |
@@ -191,7 +191,7 @@ |
||
191 | 191 | $weightLightCutOff = 0.4; |
192 | 192 | if ($normalizedTime > $weightCutOff) { |
193 | 193 | $weight = '; font-weight: ' . round(400 + 500 * ($normalizedTime - $weightCutOff) / (1 - $weightCutOff)); |
194 | - } elseif($normalizedTime < $weightLightCutOff) { |
|
194 | + } elseif ($normalizedTime < $weightLightCutOff) { |
|
195 | 195 | $weight = '; font-weight: ' . round(400 - 300 * ($weightLightCutOff - $normalizedTime) / ($weightLightCutOff)); |
196 | 196 | } else { |
197 | 197 | $weight = ''; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @param ?bool $autoSubscribe Default null for autoSubscribing when there is a |
42 | 42 | * key or item. |
43 | 43 | */ |
44 | - public function __construct(?ArrayAccess $collection = null, mixed $key = null, mixed $item = null, null|int|float $priority = null, null|bool|int $isAssociative = 1, ?bool $autoSubscribe = null) |
|
44 | + public function __construct(?ArrayAccess $collection = null, mixed $key = null, mixed $item = null, null | int | float $priority = null, null | bool | int $isAssociative = 1, ?bool $autoSubscribe = null) |
|
45 | 45 | { |
46 | 46 | parent::__construct($collection, $key, $item, $priority, $isAssociative, $autoSubscribe); |
47 | 47 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * The ArrayAccess collection for getting the array without pass by reference. |
51 | 51 | * @param bool $weak Return the collection in as a WeakReference. |
52 | 52 | */ |
53 | - public function getCollection(bool $weak = false): null|ArrayAccess|WeakReference |
|
53 | + public function getCollection(bool $weak = false): null | ArrayAccess | WeakReference |
|
54 | 54 | { |
55 | 55 | return $this->getArray($weak); |
56 | 56 | } |
@@ -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 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $item[$key] = $element; |
162 | 162 | } |
163 | 163 | } elseif (is_object($item)) { |
164 | - if($item instanceof WeakReference) { |
|
164 | + if ($item instanceof WeakReference) { |
|
165 | 165 | $item = $item->get(); |
166 | 166 | } elseif (($item instanceof TEventHandler) && !$item->hasHandler()) { |
167 | 167 | $item = null; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | if ($isEventHandler = ($object instanceof TEventHandler)) { |
208 | 208 | $object = $object->getHandlerObject(true); |
209 | 209 | } |
210 | - if(($object instanceof WeakReference) && $object->get() === null) { |
|
210 | + if (($object instanceof WeakReference) && $object->get() === null) { |
|
211 | 211 | $this->_c--; |
212 | 212 | if ($i === $this->_c) { |
213 | 213 | array_pop($this->_d); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public function setDiscardInvalid($value): void |
249 | 249 | { |
250 | - if($value === $this->_discardInvalid) { |
|
250 | + if ($value === $this->_discardInvalid) { |
|
251 | 251 | return; |
252 | 252 | } |
253 | 253 | if ($this->_discardInvalid !== null && !Prado::isCallingSelf()) { |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $object = $object->get(); |
267 | 267 | } |
268 | 268 | if ($object === null) { |
269 | - $this->_c--; //on read only, parent::removeAt won't remove for scrub. |
|
269 | + $this->_c--; //on read only, parent::removeAt won't remove for scrub. |
|
270 | 270 | if ($i === $this->_c) { |
271 | 271 | array_pop($this->_d); |
272 | 272 | } else { |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | $this->filterItemForInput($item); |
446 | 446 | if (($index = parent::indexOf($item)) === -1 && $this->_eventHandlerCount) { |
447 | 447 | $index = false; |
448 | - foreach($this->_d as $index => $dItem) { |
|
448 | + foreach ($this->_d as $index => $dItem) { |
|
449 | 449 | if (($dItem instanceof TEventHandler) && $dItem->isSameHandler($item, true)) { |
450 | 450 | break; |
451 | 451 | } |
@@ -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); |