Skip to content

Commit

Permalink
TimeoutException: fix defaults to avoid notices
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Gelf committed Dec 3, 2021
1 parent 52ba97d commit d4a0b8c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/TimeoutException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ class TimeoutException extends RuntimeException

public function __construct($timeout, $message = null, $code = null, $previous = null)
{
// Preserve compatibility with our former signature, but avoid invalid arguments for the parent constructor:
if ($message === null) {
$message = '';
}
if ($code === null) {
$code = 0;
}
parent::__construct($message, $code, $previous);

$this->timeout = $timeout;
Expand Down

0 comments on commit d4a0b8c

Please sign in to comment.