@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function __construct($errorCode, $errorMessage = null, ...$args) |
| 73 | 73 | { |
| 74 | - if(!is_int($errorCode)) { |
|
| 74 | + if (!is_int($errorCode)) { |
|
| 75 | 75 | //assume old code |
| 76 | 76 | if ($errorMessage !== null || !empty($args)) { |
| 77 | 77 | array_unshift($args, $errorMessage); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $errorMessage = $this->translateErrorMessage($errorMessage); |
| 84 | 84 | $n = count($args); |
| 85 | 85 | $previous = null; |
| 86 | - if($n > 0 && ($args[$n - 1] instanceof Throwable)) { |
|
| 86 | + if ($n > 0 && ($args[$n - 1] instanceof Throwable)) { |
|
| 87 | 87 | $previous = array_pop($args); |
| 88 | 88 | $n--; |
| 89 | 89 | } |
@@ -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)) { |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $command->bindValue(':category', $log[TLogger::LOG_CATEGORY]); |
| 127 | 127 | $command->bindValue(':prefix', $this->getLogPrefix($log)); |
| 128 | 128 | $command->bindValue(':logtime', sprintf('%F', $log[TLogger::LOG_TIME])); |
| 129 | - if(!$command->execute()) { |
|
| 129 | + if (!$command->execute()) { |
|
| 130 | 130 | throw new TLogException('dblogroute_insert_failed', $this->_logTable); |
| 131 | 131 | } |
| 132 | 132 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | * @return string The where clause for the various SQL statements. |
| 147 | 147 | * @since 4.2.3 |
| 148 | 148 | */ |
| 149 | - protected function getLogWhere(?int $level, null|string|array $categories, ?float $minTime, ?float $maxTime, &$values): string |
|
| 149 | + protected function getLogWhere(?int $level, null | string | array $categories, ?float $minTime, ?float $maxTime, &$values): string |
|
| 150 | 150 | { |
| 151 | 151 | $where = ''; |
| 152 | 152 | $values = []; |
@@ -155,12 +155,12 @@ discard block |
||
| 155 | 155 | $values[':level'] = $level; |
| 156 | 156 | } |
| 157 | 157 | if ($categories !== null) { |
| 158 | - if(is_string($categories)) { |
|
| 158 | + if (is_string($categories)) { |
|
| 159 | 159 | $categories = array_map('trim', explode(',', $categories)); |
| 160 | 160 | } |
| 161 | 161 | $i = 0; |
| 162 | 162 | $or = ''; |
| 163 | - foreach($categories as $category) { |
|
| 163 | + foreach ($categories as $category) { |
|
| 164 | 164 | $c = $category[0] ?? 0; |
| 165 | 165 | if ($c === '!' || $c === '~') { |
| 166 | 166 | if ($where) { |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | * @return string The where clause for the various SQL statements.. |
| 215 | 215 | * @since 4.2.3 |
| 216 | 216 | */ |
| 217 | - public function getDBLogCount(?int $level = null, null|string|array $categories = null, ?float $minTime = null, ?float $maxTime = null) |
|
| 217 | + public function getDBLogCount(?int $level = null, null | string | array $categories = null, ?float $minTime = null, ?float $maxTime = null) |
|
| 218 | 218 | { |
| 219 | 219 | $values = []; |
| 220 | 220 | $where = $this->getLogWhere($level, $categories, $minTime, $maxTime, $values); |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | * @return \Prado\Data\TDbDataReader the logs from the database. |
| 239 | 239 | * @since 4.2.3 |
| 240 | 240 | */ |
| 241 | - public function getDBLogs(?int $level = null, null|string|array $categories = null, ?float $minTime = null, ?float $maxTime = null, string $order = '', string $limit = '') |
|
| 241 | + public function getDBLogs(?int $level = null, null | string | array $categories = null, ?float $minTime = null, ?float $maxTime = null, string $order = '', string $limit = '') |
|
| 242 | 242 | { |
| 243 | 243 | $values = []; |
| 244 | 244 | if ($order) { |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | * @return int the number of logs in the database. |
| 267 | 267 | * @since 4.2.3 |
| 268 | 268 | */ |
| 269 | - public function deleteDBLog(?int $level = null, null|string|array $categories = null, ?float $minTime = null, ?float $maxTime = null) |
|
| 269 | + public function deleteDBLog(?int $level = null, null | string | array $categories = null, ?float $minTime = null, ?float $maxTime = null) |
|
| 270 | 270 | { |
| 271 | 271 | $values = []; |
| 272 | 272 | $where = $this->getLogWhere($level, $categories, $minTime, $maxTime, $values); |
@@ -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; |