phar-io/version

Exception marker interfaces shsould extend `Throwable`

Ocramius opened this issue · 2 comments

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:

namespace PharIo\Version;
interface Exception {
}

This can only be addressed after support for PHP 5.6 has been dropped (as there is no \Throwable interface in PHP 5.6).

Looks like I implemented this without properly annotating it in the changelog.

It's part of 3.0.0.