Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add \Error stub #3002

Merged
merged 1 commit into from
Mar 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions src/Psalm/Internal/Stubs/CoreImmutableClasses.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -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(){}
}