Probably for legacy reasons, PDOException::getCode() can return string (it's an
SQLSTATE code). Note that if you instantiate it yourself, you will get
an integer though.
I changed the signature of the Exception stub accordingly, and then
there were errors about incompatible signatures, so I had to change the
signature of Throwable too, which makes sense since a Throwable could be
a PDOException. The signature at
https://www.php.net/manual/en/throwable.getcode.php seems plain wrong,
and that same page of the docs warns about PDOException. Not sure what
are the plans for future versions of PHP.
* Write stub as valid PHP
This works probably because it is not parsed by PHP but by something
more tolerant, but let's make it more valid (the final access type in
the signature is not valid) PHP anyway, that will raise fewer eyebrows.
* Document actual return type
See ca006e54e3/Zend/zend_exceptions.stub.php (L8)
* Mark all methods from Throwable as mutation free
Exception is the only possible class implementation of Throwable, and
all of its methods except __toString() are final.
See ca006e54e3/Zend/zend_exceptions.stub.php (L3-L25)Closes#3170