Skip to content

Update ErrorHandler logger message (#130) #708

Update ErrorHandler logger message (#130)

Update ErrorHandler logger message (#130) #708

Triggered via push September 19, 2024 05:02
Status Success
Total duration 1m 31s
Artifacts

mutation.yml

on: push
Matrix: mutation / roave-infection
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
mutation / PHP 8.1-ubuntu-latest: src/ErrorHandler.php#L54
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 LoggerInterface $logger, private ThrowableRendererInterface $defaultRenderer, private ?EventDispatcherInterface $eventDispatcher = null, private int $exitShutdownHandlerDepth = 2) + public function __construct(private LoggerInterface $logger, private ThrowableRendererInterface $defaultRenderer, private ?EventDispatcherInterface $eventDispatcher = null, private int $exitShutdownHandlerDepth = 1) { } /**
mutation / PHP 8.1-ubuntu-latest: src/ErrorHandler.php#L54
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 LoggerInterface $logger, private ThrowableRendererInterface $defaultRenderer, private ?EventDispatcherInterface $eventDispatcher = null, private int $exitShutdownHandlerDepth = 2) + public function __construct(private LoggerInterface $logger, private ThrowableRendererInterface $defaultRenderer, private ?EventDispatcherInterface $eventDispatcher = null, private int $exitShutdownHandlerDepth = 3) { } /**
mutation / PHP 8.1-ubuntu-latest: src/ErrorHandler.php#L72
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#L72
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#L112
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#L112
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#L116
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#L119
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#L133
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#L135
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ } if (!(error_reporting() & $severity)) { // This error code is not included in error_reporting. - return true; + return false; } $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); throw new ErrorException($message, $severity, $severity, $file, $line, null, $backtrace);