@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | * @see Microtime::createFromString() |
| 115 | 115 | * @see Microtime::createNow() |
| 116 | 116 | */ |
| 117 | - public function __construct($datetime=self::DATETIME_NOW, ?DateTimeZone $timeZone=null) |
|
| 117 | + public function __construct($datetime = self::DATETIME_NOW, ?DateTimeZone $timeZone = null) |
|
| 118 | 118 | { |
| 119 | - if($datetime instanceof Microtime_ParseResult) |
|
| 119 | + if ($datetime instanceof Microtime_ParseResult) |
|
| 120 | 120 | { |
| 121 | 121 | $parsed = $datetime; |
| 122 | 122 | } |
@@ -148,9 +148,9 @@ discard block |
||
| 148 | 148 | * @return Microtime_ParseResult |
| 149 | 149 | * @throws Microtime_Exception |
| 150 | 150 | */ |
| 151 | - private function parseDate($datetime, ?DateTimeZone $timeZone=null) : Microtime_ParseResult |
|
| 151 | + private function parseDate($datetime, ?DateTimeZone $timeZone = null) : Microtime_ParseResult |
|
| 152 | 152 | { |
| 153 | - if($datetime instanceof Microtime) |
|
| 153 | + if ($datetime instanceof Microtime) |
|
| 154 | 154 | { |
| 155 | 155 | return new Microtime_ParseResult( |
| 156 | 156 | $datetime->getISODate(), |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | ); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - if($datetime instanceof DateTime) |
|
| 161 | + if ($datetime instanceof DateTime) |
|
| 162 | 162 | { |
| 163 | 163 | return new Microtime_ParseResult( |
| 164 | 164 | $datetime->format(self::FORMAT_ISO), |
@@ -166,17 +166,17 @@ discard block |
||
| 166 | 166 | ); |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - if($timeZone === null) |
|
| 169 | + if ($timeZone === null) |
|
| 170 | 170 | { |
| 171 | 171 | $timeZone = new DateTimeZone(date_default_timezone_get()); |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - if(empty($datetime) || $datetime === self::DATETIME_NOW) |
|
| 174 | + if (empty($datetime) || $datetime === self::DATETIME_NOW) |
|
| 175 | 175 | { |
| 176 | 176 | return self::parseNow($timeZone); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - if(is_string($datetime)) |
|
| 179 | + if (is_string($datetime)) |
|
| 180 | 180 | { |
| 181 | 181 | return new Microtime_ParseResult( |
| 182 | 182 | $datetime, |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | { |
| 204 | 204 | $dateObj = DateTime::createFromFormat('0.u00 U', microtime(), new DateTimeZone('America/Denver')); |
| 205 | 205 | |
| 206 | - if($dateObj !== false) |
|
| 206 | + if ($dateObj !== false) |
|
| 207 | 207 | { |
| 208 | 208 | $dateObj->setTimezone($timeZone); |
| 209 | 209 | |
@@ -227,9 +227,9 @@ discard block |
||
| 227 | 227 | * @return Microtime |
| 228 | 228 | * @throws Microtime_Exception |
| 229 | 229 | */ |
| 230 | - public static function createNow(?DateTimeZone $timeZone=null) : Microtime |
|
| 230 | + public static function createNow(?DateTimeZone $timeZone = null) : Microtime |
|
| 231 | 231 | { |
| 232 | - if($timeZone === null) |
|
| 232 | + if ($timeZone === null) |
|
| 233 | 233 | { |
| 234 | 234 | $timeZone = new DateTimeZone(date_default_timezone_get()); |
| 235 | 235 | } |
@@ -246,9 +246,9 @@ discard block |
||
| 246 | 246 | * @return Microtime |
| 247 | 247 | * @throws Microtime_Exception |
| 248 | 248 | */ |
| 249 | - public static function createFromString(string $date, ?DateTimeZone $timeZone=null) : Microtime |
|
| 249 | + public static function createFromString(string $date, ?DateTimeZone $timeZone = null) : Microtime |
|
| 250 | 250 | { |
| 251 | - if($timeZone === null) |
|
| 251 | + if ($timeZone === null) |
|
| 252 | 252 | { |
| 253 | 253 | $timeZone = new DateTimeZone(date_default_timezone_get()); |
| 254 | 254 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | protected function __construct($subject) |
| 81 | 81 | { |
| 82 | - if(is_array($subject)) |
|
| 82 | + if (is_array($subject)) |
|
| 83 | 83 | { |
| 84 | 84 | $this->parseSerialized($subject); |
| 85 | 85 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | public function getPrevious() : ConvertHelper_ThrowableInfo |
| 139 | 139 | { |
| 140 | - if(isset($this->previous)) { |
|
| 140 | + if (isset($this->previous)) { |
|
| 141 | 141 | return $this->previous; |
| 142 | 142 | } |
| 143 | 143 | |
@@ -162,18 +162,18 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | $string = 'Exception'; |
| 164 | 164 | |
| 165 | - if($this->hasCode()) { |
|
| 165 | + if ($this->hasCode()) { |
|
| 166 | 166 | $string .= ' #'.$this->code; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | $string .= ': '.$this->getMessage().PHP_EOL; |
| 170 | 170 | |
| 171 | - foreach($calls as $call) |
|
| 171 | + foreach ($calls as $call) |
|
| 172 | 172 | { |
| 173 | 173 | $string .= $call->toString().PHP_EOL; |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | - if($this->hasPrevious()) |
|
| 176 | + if ($this->hasPrevious()) |
|
| 177 | 177 | { |
| 178 | 178 | $string .= PHP_EOL.PHP_EOL. |
| 179 | 179 | 'Previous error:'.PHP_EOL.PHP_EOL. |
@@ -264,11 +264,11 @@ discard block |
||
| 264 | 264 | self::SERIALIZED_PREVIOUS => null, |
| 265 | 265 | ); |
| 266 | 266 | |
| 267 | - if($this->hasPrevious()) { |
|
| 268 | - $result[self::SERIALIZED_PREVIOUS] = $this->previous->serialize(); |
|
| 267 | + if ($this->hasPrevious()) { |
|
| 268 | + $result[self::SERIALIZED_PREVIOUS] = $this->previous->serialize(); |
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | - foreach($this->calls as $call) |
|
| 271 | + foreach ($this->calls as $call) |
|
| 272 | 272 | { |
| 273 | 273 | $result[self::SERIALIZED_CALLS][] = $call->serialize(); |
| 274 | 274 | } |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | public function getFolderDepth() : int |
| 298 | 298 | { |
| 299 | 299 | $depth = $this->getOption('folder-depth'); |
| 300 | - if(!empty($depth)) { |
|
| 300 | + if (!empty($depth)) { |
|
| 301 | 301 | return $depth; |
| 302 | 302 | } |
| 303 | 303 | |
@@ -353,12 +353,12 @@ discard block |
||
| 353 | 353 | |
| 354 | 354 | $this->setOptions($serialized[self::SERIALIZED_OPTIONS]); |
| 355 | 355 | |
| 356 | - if(!empty($serialized[self::SERIALIZED_PREVIOUS])) |
|
| 356 | + if (!empty($serialized[self::SERIALIZED_PREVIOUS])) |
|
| 357 | 357 | { |
| 358 | 358 | $this->previous = ConvertHelper_ThrowableInfo::fromSerialized($serialized[self::SERIALIZED_PREVIOUS]); |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | - foreach($serialized[self::SERIALIZED_CALLS] as $def) |
|
| 361 | + foreach ($serialized[self::SERIALIZED_CALLS] as $def) |
|
| 362 | 362 | { |
| 363 | 363 | $this->calls[] = ConvertHelper_ThrowableInfo_Call::fromSerialized($this, $def); |
| 364 | 364 | } |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | |
| 372 | 372 | $code = $e->getCode(); |
| 373 | 373 | |
| 374 | - if(is_integer($code)) |
|
| 374 | + if (is_integer($code)) |
|
| 375 | 375 | { |
| 376 | 376 | $this->code = $code; |
| 377 | 377 | } |
@@ -380,16 +380,16 @@ discard block |
||
| 380 | 380 | $this->message = 'Original error code: ['.$code.']. '; |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | - if(!isset($_REQUEST['REQUEST_URI'])) { |
|
| 383 | + if (!isset($_REQUEST['REQUEST_URI'])) { |
|
| 384 | 384 | $this->context = self::CONTEXT_COMMAND_LINE; |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | $previous = $e->getPrevious(); |
| 388 | - if(!empty($previous)) { |
|
| 388 | + if (!empty($previous)) { |
|
| 389 | 389 | $this->previous = ConvertHelper::throwable2info($previous); |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | - if(isset($_SERVER['REQUEST_URI'])) { |
|
| 392 | + if (isset($_SERVER['REQUEST_URI'])) { |
|
| 393 | 393 | $this->referer = $_SERVER['REQUEST_URI']; |
| 394 | 394 | } |
| 395 | 395 | |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | |
| 404 | 404 | $idx = 1; |
| 405 | 405 | |
| 406 | - foreach($trace as $entry) |
|
| 406 | + foreach ($trace as $entry) |
|
| 407 | 407 | { |
| 408 | 408 | $this->calls[] = ConvertHelper_ThrowableInfo_Call::fromTrace($this, $idx, $entry); |
| 409 | 409 | |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | * @return string |
| 439 | 439 | * @throws ConvertHelper_Exception |
| 440 | 440 | */ |
| 441 | - public function renderErrorMessage(bool $withDeveloperInfo=false) : string |
|
| 441 | + public function renderErrorMessage(bool $withDeveloperInfo = false) : string |
|
| 442 | 442 | { |
| 443 | 443 | $finalCall = $this->getFinalCall(); |
| 444 | 444 | |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | ->t('Message:') |
| 451 | 451 | ->add($this->getMessage()); |
| 452 | 452 | |
| 453 | - if($withDeveloperInfo) |
|
| 453 | + if ($withDeveloperInfo) |
|
| 454 | 454 | { |
| 455 | 455 | $message |
| 456 | 456 | ->eol() |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | ->add($finalCall->toString()); |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | - if($withDeveloperInfo && $this->hasDetails()) |
|
| 461 | + if ($withDeveloperInfo && $this->hasDetails()) |
|
| 462 | 462 | { |
| 463 | 463 | $message |
| 464 | 464 | ->t('Developer details:') |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | |
| 469 | 469 | $previous = $this->getPrevious(); |
| 470 | 470 | |
| 471 | - if($previous !== null) |
|
| 471 | + if ($previous !== null) |
|
| 472 | 472 | { |
| 473 | 473 | $message |
| 474 | 474 | ->eol() |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | |
| 484 | 484 | public function getDetails() : string |
| 485 | 485 | { |
| 486 | - if($this->exception instanceof BaseException) |
|
| 486 | + if ($this->exception instanceof BaseException) |
|
| 487 | 487 | { |
| 488 | 488 | return $this->exception->getDetails(); |
| 489 | 489 | } |
@@ -514,9 +514,9 @@ discard block |
||
| 514 | 514 | self::SERIALIZED_CALLS => 'array' |
| 515 | 515 | ); |
| 516 | 516 | |
| 517 | - foreach($keys as $key => $type) |
|
| 517 | + foreach ($keys as $key => $type) |
|
| 518 | 518 | { |
| 519 | - if(!isset($serialized[$key]) || gettype($serialized[$key]) !== $type) |
|
| 519 | + if (!isset($serialized[$key]) || gettype($serialized[$key]) !== $type) |
|
| 520 | 520 | { |
| 521 | 521 | throw $this->createTypeException($key, $type); |
| 522 | 522 | } |