mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Allow Throwable for $previous param
In current PHP versions the Exception-class seems to allow all Throwable values for its constructor's $previous param instead of only values of type Exception. Closes GH-442.
This commit is contained in:
parent
03841ffe37
commit
46efcedd4a
1 changed files with 2 additions and 2 deletions
|
@ -25,7 +25,7 @@ class Exception extends Throwable
|
|||
private $trace; // backtrace
|
||||
private $previous; // previous exception if nested exception
|
||||
|
||||
public function __construct($message = null, $code = 0, Exception $previous = null);
|
||||
public function __construct($message = null, $code = 0, Throwable $previous = null);
|
||||
|
||||
final private function __clone(); // Inhibits cloning of exceptions.
|
||||
|
||||
|
@ -71,7 +71,7 @@ class Exception extends Throwable
|
|||
class MyException extends Exception
|
||||
{
|
||||
// Redefine the exception so message isn't optional
|
||||
public function __construct($message, $code = 0, Exception $previous = null) {
|
||||
public function __construct($message, $code = 0, Throwable $previous = null) {
|
||||
// some code
|
||||
|
||||
// make sure everything is assigned properly
|
||||
|
|
Loading…
Reference in a new issue