Skip to content

Commit

Permalink
Fix CI reports
Browse files Browse the repository at this point in the history
  • Loading branch information
Quetzacoalt91 committed Jul 8, 2024
1 parent b1a3c11 commit 6556060
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 9 additions & 1 deletion classes/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function exceptionHandler(Throwable $e): void
{
$message = get_class($e) . ': ' . $e->getMessage();
$this->report($e->getFile(), $e->getLine(), Logger::CRITICAL, $message, $e->getTraceAsString(), true);
exit(64);
$this->terminate(64);
}

/**
Expand Down Expand Up @@ -159,4 +159,12 @@ protected function report(string $file, int $line, int $type, string $message, s
fclose($fd);
}
}

/**
* @return never
*/
public function terminate(int $code)
{
exit($code);
}
}
1 change: 1 addition & 0 deletions classes/Exceptions/UpgradeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function getQuickInfos(): array
$this->quickInfos
);
}

return $this->quickInfos;
}

Expand Down
5 changes: 4 additions & 1 deletion tests/unit/ErrorHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ protected function setUp()
{
parent::setUp();
$this->logger = new LegacyLogger();
$this->errorHandler = new ErrorHandler($this->logger);
$this->errorHandler = $this->getMockBuilder(ErrorHandler::class)
->setConstructorArgs([$this->logger])
->setMethods(['terminate'])
->getMock();
}

public function testDefaultContentIsEmpty()
Expand Down

0 comments on commit 6556060

Please sign in to comment.