@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | */ |
| 387 | 387 | protected function getTokenImageOptions() |
| 388 | 388 | { |
| 389 | - $privateKey = $this->getPrivateKey(); // call this method to ensure private key is generated |
|
| 389 | + $privateKey = $this->getPrivateKey(); // call this method to ensure private key is generated |
|
| 390 | 390 | $token = $this->getToken(); |
| 391 | 391 | $options = []; |
| 392 | 392 | $options['publicKey'] = $this->getPublicKey(); |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | $hexLength = strlen($hex); |
| 474 | 474 | $base = strlen($alphabet); |
| 475 | 475 | $result = ''; |
| 476 | - for ($i = 0;$i < $hexLength;$i += 6) { |
|
| 476 | + for ($i = 0; $i < $hexLength; $i += 6) { |
|
| 477 | 477 | $number = hexdec(substr($hex, $i, 6)); |
| 478 | 478 | while ($number) { |
| 479 | 479 | $result .= $alphabet[$number % $base]; |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $hexLength = strlen($hex); |
| 63 | 63 | $base = strlen($alphabet); |
| 64 | 64 | $result = ''; |
| 65 | - for ($i = 0;$i < $hexLength;$i += 6) { |
|
| 65 | + for ($i = 0; $i < $hexLength; $i += 6) { |
|
| 66 | 66 | $number = hexdec(substr($hex, $i, 6)); |
| 67 | 67 | while ($number) { |
| 68 | 68 | $result .= $alphabet[$number % $base]; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | $hasShadow = ($theme & THEME_SHADOWED_TEXT); |
| 109 | - for ($i = 0;$i < $length;$i++) { |
|
| 109 | + for ($i = 0; $i < $length; $i++) { |
|
| 110 | 110 | $color = imagecolorallocate($image, rand(150, 220), rand(150, 220), rand(150, 220)); |
| 111 | 111 | $size = rand($fontWidth - 10, $fontWidth); |
| 112 | 112 | $angle = rand(-30, 30); |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | function addNoise($image, $width, $height) |
| 161 | 161 | { |
| 162 | - for ($x = 0;$x < $width;++$x) { |
|
| 163 | - for ($y = 0;$y < $height;++$y) { |
|
| 162 | + for ($x = 0; $x < $width; ++$x) { |
|
| 163 | + for ($y = 0; $y < $height; ++$y) { |
|
| 164 | 164 | if (rand(0, 100) < 25) { |
| 165 | 165 | $color = imagecolorallocate($image, rand(150, 220), rand(150, 220), rand(150, 220)); |
| 166 | 166 | imagesetpixel($image, $x, $y, $color); |
@@ -172,13 +172,13 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | function addGrid($image, $width, $height) |
| 174 | 174 | { |
| 175 | - for ($i = 0;$i < $width;$i += rand(15, 25)) { |
|
| 175 | + for ($i = 0; $i < $width; $i += rand(15, 25)) { |
|
| 176 | 176 | imagesetthickness($image, rand(2, 6)); |
| 177 | 177 | $color = imagecolorallocate($image, rand(100, 180), rand(100, 180), rand(100, 180)); |
| 178 | 178 | imageline($image, $i + rand(-10, 20), 0, $i + rand(-10, 20), $height, $color); |
| 179 | 179 | imagecolordeallocate($image, $color); |
| 180 | 180 | } |
| 181 | - for ($i = 0;$i < $height;$i += rand(15, 25)) { |
|
| 181 | + for ($i = 0; $i < $height; $i += rand(15, 25)) { |
|
| 182 | 182 | imagesetthickness($image, rand(2, 6)); |
| 183 | 183 | $color = imagecolorallocate($image, rand(100, 180), rand(100, 180), rand(100, 180)); |
| 184 | 184 | imageline($image, 0, $i + rand(-10, 20), $width, $i + rand(-10, 20), $color); |
@@ -188,10 +188,10 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | function addScribble($image, $width, $height) |
| 190 | 190 | { |
| 191 | - for ($i = 0;$i < 8;$i++) { |
|
| 191 | + for ($i = 0; $i < 8; $i++) { |
|
| 192 | 192 | $color = imagecolorallocate($image, rand(100, 180), rand(100, 180), rand(100, 180)); |
| 193 | 193 | $points = []; |
| 194 | - for ($j = 1;$j < rand(5, 10);$j++) { |
|
| 194 | + for ($j = 1; $j < rand(5, 10); $j++) { |
|
| 195 | 195 | $points[] = rand(2 * (20 * ($i + 1)), 2 * (50 * ($i + 1))); |
| 196 | 196 | $points[] = rand(30, $height + 30); |
| 197 | 197 | } |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | { |
| 206 | 206 | $tempImage = imagecreatetruecolor($width, $height); |
| 207 | 207 | $chunk = rand(1, 5); |
| 208 | - for ($x = $y = 0;$x < $width;$x += $chunk) { |
|
| 208 | + for ($x = $y = 0; $x < $width; $x += $chunk) { |
|
| 209 | 209 | $chunk = rand(1, 5); |
| 210 | 210 | $y += rand(-1, 1); |
| 211 | 211 | if ($y >= $height) { |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | } |
| 217 | 217 | imagecopy($tempImage, $image, $x, 0, $x, $y, $chunk, $height); |
| 218 | 218 | } |
| 219 | - for ($x = $y = 0;$y < $height;$y += $chunk) { |
|
| 219 | + for ($x = $y = 0; $y < $height; $y += $chunk) { |
|
| 220 | 220 | $chunk = rand(1, 5); |
| 221 | 221 | $x += rand(-1, 1); |
| 222 | 222 | if ($x >= $width) { |
@@ -410,7 +410,7 @@ |
||
| 410 | 410 | public function onPreRender($param) |
| 411 | 411 | { |
| 412 | 412 | parent::onPreRender($param); |
| 413 | - $this->getActiveView(); // determine the active view |
|
| 413 | + $this->getActiveView(); // determine the active view |
|
| 414 | 414 | $this->registerStyleSheet(); |
| 415 | 415 | } |
| 416 | 416 | |
@@ -367,7 +367,7 @@ |
||
| 367 | 367 | $this->_repeatedControl->setValidationGroup($this->getValidationGroup()); |
| 368 | 368 | $page = $this->getPage(); |
| 369 | 369 | $n = $this->getItemCount(); |
| 370 | - for ($i = 0;$i < $n;++$i) { |
|
| 370 | + for ($i = 0; $i < $n; ++$i) { |
|
| 371 | 371 | $this->_repeatedControl->setID("c$i"); |
| 372 | 372 | $page->registerRequiresPostData($this->_repeatedControl); |
| 373 | 373 | } |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | $c = 0; |
| 477 | 477 | $this->_directive = null; |
| 478 | 478 | try { |
| 479 | - for ($i = 0;$i < $n;++$i) { |
|
| 479 | + for ($i = 0; $i < $n; ++$i) { |
|
| 480 | 480 | $match = &$matches[$i]; |
| 481 | 481 | $str = $match[0][0]; |
| 482 | 482 | $matchStart = $match[0][1]; |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | $pattern = '/([\w\.\-]+)\s*=\s*(\'.*?\'|".*?"|<%.*?%>)/msS'; |
| 705 | 705 | $attributes = []; |
| 706 | 706 | $n = preg_match_all($pattern, $str, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE); |
| 707 | - for ($i = 0;$i < $n;++$i) { |
|
| 707 | + for ($i = 0; $i < $n; ++$i) { |
|
| 708 | 708 | $match = &$matches[$i]; |
| 709 | 709 | $name = strtolower($match[1][0]); |
| 710 | 710 | if (isset($attributes[$name])) { |
@@ -745,7 +745,7 @@ discard block |
||
| 745 | 745 | $isDataBind = false; |
| 746 | 746 | $textStart = 0; |
| 747 | 747 | $expr = ''; |
| 748 | - for ($i = 0;$i < $n;++$i) { |
|
| 748 | + for ($i = 0; $i < $n; ++$i) { |
|
| 749 | 749 | $match = $matches[0][$i]; |
| 750 | 750 | $token = $match[0]; |
| 751 | 751 | $offset = $match[1]; |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | } |
| 812 | 812 | } else { |
| 813 | 813 | // a simple property |
| 814 | - if (! ($class->hasMethod('set' . $name) || $class->hasMethod('setjs' . $name) || $this->isClassBehaviorMethod($class, 'set' . $name))) { |
|
| 814 | + if (!($class->hasMethod('set' . $name) || $class->hasMethod('setjs' . $name) || $this->isClassBehaviorMethod($class, 'set' . $name))) { |
|
| 815 | 815 | if ($class->hasMethod('get' . $name) || $class->hasMethod('getjs' . $name)) { |
| 816 | 816 | throw new TConfigurationException('template_property_readonly', $type, $name); |
| 817 | 817 | } else { |
@@ -877,7 +877,7 @@ discard block |
||
| 877 | 877 | $srcFile = $this->_tplFile; |
| 878 | 878 | |
| 879 | 879 | if (($n = count($this->_includedFiles)) > 0) { // need to adjust error row number and file name |
| 880 | - for ($i = $n - 1;$i >= 0;--$i) { |
|
| 880 | + for ($i = $n - 1; $i >= 0; --$i) { |
|
| 881 | 881 | if ($this->_includeAtLine[$i] <= $line) { |
| 882 | 882 | if ($line < $this->_includeAtLine[$i] + $this->_includeLines[$i]) { |
| 883 | 883 | $line = $line - $this->_includeAtLine[$i] + 1; |
@@ -907,7 +907,7 @@ discard block |
||
| 907 | 907 | protected function preprocess($input) |
| 908 | 908 | { |
| 909 | 909 | if ($n = preg_match_all('/<%include(.*?)%>/', $input, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { |
| 910 | - for ($i = 0;$i < $n;++$i) { |
|
| 910 | + for ($i = 0; $i < $n; ++$i) { |
|
| 911 | 911 | $filePath = Prado::getPathOfNamespace(trim($matches[$i][1][0]), TTemplateManager::TEMPLATE_FILE_EXT); |
| 912 | 912 | if ($filePath !== null && is_file($filePath)) { |
| 913 | 913 | $this->_includedFiles[] = $filePath; |
@@ -917,7 +917,7 @@ discard block |
||
| 917 | 917 | } |
| 918 | 918 | } |
| 919 | 919 | $base = 0; |
| 920 | - for ($i = 0;$i < $n;++$i) { |
|
| 920 | + for ($i = 0; $i < $n; ++$i) { |
|
| 921 | 921 | $ext = file_get_contents($this->_includedFiles[$i]); |
| 922 | 922 | $length = strlen($matches[$i][0][0]); |
| 923 | 923 | $offset = $base + $matches[$i][0][1]; |
@@ -894,7 +894,7 @@ |
||
| 894 | 894 | } |
| 895 | 895 | } elseif ($control instanceof IPostBackEventHandler && |
| 896 | 896 | empty($this->_postData[self::FIELD_POSTBACK_TARGET])) { |
| 897 | - $this->_postData->add(self::FIELD_POSTBACK_TARGET, $key); // not calling setPostBackEventTarget() because the control may be removed later |
|
| 897 | + $this->_postData->add(self::FIELD_POSTBACK_TARGET, $key); // not calling setPostBackEventTarget() because the control may be removed later |
|
| 898 | 898 | } |
| 899 | 899 | unset($this->_controlsRequiringPostData[$key]); |
| 900 | 900 | } elseif ($beforeLoad) { |
@@ -542,7 +542,7 @@ |
||
| 542 | 542 | public function getStyleSheetUrls() |
| 543 | 543 | { |
| 544 | 544 | $stylesheets = array_values( |
| 545 | - array_map(function ($e) { |
|
| 545 | + array_map(function($e) { |
|
| 546 | 546 | return is_array($e) ? $e[0] : $e; |
| 547 | 547 | }, $this->_styleSheetFiles) |
| 548 | 548 | ); |