1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Add \Error stub (#3002)

Otherwise, errors are generated if \Error is extended: https://psalm.dev/r/8169465beb
This commit is contained in:
Niklas Keller 2020-03-22 00:11:23 +01:00 committed by GitHub
parent dd9924ea26
commit a7affbe716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,3 +77,57 @@ class Exception implements Throwable
*/
public final function getLine(){}
}
class Error implements Throwable
{
/**
* @var string
*/
protected $message = '';
/**
* @var int
*/
protected $code = 0;
/**
* @var string
*/
protected $file = '';
/**
* @var int
*/
protected $line = 0;
/**
* @psalm-external-mutation-free
* @param string $message
* @param int $code
* @param Throwable $previous
*/
public function __construct($message = "", $code = 0, Throwable $previous = null) {}
/**
* @psalm-mutation-free
*/
public final function getMessage() : string {}
/**
* @psalm-mutation-free
* @return int|string
*/
public final function getCode(){}
/**
* @psalm-mutation-free
* @return string
*/
public final function getFile(){}
/**
* @psalm-mutation-free
* @return int
*/
public final function getLine(){}
}