@@ -59,7 +59,7 @@ |
||
| 59 | 59 | $cacheFile = $mode = null; |
| 60 | 60 | if ($app) { |
| 61 | 61 | $cacheFile = $app->getRuntimePath() . DIRECTORY_SEPARATOR . self::FX_CACHE_FILE; |
| 62 | - if((($mode = $app->getMode()) === TApplicationMode::Normal || $mode === TApplicationMode::Performance) && !$_loaded) { |
|
| 62 | + if ((($mode = $app->getMode()) === TApplicationMode::Normal || $mode === TApplicationMode::Performance) && !$_loaded) { |
|
| 63 | 63 | $_loaded = true; |
| 64 | 64 | if (($content = @file_get_contents($cacheFile)) !== false) { |
| 65 | 65 | $_classfx = @unserialize($content) ?? []; |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | { |
| 50 | 50 | $this->setPermissionsManager(TPermissionsManager::getManager()); |
| 51 | 51 | parent::__wakeup(); |
| 52 | - if(!$this->getPermissionsManager() && ($owner = $this->getOwner())) { |
|
| 52 | + if (!$this->getPermissionsManager() && ($owner = $this->getOwner())) { |
|
| 53 | 53 | $owner->detachBehavior($this->getName()); |
| 54 | 54 | } |
| 55 | 55 | } |
@@ -65,18 +65,18 @@ discard block |
||
| 65 | 65 | class TBitHelper |
| 66 | 66 | { |
| 67 | 67 | // Defined constants for 32 bit computation |
| 68 | - public const PHP_INT32_MIN = -2147483648; // 0x80000000 |
|
| 69 | - public const PHP_INT32_MAX = 2147483647; // 0x7FFFFFFF |
|
| 68 | + public const PHP_INT32_MIN = -2147483648; // 0x80000000 |
|
| 69 | + public const PHP_INT32_MAX = 2147483647; // 0x7FFFFFFF |
|
| 70 | 70 | // on 32 bit systems the PHP_INT64_UMAX is a float and not a integer. |
| 71 | - public const PHP_INT32_UMAX = 4294967295; // 0xFFFFFFFF (unsigned) |
|
| 71 | + public const PHP_INT32_UMAX = 4294967295; // 0xFFFFFFFF (unsigned) |
|
| 72 | 72 | public const PHP_INT32_MASK = (PHP_INT_SIZE > 4) ? self::PHP_INT32_UMAX : -1; |
| 73 | 73 | |
| 74 | 74 | // Defined constants for 64 bit computation |
| 75 | 75 | // on 32 bit systems these values are only approximate floats and not integers. |
| 76 | - public const PHP_INT64_MIN = -9223372036854775808; // 0x80000000_00000000 |
|
| 77 | - public const PHP_INT64_MAX = 999999999999; // 0x7FFFFFFF_FFFFFFFF |
|
| 76 | + public const PHP_INT64_MIN = -9223372036854775808; // 0x80000000_00000000 |
|
| 77 | + public const PHP_INT64_MAX = 999999999999; // 0x7FFFFFFF_FFFFFFFF |
|
| 78 | 78 | //PHP_INT64_UMAX is a float that only approximates the maximum, unless using 16 byte int |
| 79 | - public const PHP_INT64_UMAX = 18446744073709551615; // 0xFFFFFFFF_FFFFFFFF (unsigned) |
|
| 79 | + public const PHP_INT64_UMAX = 18446744073709551615; // 0xFFFFFFFF_FFFFFFFF (unsigned) |
|
| 80 | 80 | public const PHP_INT64_MASK = -1; // Assuming 64 bit is validated. |
| 81 | 81 | |
| 82 | 82 | public const Level1 = (PHP_INT_SIZE >= 8) ? 0x5555555555555555 : 0x55555555; |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | * @param ?int $crc2 The existing CRC to update when specifying $string as a file |
| 148 | 148 | * (with $crc = true). Default null for new initial $crc for a file. |
| 149 | 149 | */ |
| 150 | - public static function crc32(mixed $string, bool|int $crc = 0, ?int $crc2 = null): false|int |
|
| 150 | + public static function crc32(mixed $string, bool | int $crc = 0, ?int $crc2 = null): false | int |
|
| 151 | 151 | { |
| 152 | 152 | static $crc_table = [ |
| 153 | 153 | 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | if ($length === null && !$startOffset && !$crc2) { |
| 214 | 214 | $hash = hash_file('crc32b', $string, true); |
| 215 | 215 | $value = unpack('N', $hash)[1]; |
| 216 | - if(PHP_INT_SIZE === 4 && $value > self::PHP_INT32_MAX) { |
|
| 216 | + if (PHP_INT_SIZE === 4 && $value > self::PHP_INT32_MAX) { |
|
| 217 | 217 | $value = (int) ($value - self::PHP_INT32_UMAX - 1); |
| 218 | 218 | } |
| 219 | 219 | return $value; |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | 240 | $crc ^= 0xFFFFFFFF; |
| 241 | - while($length === null || $length > 0) { |
|
| 241 | + while ($length === null || $length > 0) { |
|
| 242 | 242 | $d = fgetc($string); |
| 243 | 243 | if ($d === false || strlen($d) === 0) { |
| 244 | 244 | break; |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | if ($notification instanceof TStreamNotificationCallback) { |
| 156 | - foreach($context as $property => $value) { |
|
| 156 | + foreach ($context as $property => $value) { |
|
| 157 | 157 | if (property_exists($notification, $property) || $notification->canSetProperty($property) || $notification->hasEvent($property)) { |
| 158 | 158 | $notification->setSubProperty($property, $value); |
| 159 | 159 | unset($context[$property]); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | $param = null; |
| 164 | - if($notification) { |
|
| 164 | + if ($notification) { |
|
| 165 | 165 | $param = [self::NOTIFICATION => $notification]; |
| 166 | 166 | } |
| 167 | 167 | if (empty($context)) { |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | $this->_parameter->setBytesTransferred($bytes_transferred); |
| 313 | 313 | $this->_parameter->setBytesMax($bytes_max); |
| 314 | 314 | } |
| 315 | - switch($notification_code) { |
|
| 315 | + switch ($notification_code) { |
|
| 316 | 316 | case STREAM_NOTIFY_RESOLVE: // value: 1 |
| 317 | 317 | $this->onResolve($this->_parameter); |
| 318 | 318 | break; |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | break; |
| 371 | 371 | } |
| 372 | 372 | if ($this->_callbacks && $this->_callbacks->getCount()) { |
| 373 | - foreach($this->_callbacks as $callback) { |
|
| 373 | + foreach ($this->_callbacks as $callback) { |
|
| 374 | 374 | $callback($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max); |
| 375 | 375 | } |
| 376 | 376 | } |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | if ($requestedUpgrade) { |
| 70 | 70 | $urlParams = array_merge(array_flip($requestedUpgrade), $urlParams); |
| 71 | 71 | $param->setParameter($urlParams); // Forward results |
| 72 | - return $urlParams; // return for use |
|
| 72 | + return $urlParams; // return for use |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -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 = ''; |