Skip to content

Commit c263709

Browse files
Merge branch '4.4' into 5.0
* 4.4: [Validator] fix access to uninitialized property when getting value [HttpClient] Fix regex bearer [Translator] Default value for 'sort' option in translation:update should be 'asc' [HttpKernel] Fix stale-if-error behavior, add tests [Intl] Provide more locale translations [Mailer] Fix STARTTLS support for Postmark and Mandrill [Messenger] Check for all serialization exceptions during message dec… [Messenger] Fix bug when using single route with XML config Fix exception message in Doctrine Messenger [DI] CheckTypeDeclarationsPass now checks if value is type of parameter type [SecurityBundle] fix security.authentication.provider.ldap_bind arguments Improved error message when no supported user provider is found Mysqli doesn't support the named parameters used by PdoAdapter Added debug argument to decide if debug page should be shown or not Mysqli doesn't support the named parameters used by PdoStore Properly handle phpunit arguments for configuration file [Mailer] add tests for http transports
2 parents dd55651 + d272149 commit c263709

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Debug.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ public static function enable(): ErrorHandler
3131

3232
DebugClassLoader::enable();
3333

34-
return ErrorHandler::register(new ErrorHandler(new BufferingLogger()));
34+
return ErrorHandler::register(new ErrorHandler(new BufferingLogger(), true));
3535
}
3636
}

ErrorHandler.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class ErrorHandler
9292
private $screamedErrors = 0x55; // E_ERROR + E_CORE_ERROR + E_COMPILE_ERROR + E_PARSE
9393
private $loggedErrors = 0;
9494
private $traceReflector;
95+
private $debug;
9596

9697
private $isRecursive = 0;
9798
private $isRoot = false;
@@ -180,14 +181,15 @@ public static function call(callable $function, ...$arguments)
180181
}
181182
}
182183

183-
public function __construct(BufferingLogger $bootstrappingLogger = null)
184+
public function __construct(BufferingLogger $bootstrappingLogger = null, bool $debug = false)
184185
{
185186
if ($bootstrappingLogger) {
186187
$this->bootstrappingLogger = $bootstrappingLogger;
187188
$this->setDefaultLogger($bootstrappingLogger);
188189
}
189190
$this->traceReflector = new \ReflectionProperty('Exception', 'trace');
190191
$this->traceReflector->setAccessible(true);
192+
$this->debug = $debug;
191193
}
192194

193195
/**
@@ -697,7 +699,7 @@ public static function handleFatalError(array $error = null): void
697699
*/
698700
private function renderException(\Throwable $exception): void
699701
{
700-
$renderer = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? new CliErrorRenderer() : new HtmlErrorRenderer(0 !== $this->scopedErrors);
702+
$renderer = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? new CliErrorRenderer() : new HtmlErrorRenderer($this->debug);
701703

702704
$exception = $renderer->render($exception);
703705

0 commit comments

Comments
 (0)