-
Notifications
You must be signed in to change notification settings - Fork 17
Type hinting incoherence for exceptions #22
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
Comments
Using |
lets change the typehint on the private field, to not lie. but lets also add a comment that according to the spec this must be a http exception. changing the add method would be a bc break, and if people use custom plugins they might deliberately violate the contract, so it seems to me there are use cases for it. want to do a PR @soullivaneuh ? |
@dbu In this case, why not trigger a deprecation error if the passed parameter is something else than a |
deprecation warning is a good idea, yes. |
On the
exceptions
property:mock-client/src/Client.php
Lines 42 to 45 in 7b47440
The type hinting corresponds to
Http\Client\Exception
But on the adder:
mock-client/src/Client.php
Lines 74 to 82 in 7b47440
It corresponds to
\Exception
.AFAIK, it makes no sense. Which one should be choose?
I may add a PR after getting #21 merged.
The text was updated successfully, but these errors were encountered: