Make ContainerExceptionInterface extend Throwable where it is available#23
Make ContainerExceptionInterface extend Throwable where it is available#23ErikBooij wants to merge 1 commit intophp-fig:masterfrom ErikBooij:master
Conversation
|
👍 I've faced the same problem. Is it a BC break to extend |
|
Current minimum compatibility constraint is "require": {
"php": ">=5.3.0"
}
|
|
OK I see, tagging a release that targets 7.0 wouldn't really be a BC break though since Composer will not install the new release unless you run PHP 7. |
|
Agreed, and I'm not aware of the FIG's BC policy, but to me it seems unnecessary to limit BC to PHP 7+ going forward, while with this solution, we can still maintain compatibility with 5.3+. Although I also don't see many changes/upgrades coming to this package in the future, since I guess it does what it's supposed to ;-) If it's preferred to just extend |
|
You're right, this solution works fine! I'm 👍 with both solution. Does anyone know what is needed to merge this? |
|
We've been discussing this kind of issues a lot lately, and we've condensed our proposed solution to updating PSR interfaces in a blog post. Please read it and provide your feedback! https://www.php-fig.org/blog/2019/10/upgrading-psr-interfaces/ |
|
@Jean85 I've read the post and it makes total sense, I've filled in the feedback form. At the same time, to be honest, I don't think it really applies to this PR, as this has specifically been created to not be a BC break, therefore I'd still love to just get this merged and released as 1.0.1 |
|
Hey, I'm in the process of adapting more PSR interfaces in Nextcloud and I came across this missing base class as I added the |
|
This could made even 1.1, and with no ping @weierophinney |
|
@Jean85 Would this require an errata vote? |
|
I hope not ^^ |
|
@weierophinney IMHO it could be bundled up with everything else in the 1.1-2.0 evolution vote. As far as I'm concerned, this interface only enforces at the code level what the spec requires. |
I've run into some static analysis issues because the
ContainerExceptionInterfaceprovides no guarantee that it's actually throwable (or catchable more specifically).I understand making it extend
Throwablewould break BC, so I think this would be the ideal middle ground, providing the benefit of stricter typing only where it's available.