Minor refactor HtmlRenderer
#876
Annotations
11 warnings
|
mutation / PHP 8.1-ubuntu-latest
Node.js 20 actions are deprecated. The following actions are running on Node.js 20 and may not work as expected: actions/cache@v4. Actions will be forced to run with Node.js 24 by default starting June 2nd, 2026. Please check if updated versions of these actions are available that support Node.js 24. To opt into Node.js 24 now, set the FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true environment variable on the runner or in your workflow file. Once Node.js 24 becomes the default, you can temporarily opt out by setting ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
|
|
mutation / PHP 8.1-ubuntu-latest:
src/ErrorHandler.php#L139
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
// This error code is not included in error_reporting.
return true;
}
- $backtrace = debug_backtrace(0);
+ $backtrace = debug_backtrace(-1);
if (!isset($backtrace[0]['file'])) {
array_shift($backtrace);
}
|
|
mutation / PHP 8.1-ubuntu-latest:
src/ErrorHandler.php#L134
Escaped Mutant for Mutator "BitwiseAnd":
--- Original
+++ New
@@ @@
if (!$this->enabled) {
return false;
}
- if (!(error_reporting() & $severity)) {
+ if (!(error_reporting() | $severity)) {
// This error code is not included in error_reporting.
return true;
}
|
|
mutation / PHP 8.1-ubuntu-latest:
src/ErrorHandler.php#L120
Escaped Mutant for Mutator "FunctionCallRemoval":
--- Original
+++ New
@@ @@
$this->memoryReserve = str_repeat('x', $this->memoryReserveSize);
}
$this->initializeOnce();
- // Handles throwable that isn't caught otherwise, echo output and exit.
- set_exception_handler(function (Throwable $t) : void {
- if (!$this->enabled) {
- return;
- }
- $this->renderThrowableAndTerminate($t);
- });
+
// Handles PHP execution errors such as warnings and notices.
set_error_handler(function (int $severity, string $message, string $file, int $line) : bool {
if (!$this->enabled) {
|
|
mutation / PHP 8.1-ubuntu-latest:
src/ErrorHandler.php#L117
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
if ($this->memoryReserveSize > 0) {
$this->memoryReserve = str_repeat('x', $this->memoryReserveSize);
}
- $this->initializeOnce();
+
// Handles throwable that isn't caught otherwise, echo output and exit.
set_exception_handler(function (Throwable $t) : void {
if (!$this->enabled) {
|
|
mutation / PHP 8.1-ubuntu-latest:
src/ErrorHandler.php#L113
Escaped Mutant for Mutator "GreaterThanNegotiation":
--- Original
+++ New
@@ @@
if ($this->enabled) {
return;
}
- if ($this->memoryReserveSize > 0) {
+ if ($this->memoryReserveSize <= 0) {
$this->memoryReserve = str_repeat('x', $this->memoryReserveSize);
}
$this->initializeOnce();
|
|
mutation / PHP 8.1-ubuntu-latest:
src/ErrorHandler.php#L113
Escaped Mutant for Mutator "GreaterThan":
--- Original
+++ New
@@ @@
if ($this->enabled) {
return;
}
- if ($this->memoryReserveSize > 0) {
+ if ($this->memoryReserveSize >= 0) {
$this->memoryReserve = str_repeat('x', $this->memoryReserveSize);
}
$this->initializeOnce();
|
|
mutation / PHP 8.1-ubuntu-latest:
src/ErrorHandler.php#L73
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
{
$renderer ??= $this->defaultRenderer;
try {
- $this->logger->error($t->getMessage(), ['throwable' => $t]);
+
return $this->debug ? $renderer->renderVerbose($t, $request) : $renderer->render($t, $request);
} catch (Throwable $t) {
return new ErrorData((string) $t);
|
|
mutation / PHP 8.1-ubuntu-latest:
src/ErrorHandler.php#L73
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
{
$renderer ??= $this->defaultRenderer;
try {
- $this->logger->error($t->getMessage(), ['throwable' => $t]);
+ $this->logger->error($t->getMessage(), []);
return $this->debug ? $renderer->renderVerbose($t, $request) : $renderer->render($t, $request);
} catch (Throwable $t) {
return new ErrorData((string) $t);
|
|
mutation / PHP 8.1-ubuntu-latest:
src/ErrorHandler.php#L56
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
* @param EventDispatcherInterface|null $eventDispatcher Event dispatcher for error events.
* @param int $exitShutdownHandlerDepth Depth of the exit() shutdown handler to ensure it's executed last.
*/
- public function __construct(private readonly LoggerInterface $logger, private readonly ThrowableRendererInterface $defaultRenderer, private readonly ?EventDispatcherInterface $eventDispatcher = null, private readonly int $exitShutdownHandlerDepth = 2)
+ public function __construct(private readonly LoggerInterface $logger, private readonly ThrowableRendererInterface $defaultRenderer, private readonly ?EventDispatcherInterface $eventDispatcher = null, private readonly int $exitShutdownHandlerDepth = 3)
{
}
/**
|
|
mutation / PHP 8.1-ubuntu-latest:
src/ErrorHandler.php#L56
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
* @param EventDispatcherInterface|null $eventDispatcher Event dispatcher for error events.
* @param int $exitShutdownHandlerDepth Depth of the exit() shutdown handler to ensure it's executed last.
*/
- public function __construct(private readonly LoggerInterface $logger, private readonly ThrowableRendererInterface $defaultRenderer, private readonly ?EventDispatcherInterface $eventDispatcher = null, private readonly int $exitShutdownHandlerDepth = 2)
+ public function __construct(private readonly LoggerInterface $logger, private readonly ThrowableRendererInterface $defaultRenderer, private readonly ?EventDispatcherInterface $eventDispatcher = null, private readonly int $exitShutdownHandlerDepth = 1)
{
}
/**
|