Passed
Branch php-cs-fixer (b9836a)
by Fabio
15:02
created
framework/Web/UI/WebControls/THtmlArea4.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -394,9 +394,9 @@
 block discarded – undo
394 394
 			if(count($option) == 2)
395 395
 			{
396 396
 				$value = trim(trim($option[1]), "'\"");
397
-				if (($s = strtolower($value)) === 'false')
397
+				if(($s = strtolower($value)) === 'false')
398 398
 					$value = false;
399
-				elseif ($s === 'true')
399
+				elseif($s === 'true')
400 400
 					$value = true;
401 401
 				$options[trim($option[0])] = $value;
402 402
 			}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/THtmlArea.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -440,9 +440,9 @@
 block discarded – undo
440 440
 			if(count($option) == 2)
441 441
 			{
442 442
 				$value = trim(trim($option[1]), "'\"");
443
-				if (($s = strtolower($value)) === 'false')
443
+				if(($s = strtolower($value)) === 'false')
444 444
 					$value = false;
445
-				elseif ($s === 'true')
445
+				elseif($s === 'true')
446 446
 					$value = true;
447 447
 				$options[trim($option[0])] = $value;
448 448
 			}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTableStyle.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -58,17 +58,17 @@  discard block
 block discarded – undo
58 58
 	protected function _getZappableSleepProps(&$exprops)
59 59
 	{
60 60
 		parent::_getZappableSleepProps($exprops);
61
-		if ($this->_backImageUrl === null)
61
+		if($this->_backImageUrl === null)
62 62
 			$exprops[] = "\0Prado\Web\UI\WebControls\TTableStyle\0_backImageUrl";
63
-		if ($this->_horizontalAlign === null)
63
+		if($this->_horizontalAlign === null)
64 64
 			$exprops[] = "\0Prado\Web\UI\WebControls\TTableStyle\0_horizontalAlign";
65
-		if ($this->_cellPadding === null)
65
+		if($this->_cellPadding === null)
66 66
 			$exprops[] = "\0Prado\Web\UI\WebControls\TTableStyle\0_cellPadding";
67
-		if ($this->_cellSpacing === null)
67
+		if($this->_cellSpacing === null)
68 68
 			$exprops[] = "\0Prado\Web\UI\WebControls\TTableStyle\0_cellSpacing";
69
-		if ($this->_gridLines === null)
69
+		if($this->_gridLines === null)
70 70
 			$exprops[] = "\0Prado\Web\UI\WebControls\TTableStyle\0_gridLines";
71
-		if ($this->_borderCollapse === null)
71
+		if($this->_borderCollapse === null)
72 72
 			$exprops[] = "\0Prado\Web\UI\WebControls\TTableStyle\0_borderCollapse";
73 73
 	}
74 74
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 	 */
178 178
 	public function getBackImageUrl()
179 179
 	{
180
-		return $this->_backImageUrl === null?'':$this->_backImageUrl;
180
+		return $this->_backImageUrl === null ? '' : $this->_backImageUrl;
181 181
 	}
182 182
 
183 183
 	/**
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 	 */
195 195
 	public function getHorizontalAlign()
196 196
 	{
197
-		return $this->_horizontalAlign === null?THorizontalAlign::NotSet:$this->_horizontalAlign;
197
+		return $this->_horizontalAlign === null ?THorizontalAlign::NotSet : $this->_horizontalAlign;
198 198
 	}
199 199
 
200 200
 	/**
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 	 */
212 212
 	public function getCellPadding()
213 213
 	{
214
-		return $this->_cellPadding === null?-1:$this->_cellPadding;
214
+		return $this->_cellPadding === null ?-1 : $this->_cellPadding;
215 215
 	}
216 216
 
217 217
 	/**
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	 */
230 230
 	public function getCellSpacing()
231 231
 	{
232
-		return $this->_cellSpacing === null?-1:$this->_cellSpacing;
232
+		return $this->_cellSpacing === null ?-1 : $this->_cellSpacing;
233 233
 	}
234 234
 
235 235
 	/**
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 	 */
248 248
 	public function getGridLines()
249 249
 	{
250
-		return $this->_gridLines === null?TTableGridLines::None:$this->_gridLines;
250
+		return $this->_gridLines === null ?TTableGridLines::None : $this->_gridLines;
251 251
 	}
252 252
 
253 253
 	/**
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	 */
266 266
 	public function getBorderCollapse()
267 267
 	{
268
-		return $this->_borderCollapse === null?false:$this->_borderCollapse;
268
+		return $this->_borderCollapse === null ?false:$this->_borderCollapse;
269 269
 	}
