-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update docblock for APIException class' constructor function to include correct params and param types #1
Comments
Hey @sampurcell sorry for the delayed response! I'll take a look at this shortly. |
Hey @sampurcell How's it going? Just following up here - Can you provide a bit more context around the error you're seeing and what you're hoping to do. Let me know if this is blocking you in anyway. |
Hi, no problem. It is not blocking and not really an error, just a warning in my IDE. Here are some more details: When I mock an APIException, I get a warning that looks this this: Also in the APIException class I also see this warning: The reason it gives this warning seems to be because the docblock for APIException defines the params as a However if you look at the APIException constructor, you'll see it actually wants a So it thinks the second parameter is an int instead of an HttpContext instance and gives the warnings seen in the screenshots above. To fix, I think you just need to add:
In the APIException constructor docblock with: Should quiet the warnings when creating instances of the class in the IDE. |
Hey @sampurcell this is great! Thanks very much for all the details. I'll pass this on to the team and get you an update :) |
* Added feature flags * added circle config
[Feature] Added feature flags (#1) * Added feature flags * added circle config Fixed description fixed circle yml file added status badge and updated circle to have names for commands fixed indenting updated composer.json file renamed getting started file small doc change (#2) * small doc change * removed print log and added comment for method
[Feature] Added feature flags (#1) * Added feature flags * added circle config Fixed description fixed circle yml file added status badge and updated circle to have names for commands fixed indenting updated composer.json file renamed getting started file small doc change (#2) * small doc change * removed print log and added comment for method
* Added feature flags [Feature] Added feature flags (#1) * Added feature flags * added circle config Fixed description fixed circle yml file added status badge and updated circle to have names for commands fixed indenting updated composer.json file renamed getting started file small doc change (#2) * small doc change * removed print log and added comment for method * added some clarity for format of event body
@VicV came across a minor issue in the SDK, its throwing an error in our IDE, when you have the time would appreciate an update. Thanks!
Description
The
APIException::_construct
method parameters arestring $reason
andTaplyticsLib\Http\HttpContext $context
however the docblock refers to anint $responseCode
andstring $responseBody
instead which raises a warning in the IDE when mocking the object for tests, etc.Link to the docblock: APIException.php#L31-L33
The text was updated successfully, but these errors were encountered: