summaryrefslogtreecommitdiff
path: root/Zend/zend_exceptions.stub.php
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-10-15 14:30:23 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2019-10-15 16:21:00 +0200
commit273731fb762d661fb40015afd851ab340cf7a429 (patch)
treee3c8b6c81956c7739d7833566ccd0e23d110d984 /Zend/zend_exceptions.stub.php
parent5c24f8042d46f3dfbe8eb122a64792758fff5271 (diff)
downloadphp-git-273731fb762d661fb40015afd851ab340cf7a429.tar.gz
Add Zend class/interface arginfo stubs
We also change `Generator::throw()` to expect a `Throwable` in the first place, and we now throw a TypeError instead of returning `false` from `Exception::getTraceAsString()`.
Diffstat (limited to 'Zend/zend_exceptions.stub.php')
-rw-r--r--Zend/zend_exceptions.stub.php68
1 files changed, 68 insertions, 0 deletions
diff --git a/Zend/zend_exceptions.stub.php b/Zend/zend_exceptions.stub.php
new file mode 100644
index 0000000000..96d581caf9
--- /dev/null
+++ b/Zend/zend_exceptions.stub.php
@@ -0,0 +1,68 @@
+<?php
+
+interface Throwable
+{
+ /** @return string */
+ function getMessage();
+
+ /** @return int */
+ function getCode();
+
+ /** @return string */
+ function getFile();
+
+ /** @return int */
+ function getLine();
+
+ /** @return array */
+ function getTrace();
+
+ /** @return ?Throwable */
+ function getPrevious();
+
+ /** @return string */
+ function getTraceAsString();
+
+ /** @return string */
+ function __toString();
+}
+
+class Exception implements Throwable
+{
+ final private function __clone() {}
+
+ function __construct(string $message = UNKNOWN, int $code = 0, ?Throwable $previous = null) {}
+
+ function __wakeup() {}
+
+ /** @return string */
+ final function getMessage() {}
+
+ /** @return int */
+ final function getCode() {}
+
+ /** @return string */
+ final function getFile() {}
+
+ /** @return int */
+ final function getLine() {}
+
+ /** @return array */
+ final function getTrace() {}
+
+ /** @return ?Throwable */
+ final function getPrevious() {}
+
+ /** @return string */
+ final function getTraceAsString() {}
+
+ /** @return string */
+ function __toString() {}
+}
+
+class ErrorException extends Exception
+{
+ function __construct(string $message = UNKNOWN, int $code = 0, int $severity = E_ERROR, string $filename = UNKNOWN, int $lineno = 0, ?Throwable $previous = null) {}
+
+ final function getSeverity() {}
+}