270 270
 
271 271
 	/**
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TReCaptcha2.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
 		$captchas = $this->Page->findControlsByType('Prado\Web\UI\WebControls\TReCaptcha2');
112 112
 		$cont = 0;
113 113
 		$responseFieldName = self::ChallengeFieldName;
114
-		foreach ($captchas as $captcha)
114
+		foreach($captchas as $captcha)
115 115
 		{
116
-			if ($this->getClientID() == $captcha->ClientID)
116
+			if($this->getClientID() == $captcha->ClientID)
117 117
 			{
118 118
 				$responseFieldName .= ($cont > 0) ? '-' . $cont : '';
119 119
 			}
@@ -271,10 +271,10 @@  discard block
 block discarded – undo
271 271
 		$options['onCallback'] = $this->hasEventHandler('OnCallback');
272 272
 		$options['onCallbackExpired'] = $this->hasEventHandler('OnCallbackExpired');
273 273
 		$options['options']['sitekey'] = $this->getSiteKey();
274
-		if ($theme = $this->getTheme()) $options['options']['theme'] = $theme;
275
-		if ($type = $this->getType()) $options['options']['type'] = $type;
276
-		if ($size = $this->getSize()) $options['options']['size'] = $size;
277
-		if ($tabIndex = $this->getTabIndex()) $options['options']['tabindex'] = $tabIndex;
274
+		if($theme = $this->getTheme()) $options['options']['theme'] = $theme;
275
+		if($type = $this->getType()) $options['options']['type'] = $type;
276
+		if($size = $this->getSize()) $options['options']['size'] = $size;
277
+		if($tabIndex = $this->getTabIndex()) $options['options']['tabindex'] = $tabIndex;
278 278
 
279 279
 		return $options;
280 280
 	}
@@ -322,29 +322,29 @@  discard block
 block discarded – undo
322 322
 	public function raiseCallbackEvent($param)
323 323
 	{
324 324
 		$params = $param->getCallbackParameter();
325
-		if ($params instanceof stdClass)
325
+		if($params instanceof stdClass)
326 326
 		{
327 327
 			$callback = property_exists($params, 'onCallback');
328 328
 			$callbackExpired = property_exists($params, 'onCallbackExpired');
329 329
 
330
-			if ($callback)
330
+			if($callback)
331 331
 			{
332 332
 				$this->WidgetId = $params->widgetId;
333 333
 				$this->Response = $params->response;
334 334
 				$this->Page->CallbackClient->jQuery($params->responseField, 'text', [$params->response]);
335 335
 
336
-				if ($params->onCallback)
336
+				if($params->onCallback)
337 337
 				{
338 338
 					$this->onCallback($param);
339 339
 				}
340 340
 			}
341 341
 
342
-			if ($callbackExpired)
342
+			if($callbackExpired)
343 343
 			{
344 344
 				$this->Response = '';
345 345
 				$this->reset();
346 346
 
347
-				if ($params->onCallbackExpired)
347
+				if($params->onCallbackExpired)
348 348
 				{
349 349
 					$this->onCallbackExpired($param);
350 350
 				}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TReCaptcha2Validator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 	protected function getCaptchaControl()
45 45
 	{
46 46
 		$control = $this->getValidationTarget();
47
-		if (!$control)
47
+		if(!$control)
48 48
 			throw new Exception('No target control specified for TReCaptcha2Validator');
49
-		if (!($control instanceof TReCaptcha2))
49
+		if(!($control instanceof TReCaptcha2))
50 50
 			throw new Exception('TReCaptcha2Validator only works with TReCaptcha2 controls');
51 51
 		return $control;
52 52
 	}
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	protected function evaluateIsValid()
67 67
 	{
68 68
 		// check validity only once (if trying to evaulate multiple times, all redundant checks would fail)
69
-		if (null === $this->_isvalid)
69
+		if(null === $this->_isvalid)
70 70
 		{
71 71
 			$control = $this->getCaptchaControl();
72 72
 			$this->_isvalid = $control->validate();
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		$cs->registerHiddenField($this->getClientID() . '_1', $value);
86 86
 
87 87
 		// update validator display
88
-		if ($control = $this->getValidationTarget())
88
+		if($control = $this->getValidationTarget())
89 89
 		{
90 90
 			$fn = 'captchaUpdateValidatorStatus_' . $this->getClientID();
91 91
 
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/assets/captcha.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 			if(($randomSeed = $options['randomSeed']) > 0)
43 43
 				srand($randomSeed);
44 44
 			else
45
-				srand((int)(microtime() * 1000000));
45
+				srand((int) (microtime() * 1000000));
46 46
 			$token = generateToken($publicKey, $privateKey, $alphabet, $tokenLength, $caseSensitive);
47 47
 		}
48 48
 	}
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 function generateToken($publicKey, $privateKey, $alphabet, $tokenLength, $caseSensitive)
54 54
 {
55 55
 	$token = substr(hash2string(md5($publicKey . $privateKey), $alphabet) . hash2string(md5($privateKey . $publicKey), $alphabet), 0, $tokenLength);
56
-	return $caseSensitive?$token:strtoupper($token);
56
+	return $caseSensitive ? $token : strtoupper($token);
57 57
 }
58 58
 
59 59
 function hash2string($hex, $alphabet)
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	$hexLength = strlen($hex);
64 64
 	$base = strlen($alphabet);
65 65
 	$result = '';
66
-	for($i = 0;$i < $hexLength;$i += 6)
66
+	for($i = 0; $i < $hexLength; $i += 6)
67 67
 	{
68 68
 		$number = hexdec(substr($hex, $i, 6));
69 69
 		while($number)
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
 function displayToken($token, $fontSize, $theme)
79 79
 {
80
-	if(($fontSize = (int)$fontSize) < 22)
80
+	if(($fontSize = (int) $fontSize) < 22)
81 81
 		$fontSize = 22;
82 82
 	if($fontSize > 100)
83 83
 		$fontSize = 100;
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 		imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR);
105 105
 
106 106
 	$hasShadow = ($theme & THEME_SHADOWED_TEXT);
107
-	for($i = 0;$i < $length;$i++)
107
+	for($i = 0; $i < $length; $i++)
108 108
 	{
109 109
 		$color = imagecolorallocate($image, rand(150, 220), rand(150, 220), rand(150, 220));
110 110
 		$size = rand($fontWidth - 10, $fontWidth);
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
 
152 152
 function addNoise($image, $width, $height)
153 153
 {
154
-	for($x = 0;$x < $width;++$x)
154
+	for($x = 0; $x < $width; ++$x)
155 155
 	{
156
-		for($y = 0;$y < $height;++$y)
156
+		for($y = 0; $y < $height; ++$y)
157 157
 		{
158 158
 			if(rand(0, 100) < 25)
159 159
 			{
@@ -167,14 +167,14 @@  discard block
 block discarded – undo
167 167
 
168 168
 function addGrid($image, $width, $height)
169 169
 {
170
-	for($i = 0;$i < $width;$i += rand(15, 25))
170
+	for($i = 0; $i < $width; $i += rand(15, 25))
171 171
 	{
172 172
 		imagesetthickness($image, rand(2, 6));
173 173
 		$color = imagecolorallocate($image, rand(100, 180), rand(100, 180), rand(100, 180));
174 174
 		imageline($image, $i + rand(-10, 20), 0, $i + rand(-10, 20), $height, $color);
175 175
 		imagecolordeallocate($image, $color);
176 176
 	}
177
-	for($i = 0;$i < $height;$i += rand(15, 25))
177
+	for($i = 0; $i < $height; $i += rand(15, 25))
178 178
 	{
179 179
 		imagesetthickness($image, rand(2, 6));
180 180
 		$color = imagecolorallocate($image, rand(100, 180), rand(100, 180), rand(100, 180));
@@ -185,11 +185,11 @@  discard block
 block discarded – undo
185 185
 
186 186
 function addScribble($image, $width, $height)
187 187
 {
188
-	for($i = 0;$i < 8;$i++)
188
+	for($i = 0; $i < 8; $i++)
189 189
 	{
190 190
 		$color = imagecolorallocate($image, rand(100, 180), rand(100, 180), rand(100, 180));
191 191
 		$points = [];
192
-		for($j = 1;$j < rand(5, 10);$j++)
192
+		for($j = 1; $j < rand(5, 10); $j++)
193 193
 		{
194 194
 			$points[] = rand(2 * (20 * ($i + 1)), 2 * (50 * ($i + 1)));
195 195
 			$points[] = rand(30, $height + 30);
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 {
205 205
 	$tempImage = imagecreatetruecolor($width, $height);
206 206
 	$chunk = rand(1, 5);
207
-	for($x = $y = 0;$x < $width;$x += $chunk)
207
+	for($x = $y = 0; $x < $width; $x += $chunk)
208 208
 	{
209 209
 		$chunk = rand(1, 5);
210 210
 		$y += rand(-1, 1);
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 		if($y < 0) $y = 5;
213 213
 		imagecopy($tempImage, $image, $x, 0, $x, $y, $chunk, $height);
214 214
 	}
215
-	for($x = $y = 0;$y < $height;$y += $chunk)
215
+	for($x = $y = 0; $y < $height; $y += $chunk)
216 216
 	{
217 217
 		$chunk = rand(1, 5);
218 218
 		$x += rand(-1, 1);
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TFont.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
 	protected function _getZappableSleepProps(&$exprops)
67 67
 	{
68 68
 		parent::_getZappableSleepProps($exprops);
69
-		if ($this->_flags === 0)
69
+		if($this->_flags === 0)
70 70
 			$exprops[] = "\0Prado\Web\UI\WebControls\TFont\0_flags";
71
-		if ($this->_name === '')
71
+		if($this->_name === '')
72 72
 			$exprops[] = "\0Prado\Web\UI\WebControls\TFont\0_name";
73
-		if ($this->_size === '')
73
+		if($this->_size === '')
74 74
 			$exprops[] = "\0Prado\Web\UI\WebControls\TFont\0_size";
75 75
 	}
76 76
 
@@ -287,9 +287,9 @@  discard block
 block discarded – undo
287 287
 			return '';
288 288
 		$str = '';
289 289
 		if($this->_flags & self::IS_SET_BOLD)
290
-			$str .= 'font-weight:' . (($this->_flags & self::IS_BOLD)?'bold;':'normal;');
290
+			$str .= 'font-weight:' . (($this->_flags & self::IS_BOLD) ? 'bold;' : 'normal;');
291 291
 		if($this->_flags & self::IS_SET_ITALIC)
292
-			$str .= 'font-style:' . (($this->_flags & self::IS_ITALIC)?'italic;':'normal;');
292
+			$str .= 'font-style:' . (($this->_flags & self::IS_ITALIC) ? 'italic;' : 'normal;');
293 293
 		$textDec = '';
294 294
 		if($this->_flags & self::IS_UNDERLINE)
295 295
 			$textDec .= 'underline';
@@ -316,9 +316,9 @@  discard block
 block discarded – undo
316 316
 		if($this->_flags === 0)
317 317
 			return;
318 318
 		if($this->_flags & self::IS_SET_BOLD)
319
-			$writer->addStyleAttribute('font-weight', (($this->_flags & self::IS_BOLD)?'bold':'normal'));
319
+			$writer->addStyleAttribute('font-weight', (($this->_flags & self::IS_BOLD) ? 'bold' : 'normal'));
320 320
 		if($this->_flags & self::IS_SET_ITALIC)
321
-			$writer->addStyleAttribute('font-style', (($this->_flags & self::IS_ITALIC)?'italic':'normal'));
321
+			$writer->addStyleAttribute('font-style', (($this->_flags & self::IS_ITALIC) ? 'italic' : 'normal'));
322 322
 		$textDec = '';
323 323
 		if($this->_flags & self::IS_UNDERLINE)
324 324
 			$textDec .= 'underline';
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TAccordionView.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		{
146 146
 			$writer->addAttribute('id', $this->getClientID() . '_0');
147 147
 
148
-			$style = $this->getActive()?$this->getParent()->getActiveHeaderStyle():$this->getParent()->getHeaderStyle();
148
+			$style = $this->getActive() ? $this->getParent()->getActiveHeaderStyle() : $this->getParent()->getHeaderStyle();
149 149
 
150 150
 			$style->addAttributesToRender($writer);
151 151
 
@@ -168,10 +168,10 @@  discard block
 block discarded – undo
168 168
 		if(($caption = $this->getCaption()) === '')
169 169
 			$caption = '&nbsp;';
170 170
 
171
-		if ($url != '')
171
+		if($url != '')
172 172
 			$writer->write("<a href=\"{$url}\">");
173 173
 		$writer->write("{$caption}");
174
-		if ($url != '')
174
+		if($url != '')
175 175
 			$writer->write("</a>");
176 176
 	}
177 177
 }
Please login to merge, or discard this patch.
framework/Web/UI/TSessionPageStatePersister.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@
 block discarded – undo
99 99
 		$session = $this->_page->getSession();
100 100
 		$session->open();
101 101
 		$data = serialize($state);
102
-		$timestamp = (string)microtime(true);
102
+		$timestamp = (string) microtime(true);
103 103
 		$key = self::STATE_SESSION_KEY . $timestamp;
104 104
 		$session->add($key, $data);
105 105
 		if(($queue = $session->itemAt(self::QUEUE_SESSION_KEY)) === null)
Please login to merge, or discard this patch.