Exception marker interfaces shsould extend `Throwable`
Ocramius opened this issue · 2 comments
Ocramius commented
Following code is generally not valid from a static perspective (note: still works at runtime)
interface MyMarker
{
}
try {
} catch (MyMarker $e) {
}
The rationale is that the contract to be followed for a symbol to be used in a catch ()
is that it should implement Throwable
.
In practice, the idea is that the interface should be extending Throwable
:
interface MyMarker extends Throwable
{
}
This currently affects following:
version/src/exceptions/Exception.php
Lines 11 to 14 in 45a2ec5
sebastianbergmann commented
This can only be addressed after support for PHP 5.6 has been dropped (as there is no \Throwable
interface in PHP 5.6).
theseer commented
Looks like I implemented this without properly annotating it in the changelog.
It's part of 3.0.0.