-
Notifications
You must be signed in to change notification settings - Fork 49
Adding type-hints and extending Throwable for exception interfaces #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,6 @@ | |
| /** | ||
| * Base interface representing a generic exception in a container. | ||
| */ | ||
| interface ContainerExceptionInterface | ||
| interface ContainerExceptionInterface extends \Throwable | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change breaks a lot of symfony installations.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems fixed since PHP 7.4.0+ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're correct, but 7.3 it's not yet EOL. And thank you for the link, I wasn't aware of that change in 7.4. As a BC change I wonder why it wasn't shipped with 2.0.0.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly, we missed this; it's a language bug that we weren't expecting. We will probably reintroduce the change bumping the PHP requirement to 7.4, see #32 |
||
| { | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ interface ContainerInterface | |
| * | ||
| * @return mixed Entry. | ||
| */ | ||
| public function get($id); | ||
| public function get(string $id); | ||
|
|
||
| /** | ||
| * Returns true if the container can return an entry for the given identifier. | ||
|
|
@@ -33,5 +33,5 @@ public function get($id); | |
| * | ||
| * @return bool | ||
| */ | ||
| public function has($id); | ||
| public function has(string $id); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be possible to add public function has(string $id): bool;
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This question is addressed in the last paragraph :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah thanks :-) I think this is handled on the basis of the new PHP version 7.2 but ok. |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following this blog article, this change would mean a bump to 2.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it doesn't. This PR doesn't add return types so, by requiring PHP 7.2, it's allowing a smooth upgrade path and a minor version is ok. #28 is instead adding return types and hence requiring a major bump.
Vote is already in progress for the approval of these two new versions, and it looks like it's passing: https://groups.google.com/g/php-fig/c/niYwPGatoz4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not arguing with that. It's just not what has been announced in the blog article I've linked. If your processed has changed since then, that article should probably be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A newer blog post was published the month after: https://www.php-fig.org/blog/2019/12/new-bylaw-and-next-election-cycle/
And it's referring to the approval of a PHP-FIG bylaw that these PR are following: https://www.php-fig.org/bylaws/psr-evolution/