-
Notifications
You must be signed in to change notification settings - Fork 50
TypeError: Argument 1 passed to ProfileClient::collectExceptionInformations() must be an instance of Exception #353
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
TypeError: Argument 1 passed to ProfileClient::collectExceptionInformations() must be an instance of Exception #353
Conversation
1274012
to
81c63ff
Compare
@Nyholm @fbourigault @dbu could you please approve/merge it? |
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 think this looks good.
* | ||
* @return string | ||
*/ | ||
public function formatException(Exception $exception) | ||
public function formatException(\Throwable $exception) |
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.
This is not a BC break because the class is internal.
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.
even more, Throwable is wide variation of Exception, so no BC break will happen
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.
Yes. But that reason alone is still a BC break because the class is not final.
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.
thank you!
@@ -34,7 +35,7 @@ class ProfileClientTest extends TestCase | |||
private $activeStack; | |||
|
|||
/** | |||
* @var HttpClient | |||
* @var HttpClient|MockObject |
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.
right.
just a comment, no need to change anything now: i have seen the syntax HttpClient&MockObject
which is semantically correct and needed from some phpstan level on so phpstan is sure about the type of the variable. however, e.g. phpstorm seems not to know about it...
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.
Yea, it's right, PhpStorm don't suggest any method of MockObject so I should to add this,
What's in this PR?
Fix error
Why?
Checklist
To Do