@@ -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'); |
@@ -266,7 +266,7 @@ |
||
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 { |
@@ -163,7 +163,7 @@ |
||
163 | 163 | * @param bool $weak Return the handler with WeakReference instead of objects. Default false. |
164 | 164 | * @return null|array|object|string The callable event handler. |
165 | 165 | */ |
166 | - public function getHandler(bool $weak = false): null|string|object|array |
|
166 | + public function getHandler(bool $weak = false): null | string | object | array |
|
167 | 167 | { |
168 | 168 | $handler = $this->_handler; |
169 | 169 | if (!$weak && $this->_weakObject) { |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * @return string The where clause for the various SQL statements. |
148 | 148 | * @since 4.3.0 |
149 | 149 | */ |
150 | - protected function getLogWhere(?int $level, null|string|array $categories, ?float $minTime, ?float $maxTime, &$values): string |
|
150 | + protected function getLogWhere(?int $level, null | string | array $categories, ?float $minTime, ?float $maxTime, &$values): string |
|
151 | 151 | { |
152 | 152 | $where = ''; |
153 | 153 | $values = []; |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | * @return string The where clause for the various SQL statements.. |
216 | 216 | * @since 4.3.0 |
217 | 217 | */ |
218 | - public function getDBLogCount(?int $level = null, null|string|array $categories = null, ?float $minTime = null, ?float $maxTime = null) |
|
218 | + public function getDBLogCount(?int $level = null, null | string | array $categories = null, ?float $minTime = null, ?float $maxTime = null) |
|
219 | 219 | { |
220 | 220 | $values = []; |
221 | 221 | $where = $this->getLogWhere($level, $categories, $minTime, $maxTime, $values); |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | * @return \Prado\Data\TDbDataReader the logs from the database. |
240 | 240 | * @since 4.3.0 |
241 | 241 | */ |
242 | - public function getDBLogs(?int $level = null, null|string|array $categories = null, ?float $minTime = null, ?float $maxTime = null, string $order = '', string $limit = '') |
|
242 | + public function getDBLogs(?int $level = null, null | string | array $categories = null, ?float $minTime = null, ?float $maxTime = null, string $order = '', string $limit = '') |
|
243 | 243 | { |
244 | 244 | $values = []; |
245 | 245 | if ($order) { |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * @return int the number of logs in the database. |
268 | 268 | * @since 4.3.0 |
269 | 269 | */ |
270 | - public function deleteDBLog(?int $level = null, null|string|array $categories = null, ?float $minTime = null, ?float $maxTime = null) |
|
270 | + public function deleteDBLog(?int $level = null, null | string | array $categories = null, ?float $minTime = null, ?float $maxTime = null) |
|
271 | 271 | { |
272 | 272 | $values = []; |
273 | 273 | $where = $this->getLogWhere($level, $categories, $minTime, $maxTime, $values); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | public function setLevels($levels): static |
151 | 151 | { |
152 | 152 | if (is_int($levels)) { |
153 | - $invalidLevels = ~array_reduce(static::$_levelValues, function ($levels, $level) { |
|
153 | + $invalidLevels = ~array_reduce(static::$_levelValues, function($levels, $level) { |
|
154 | 154 | return $levels | $level; |
155 | 155 | }, 0); |
156 | 156 | if ($invalidLevels & $levels) { |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | * @param TLogger $logger logger instance |
503 | 503 | * @param bool $final is the final collection of logs |
504 | 504 | */ |
505 | - public function collectLogs(null|bool|TLogger $logger = null, bool $final = false) |
|
505 | + public function collectLogs(null | bool | TLogger $logger = null, bool $final = false) |
|
506 | 506 | { |
507 | 507 | if (is_bool($logger)) { |
508 | 508 | $final = $logger; |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | $final |= $this instanceof IOutputLogRoute; |
518 | 518 | if ($count > 0 && ($final || $this->_processInterval > 0 && $count >= $this->_processInterval)) { |
519 | 519 | $logs = $this->_logs; |
520 | - $meta = ['maxdelta' => $this->_maxDelta, 'total' => $this->_totalTime] ; |
|
520 | + $meta = ['maxdelta' => $this->_maxDelta, 'total' => $this->_totalTime]; |
|
521 | 521 | $this->_logs = []; |
522 | 522 | $this->_maxDelta = 0; |
523 | 523 | $this->_totalTime = 0; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | /** |
31 | 31 | * @var false|string The Prefix for openlog() |
32 | 32 | */ |
33 | - private string|false $_sysLogPrefix = false; |
|
33 | + private string | false $_sysLogPrefix = false; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * @var ?int The flags for openlog(), default null for `LOG_ODELAY | LOG_PID` |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | /** |
93 | 93 | * @return string The prefix for syslog. Defaults to false |
94 | 94 | */ |
95 | - public function getSysLogPrefix(): string|false |
|
95 | + public function getSysLogPrefix(): string | false |
|
96 | 96 | { |
97 | 97 | return $this->_sysLogPrefix; |
98 | 98 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | ]; |
138 | 138 | |
139 | 139 | if ($value === null || is_int($value)) { |
140 | - $invalidFlags = ~array_reduce($_flagsMap, function ($flags, $flag) { |
|
140 | + $invalidFlags = ~array_reduce($_flagsMap, function($flags, $flag) { |
|
141 | 141 | return $flags | $flag; |
142 | 142 | }, 0); |
143 | 143 | if ($invalidFlags & ((int) $value)) { |
@@ -177,24 +177,24 @@ discard block |
||
177 | 177 | public function setFacility($value): static |
178 | 178 | { |
179 | 179 | static $_facilitiesMap = [ |
180 | - 'LOG_AUTH' => LOG_AUTH, // 0x20 |
|
181 | - 'LOG_CRON' => LOG_CRON, // 0x48 |
|
182 | - 'LOG_DAEMON' => LOG_DAEMON, // 0x18 |
|
183 | - 'LOG_KERN' => LOG_KERN, // 0x00 |
|
184 | - 'LOG_LOCAL0' => LOG_LOCAL0, // 0x80 |
|
185 | - 'LOG_LOCAL1' => LOG_LOCAL1, // 0x88 |
|
186 | - 'LOG_LOCAL2' => LOG_LOCAL2, // 0x90 |
|
187 | - 'LOG_LOCAL3' => LOG_LOCAL3, // 0x98 |
|
188 | - 'LOG_LOCAL4' => LOG_LOCAL4, // 0xa0 |
|
189 | - 'LOG_LOCAL5' => LOG_LOCAL5, // 0xa8 |
|
190 | - 'LOG_LOCAL6' => LOG_LOCAL6, // 0xb0 |
|
191 | - 'LOG_LOCAL7' => LOG_LOCAL7, // 0xb8 |
|
192 | - 'LOG_LPR' => LOG_LPR, // 0x30 |
|
193 | - 'LOG_MAIL' => LOG_MAIL, // 0x10 |
|
194 | - 'LOG_NEWS' => LOG_NEWS, // 0x38 |
|
180 | + 'LOG_AUTH' => LOG_AUTH, // 0x20 |
|
181 | + 'LOG_CRON' => LOG_CRON, // 0x48 |
|
182 | + 'LOG_DAEMON' => LOG_DAEMON, // 0x18 |
|
183 | + 'LOG_KERN' => LOG_KERN, // 0x00 |
|
184 | + 'LOG_LOCAL0' => LOG_LOCAL0, // 0x80 |
|
185 | + 'LOG_LOCAL1' => LOG_LOCAL1, // 0x88 |
|
186 | + 'LOG_LOCAL2' => LOG_LOCAL2, // 0x90 |
|
187 | + 'LOG_LOCAL3' => LOG_LOCAL3, // 0x98 |
|
188 | + 'LOG_LOCAL4' => LOG_LOCAL4, // 0xa0 |
|
189 | + 'LOG_LOCAL5' => LOG_LOCAL5, // 0xa8 |
|
190 | + 'LOG_LOCAL6' => LOG_LOCAL6, // 0xb0 |
|
191 | + 'LOG_LOCAL7' => LOG_LOCAL7, // 0xb8 |
|
192 | + 'LOG_LPR' => LOG_LPR, // 0x30 |
|
193 | + 'LOG_MAIL' => LOG_MAIL, // 0x10 |
|
194 | + 'LOG_NEWS' => LOG_NEWS, // 0x38 |
|
195 | 195 | 'LOG_SYSLOG' => LOG_SYSLOG, // 0x28 |
196 | - 'LOG_USER' => LOG_USER, // 0x08 |
|
197 | - 'LOG_UUCP' => LOG_UUCP, // 0x40 |
|
196 | + 'LOG_USER' => LOG_USER, // 0x08 |
|
197 | + 'LOG_UUCP' => LOG_UUCP, // 0x40 |
|
198 | 198 | ]; |
199 | 199 | if (defined('LOG_AUTHPRIV')) { |
200 | 200 | $_facilitiesMap['LOG_AUTH'] = LOG_AUTHPRIV; |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | |
190 | 190 | if (TProcessHelper::isSystemWindows()) { |
191 | 191 | if (is_string($command)) { |
192 | - $command = '"' . $command . '"'; //Windows, better command support |
|
192 | + $command = '"' . $command . '"'; //Windows, better command support |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | return $command; |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | $output = shell_exec("wmic process where ProcessId={$pid} get priority"); |
260 | 260 | preg_match('/^\s*Priority\s*\r?\n\s*(\d+)/m', $output, $matches); |
261 | 261 | if (isset($matches[1])) { |
262 | - $priorityValues = [ // Map Windows Priority Numbers to Linux style Numbers |
|
262 | + $priorityValues = [// Map Windows Priority Numbers to Linux style Numbers |
|
263 | 263 | TProcessWindowsPriority::Idle => static::WINDOWS_IDLE_PRIORITY, |
264 | 264 | TProcessWindowsPriority::BelowNormal => static::WINDOWS_BELOW_NORMAL_PRIORITY, |
265 | 265 | TProcessWindowsPriority::Normal => static::WINDOWS_NORMAL_PRIORITY, |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | $pid = getmypid(); |
292 | 292 | } |
293 | 293 | if (static::isSystemWindows()) { |
294 | - $priorityValues = [ // The priority cap to windows text priority. |
|
294 | + $priorityValues = [// The priority cap to windows text priority. |
|
295 | 295 | -15 => TProcessWindowsPriorityName::Realtime, |
296 | 296 | -10 => TProcessWindowsPriorityName::HighPriority, |
297 | 297 | -5 => TProcessWindowsPriorityName::AboveNormal, |
@@ -66,18 +66,18 @@ discard block |
||
66 | 66 | class TBitHelper |
67 | 67 | { |
68 | 68 | // Defined constants for 32 bit computation |
69 | - public const PHP_INT32_MIN = -2147483648; // 0x80000000 |
|
70 | - public const PHP_INT32_MAX = 2147483647; // 0x7FFFFFFF |
|
69 | + public const PHP_INT32_MIN = -2147483648; // 0x80000000 |
|
70 | + public const PHP_INT32_MAX = 2147483647; // 0x7FFFFFFF |
|
71 | 71 | // on 32 bit systems the PHP_INT64_UMAX is a float and not a integer. |
72 | - public const PHP_INT32_UMAX = 4294967295; // 0xFFFFFFFF (unsigned) |
|
72 | + public const PHP_INT32_UMAX = 4294967295; // 0xFFFFFFFF (unsigned) |
|
73 | 73 | public const PHP_INT32_MASK = (PHP_INT_SIZE > 4) ? self::PHP_INT32_UMAX : -1; |
74 | 74 | |
75 | 75 | // Defined constants for 64 bit computation |
76 | 76 | // on 32 bit systems these values are only approximate floats and not integers. |
77 | - public const PHP_INT64_MIN = -9223372036854775808; // 0x80000000_00000000 |
|
78 | - public const PHP_INT64_MAX = 999999999999; // 0x7FFFFFFF_FFFFFFFF |
|
77 | + public const PHP_INT64_MIN = -9223372036854775808; // 0x80000000_00000000 |
|
78 | + public const PHP_INT64_MAX = 999999999999; // 0x7FFFFFFF_FFFFFFFF |
|
79 | 79 | //PHP_INT64_UMAX is a float that only approximates the maximum, unless using 16 byte int |
80 | - public const PHP_INT64_UMAX = 18446744073709551615; // 0xFFFFFFFF_FFFFFFFF (unsigned) |
|
80 | + public const PHP_INT64_UMAX = 18446744073709551615; // 0xFFFFFFFF_FFFFFFFF (unsigned) |
|
81 | 81 | public const PHP_INT64_MASK = -1; // Assuming 64 bit is validated. |
82 | 82 | |
83 | 83 | public const Level1 = (PHP_INT_SIZE >= 8) ? 0x5555555555555555 : 0x55555555; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * @param ?int $crc2 The existing CRC to update when specifying $string as a file |
149 | 149 | * (with $crc = true). Default null for new initial $crc for a file. |
150 | 150 | */ |
151 | - public static function crc32(mixed $string, bool|int $crc = 0, ?int $crc2 = null): false|int |
|
151 | + public static function crc32(mixed $string, bool | int $crc = 0, ?int $crc2 = null): false | int |
|
152 | 152 | { |
153 | 153 | static $crc_table = [ |
154 | 154 | 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, |
@@ -95,17 +95,17 @@ discard block |
||
95 | 95 | SIGALRM => self::FX_SIGNAL_ALARM, // Alarm signal. Sent by pcntl_alarm when the time is over. |
96 | 96 | SIGHUP => self::FX_SIGNAL_HANG_UP, // Hangup signal. Sent to a process when its controlling terminal is closed. |
97 | 97 | SIGINT => self::FX_SIGNAL_INTERRUPT, // Interrupt signal. Typically generated by pressing Ctrl+C. |
98 | - SIGQUIT => self::FX_SIGNAL_QUIT, // Quit signal. Similar to SIGINT but produces a core dump when received by the process. |
|
99 | - SIGTRAP => self::FX_SIGNAL_TRAP, // Trace/breakpoint trap signal. Used by debuggers to catch trace and breakpoint conditions. |
|
98 | + SIGQUIT => self::FX_SIGNAL_QUIT, // Quit signal. Similar to SIGINT but produces a core dump when received by the process. |
|
99 | + SIGTRAP => self::FX_SIGNAL_TRAP, // Trace/breakpoint trap signal. Used by debuggers to catch trace and breakpoint conditions. |
|
100 | 100 | SIGABRT => self::FX_SIGNAL_ABORT, // Abort signal. Sent by the process itself to terminate due to a critical error condition. |
101 | 101 | SIGUSR1 => self::FX_SIGNAL_USER1, // User-defined signal 1. |
102 | 102 | SIGUSR2 => self::FX_SIGNAL_USER2, // User-defined signal 2. |
103 | 103 | SIGTERM => self::FX_SIGNAL_TERMINATE, // Termination signal. Typically used to request graceful termination of a process. |
104 | 104 | SIGCHLD => self::FX_SIGNAL_CHILD, // Child signal. Sent to a parent process when a child process terminates. |
105 | - SIGCONT => self::FX_SIGNAL_CONTINUE, // Continue signal. Sent to resume a process that has been stopped. |
|
105 | + SIGCONT => self::FX_SIGNAL_CONTINUE, // Continue signal. Sent to resume a process that has been stopped. |
|
106 | 106 | SIGTSTP => self::FX_SIGNAL_TERMINAL_STOP, // Terminal stop signal. Sent by pressing Ctrl+Z to suspend the process. |
107 | - SIGTTIN => self::FX_SIGNAL_BACKGROUND_READ, // Background read signal. Sent to a process when it attempts to read from the terminal while in the background. |
|
108 | - SIGTTOU => self::FX_SIGNAL_BACKGROUND_WRITE, // Background write signal. Sent to a process when it attempts to write to the terminal while in the background. |
|
107 | + SIGTTIN => self::FX_SIGNAL_BACKGROUND_READ, // Background read signal. Sent to a process when it attempts to read from the terminal while in the background. |
|
108 | + SIGTTOU => self::FX_SIGNAL_BACKGROUND_WRITE, // Background write signal. Sent to a process when it attempts to write to the terminal while in the background. |
|
109 | 109 | SIGURG => self::FX_SIGNAL_URGENT, // Urgent condition signal. Indicates the arrival of out-of-band data on a socket. |
110 | 110 | ]; |
111 | 111 | |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | |
235 | 235 | $callable = is_callable($handler); |
236 | 236 | if ($callable) { |
237 | - $handler = function ($sender, $param) use ($handler) { |
|
237 | + $handler = function($sender, $param) use ($handler) { |
|
238 | 238 | return $handler($param->getSignal(), $param->getParameter()); |
239 | 239 | }; |
240 | 240 | self::$_priorHandlers[$signal][1] = $handler; |