Passed
Pull Request — master (#986)
by
unknown
05:20
created
framework/Exceptions/TException.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
framework/TApplicationComponent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
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) ?? [];
Please login to merge, or discard this patch.
framework/Security/Permissions/TPermissionsManagerPropertyTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
framework/Util/Helpers/TBitHelper.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -65,18 +65,18 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
framework/IO/TStreamNotificationCallback.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
framework/TComponent.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 		foreach ($classes as $class) {
514 514
 			if (isset(self::$_um[$class])) {
515 515
 				foreach (self::$_um[$class] as $name => $behavior) {
516
-					if(is_numeric($name)) {
516
+					if (is_numeric($name)) {
517 517
 						continue;
518 518
 					}
519 519
 					if (!array_key_exists($name, $classBehaviors)) {
@@ -1400,7 +1400,7 @@  discard block
 block discarded – undo
1400 1400
 		$name = strtolower($name);
1401 1401
 		$responses = [];
1402 1402
 
1403
-		if($param instanceof IEventParameter) {
1403
+		if ($param instanceof IEventParameter) {
1404 1404
 			$param->setEventName($name);
1405 1405
 		}
1406 1406
 
@@ -1764,7 +1764,7 @@  discard block
 block discarded – undo
1764 1764
 		$behaviorObject->setName($name);
1765 1765
 		$isClassBehavior = $behaviorObject instanceof IClassBehavior;
1766 1766
 		unset(self::$_um[$class][$name]);
1767
-		if(empty(self::$_um[$class])) {
1767
+		if (empty(self::$_um[$class])) {
1768 1768
 			unset(self::$_um[$class]);
1769 1769
 		}
1770 1770
 		$results = $behaviorObject->raiseEvent('fxDetachClassBehavior', null, $param);
@@ -1786,7 +1786,7 @@  discard block
 block discarded – undo
1786 1786
 			return $this->_m[$behaviorname];
1787 1787
 		}
1788 1788
 		if ((class_exists($behaviorname, false) || interface_exists($behaviorname, false)) && $this->_m) {
1789
-			foreach($this->_m->toArray() as $behavior) {
1789
+			foreach ($this->_m->toArray() as $behavior) {
1790 1790
 				if ($behavior instanceof $behaviorname) {
1791 1791
 					return $behavior;
1792 1792
 				}
Please login to merge, or discard this patch.
framework/Web/Behaviors/TRequestConnectionUpgrade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
framework/Web/THttpRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -825,7 +825,7 @@
 block discarded – undo
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)) {
Please login to merge, or discard this patch.
framework/Util/TDbLogRoute.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.