Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Commit ea536fd

Browse files
author
Kirill Fuchs
committed
changed the way defaults are set
1 parent 1a155d9 commit ea536fd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: src/HttpException.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ class HttpException extends RuntimeException implements HttpExceptionInterface
7070
* @param string $userMessage
7171
* @param \Exception|null $previous
7272
*/
73-
public function __construct(int $statusCode = 500, string $error = 'internal_server_error', string $errorDescription = 'Internal Server Error', $errorData = [], string $userTitle = 'Ooops!!!', $userMessage = 'Seems one of our developers unplugged the server again!', array $httpHeaders = [], \Exception $previous = null)
73+
public function __construct(int $statusCode = null, string $error = null, string $errorDescription = null, $errorData = [], string $userTitle = null, $userMessage = null, array $httpHeaders = [], \Exception $previous = null)
7474
{
75-
$this->statusCode = $statusCode;
76-
$this->error = $error;
77-
$this->errorDescription = $errorDescription;
75+
$this->statusCode = $statusCode ?? 500;
76+
$this->error = $error ?? 'internal_server_error';
77+
$this->errorDescription = $errorDescription ?? 'Internal Server Error';
7878
$this->errorData = $errorData;
79-
$this->userTitle = $userTitle;
80-
$this->userMessage = $userMessage;
79+
$this->userTitle = $userTitle ?? 'Ooops!!!';
80+
$this->userMessage = $userMessage ?? 'Seems one of our developers unplugged the server again!';
8181
$this->httpHeaders = $httpHeaders;
8282

8383
$originalMessage = '';

0 commit comments

Comments
 (0)