Passed
Push — master ( 4e3c19...6e35e1 )
by Fabio
06:44 queued 01:59
created
framework/Collections/TMap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
 		if ($value === null) {
83 83
 			return;
84 84
 		}
85
-		if($this->_r === null || Prado::isCallingSelf()) {
85
+		if ($this->_r === null || Prado::isCallingSelf()) {
86 86
 			$this->_r = TPropertyValue::ensureBoolean($value);
87 87
 		} else {
88 88
 			throw new TInvalidOperationException('map_readonly_set', $this::class);
Please login to merge, or discard this patch.
framework/Collections/TPriorityCollectionTrait.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		if ($value === $this->_dp) {
102 102
 			return;
103 103
 		}
104
-		if($this->_dp === null || Prado::isCallingSelf()) {
104
+		if ($this->_dp === null || Prado::isCallingSelf()) {
105 105
 			$this->_dp = (string) round(TPropertyValue::ensureFloat($value), $this->getPrecision());
106 106
 		} else {
107 107
 			throw new TInvalidOperationException('prioritytrait_no_set_default_priority');
@@ -130,13 +130,13 @@  discard block
 block discarded – undo
130 130
 		if ($value === $this->_p) {
131 131
 			return;
132 132
 		}
133
-		if($this->_p !== null && !Prado::isCallingSelf()) {
133
+		if ($this->_p !== null && !Prado::isCallingSelf()) {
134 134
 			throw new TInvalidOperationException('prioritytrait_no_set_precision');
135 135
 		}
136 136
 		$this->_p = TPropertyValue::ensureInteger($value);
137 137
 		$this->setDefaultPriority($this->_dp);
138 138
 		$_d = [];
139
-		foreach(array_keys($this->_d) as $priority) {
139
+		foreach (array_keys($this->_d) as $priority) {
140 140
 			$newPriority = $this->ensurePriority($priority);
141 141
 			if (array_key_exists($newPriority, $_d)) {
142 142
 				if ($this->getPriorityCombineStyle()) {
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 			}
283 283
 			$items[] = $itemsatpriority;
284 284
 		}
285
-		if(empty($items)) {
285
+		if (empty($items)) {
286 286
 			return [];
287 287
 		}
288 288
 		if ($this->getPriorityCombineStyle()) {
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 			}
310 310
 			$items[] = $itemsatpriority;
311 311
 		}
312
-		if(empty($items)) {
312
+		if (empty($items)) {
313 313
 			return [];
314 314
 		}
315 315
 		if ($this->getPriorityCombineStyle()) {
Please login to merge, or discard this patch.
framework/Collections/TList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
 		if ($value === null) {
90 90
 			return;
91 91
 		}
92
-		if($this->_r === null || Prado::isCallingSelf()) {
92
+		if ($this->_r === null || Prado::isCallingSelf()) {
93 93
 			$this->_r = TPropertyValue::ensureBoolean($value);
94 94
 		} else {
95 95
 			throw new TInvalidOperationException('list_readonly_set', $this::class);
Please login to merge, or discard this patch.
framework/Util/TBitHelper.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -65,18 +65,18 @@
 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;
Please login to merge, or discard this patch.
framework/Collections/TWeakCallableCollection.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
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
 			$this->_eventHandlerCount++;
142 142
 		}
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	 */
153 153
 	protected function weakCustomRemove(object $object)
154 154
 	{
155
-		if($object instanceof TEventHandler) {
155
+		if ($object instanceof TEventHandler) {
156 156
 			$object = $object->getHandlerObject();
157 157
 			$this->_eventHandlerCount--;
158 158
 		}
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 				$handler = null;
190 190
 			}
191 191
 		} elseif (is_object($handler)) {
192
-			if($handler instanceof WeakReference) {
192
+			if ($handler instanceof WeakReference) {
193 193
 				$handler = $handler->get();
194 194
 			} elseif (($handler instanceof TEventHandler) && !$handler->hasHandler()) {
195 195
 				$handler = null;
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 	 */
289 289
 	public function setDiscardInvalid($value): void
290 290
 	{
291
-		if($value === $this->_discardInvalid) {
291
+		if ($value === $this->_discardInvalid) {
292 292
 			return;
293 293
 		}
294 294
 		if ($this->_discardInvalid !== null && !Prado::isCallingSelf()) {
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 							$obj = $obj->getHandlerObject(true);
308 308
 						}
309 309
 						if ($obj instanceof WeakReference) {
310
-							if($obj = $obj->get()) {
310
+							if ($obj = $obj->get()) {
311 311
 								$this->weakAdd($obj);
312 312
 							} else {
313 313
 								parent::removeAtIndexInPriority($i, $priority);
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
 		$this->flattenPriorities();
661 661
 
662 662
 		if (($index = array_search($item, $this->_fd, true)) === false && $this->_eventHandlerCount) {
663
-			foreach($this->_fd as $index => $pItem) {
663
+			foreach ($this->_fd as $index => $pItem) {
664 664
 				if (($pItem instanceof TEventHandler) && $pItem->isSameHandler($item, true)) {
665 665
 					break;
666 666
 				}
@@ -712,8 +712,8 @@  discard block
 block discarded – undo
712 712
 		$absindex = 0;
713 713
 		foreach (array_keys($this->_d) as $priority) {
714 714
 			$index = false;
715
-			foreach($this->_d[$priority] as $index => $pItem) {
716
-				if(($pItem instanceof TEventHandler) && $pItem->isSameHandler($item, true)) {
715
+			foreach ($this->_d[$priority] as $index => $pItem) {
716
+				if (($pItem instanceof TEventHandler) && $pItem->isSameHandler($item, true)) {
717 717
 					break;
718 718
 				}
719 719
 				$index = false;
Please login to merge, or discard this patch.
framework/Collections/TWeakList.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 		}
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 				$this->filterItemForOutput($item[$key]);
157 157
 			}
158 158
 		} elseif (is_object($item)) {
159
-			if($item instanceof WeakReference) {
159
+			if ($item instanceof WeakReference) {
160 160
 				$item = $item->get();
161 161
 			} elseif (($item instanceof TEventHandler) && !$item->hasHandler()) {
162 162
 				$item = null;
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 				if ($isEventHandler = ($object instanceof TEventHandler)) {
198 198
 					$object = $object->getHandlerObject(true);
199 199
 				}
200
-				if(($object instanceof WeakReference) && $object->get() === null) {
200
+				if (($object instanceof WeakReference) && $object->get() === null) {
201 201
 					$this->_c--;
202 202
 					if ($i === $this->_c) {
203 203
 						array_pop($this->_d);
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 	 */
238 238
 	public function setDiscardInvalid($value): void
239 239
 	{
240
-		if($value === $this->_discardInvalid) {
240
+		if ($value === $this->_discardInvalid) {
241 241
 			return;
242 242
 		}
243 243
 		if ($this->_discardInvalid !== null && !Prado::isCallingSelf()) {
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 						$object = $object->get();
257 257
 					}
258 258
 					if ($object === null) {
259
-						$this->_c--;	//on read only, parent::removeAt won't remove for scrub.
259
+						$this->_c--; //on read only, parent::removeAt won't remove for scrub.
260 260
 						if ($i === $this->_c) {
261 261
 							array_pop($this->_d);
262 262
 						} else {
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 		$this->filterItemForInput($item);
436 436
 		if (($index = parent::indexOf($item)) === -1 && $this->_eventHandlerCount) {
437 437
 			$index = false;
438
-			foreach($this->_d as $index => $dItem) {
438
+			foreach ($this->_d as $index => $dItem) {
439 439
 				if (($dItem instanceof TEventHandler) && $dItem->isSameHandler($item, true)) {
440 440
 					break;
441 441
 				}
Please login to merge, or discard this patch.
framework/TComponent.php 1 patch
Spacing   +3 added lines, -3 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)) {
@@ -1396,7 +1396,7 @@  discard block
 block discarded – undo
1396 1396
 		$name = strtolower($name);
1397 1397
 		$responses = [];
1398 1398
 
1399
-		if($param instanceof IEventParameter) {
1399
+		if ($param instanceof IEventParameter) {
1400 1400
 			$param->setEventName($name);
1401 1401
 		}
1402 1402
 
@@ -1757,7 +1757,7 @@  discard block
 block discarded – undo
1757 1757
 		$behaviorObject->setName($name);
1758 1758
 		$isClassBehavior = $behaviorObject instanceof IClassBehavior;
1759 1759
 		unset(self::$_um[$class][$name]);
1760
-		if(empty(self::$_um[$class])) {
1760
+		if (empty(self::$_um[$class])) {
1761 1761
 			unset(self::$_um[$class]);
1762 1762
 		}
1763 1763
 		$results = $behaviorObject->raiseEvent('fxDetachClassBehavior', null, $param);
Please login to merge, or discard this patch.
framework/TEventHandler.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	 */
108 108
 	public function __construct(mixed $handler, mixed $data = null)
109 109
 	{
110
-		if(!is_callable($handler)) {
110
+		if (!is_callable($handler)) {
111 111
 			throw new TInvalidDataTypeException('eventhandler_not_callable');
112 112
 		}
113 113
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	 * @param bool $weak Return the handler with WeakReference instead of objects. Default false.
160 160
 	 * @return null|array|object|string The callable event handler.
161 161
 	 */
162
-	public function getHandler(bool $weak = false): null|string|object|array
162
+	public function getHandler(bool $weak = false): null | string | object | array
163 163
 	{
164 164
 		$handler = $this->_handler;
165 165
 		if (!$weak && $this->_weakObject) {
@@ -209,13 +209,13 @@  discard block
 block discarded – undo
209 209
 		$handler = null;
210 210
 		if (is_array($this->_handler) && is_object($this->_handler[0])) {
211 211
 			$handler = $this->_handler[0];
212
-		} elseif($this->_handler instanceof TEventHandler) {
212
+		} elseif ($this->_handler instanceof TEventHandler) {
213 213
 			return $this->_handler->getHandlerObject($weak);
214
-		} elseif(is_object($this->_handler)) {
214
+		} elseif (is_object($this->_handler)) {
215 215
 			$handler = $this->_handler;
216 216
 
217 217
 		}
218
-		if(!$weak && $this->_weakObject) {
218
+		if (!$weak && $this->_weakObject) {
219 219
 			$handler = $handler->get();
220 220
 		}
221 221
 		return $handler;
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	 */
229 229
 	public function hasHandler(): bool
230 230
 	{
231
-		if($this->_handler instanceof TEventHandler) {
231
+		if ($this->_handler instanceof TEventHandler) {
232 232
 			return $this->_handler->hasHandler();
233 233
 		}
234 234
 		return $this->getHandler() !== null;
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	 */
266 266
 	public function hasWeakObject(): bool
267 267
 	{
268
-		if($this->_handler instanceof TEventHandler) {
268
+		if ($this->_handler instanceof TEventHandler) {
269 269
 			return $this->_handler->hasWeakObject();
270 270
 		}
271 271
 		return $this->_weakObject;
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 			$offset = (int) $offset;
327 327
 			if ($offset === 2) {
328 328
 				return $this->_data;
329
-			} elseif(is_array($this->_handler)) {
329
+			} elseif (is_array($this->_handler)) {
330 330
 				if ($offset === 0) {
331 331
 					if ($this->_weakObject) {
332 332
 						return $this->_handler[$offset]->get();
Please login to merge, or discard this patch.
framework/Exceptions/TException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 		array_shift($args);
57 57
 		$n = count($args);
58 58
 		$previous = null;
59
-		if($n > 0 && ($args[$n - 1] instanceof Throwable)) {
59
+		if ($n > 0 && ($args[$n - 1] instanceof Throwable)) {
60 60
 			$previous = array_pop($args);
61 61
 			$n--;
62 62
 		}
Please login to merge, or discard this patch.