-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Enforce Throwable rejection reason and require PHP 7+ as a consequence #138
Conversation
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.
Changes LGTM 👍 I'll await @jsor's review first, but I don't see any major blockers.
I wonder if it makes sense to add test cases for incorrect usage, i.e. how an automatic TypeError
for invalid arguments will bubble through common promise handlers etc.?
Makes sense, I'll add those 👍 |
@jsor now that everything must be a |
Not sure what you mean? |
If you look at this failed test cause for example, this exception shouldn't have been thrown not triggered as an error: https://travis-ci.org/reactphp/promise/jobs/523187495#L499 |
@WyriHaximus In #97, we intentionally switched from throwing exceptions to aborting with a fatal error. Exceptions should (and after that patch actually do) never bubble out of the promise chain. You need to use the |
@jsor ah awesome thanks 👍 |
Bump minimum required and tested PHP version to 7.0 as a result of requiring Throwables. Renamed the nesecary exceptions, methods and properties to match the new Throwable naming.
🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 |
…consequence With reactphp#138 requiring PHP 7.0 as a minimum we can now add return type hints to all our public and private functions. To give all functions return type hints we need the `void` return type, which isn't available until PHP 7.1. So in order use that we also have to bump the the minimum required PHP version for this package to PHP 7.1.
…consequence With reactphp#138 requiring PHP 7.0 as a minimum we can now add return type hints to all our public and private functions. To give all functions return type hints we need the `void` return type, which isn't available until PHP 7.1. So in order use that we also have to bump the the minimum required PHP version for this package to PHP 7.1. The benefit of return type hints is the ensurance at language level of our return values. For ourselfs and our consumers.
…consequence With reactphp#138 requiring PHP 7.0 as a minimum we can now add return type hints to all our public and private functions. To give all functions return type hints we need the `void` return type, which isn't available until PHP 7.1. So in order use that we also have to bump the the minimum required PHP version for this package to PHP 7.1. The benefit of return type hints is the assurance at language level of our return values. For ourself and our consumers.
By enforcing
Throwable
as a rejection reason:Throwable
andException
Exception
support (still supported throughThrowable
)