-
-
Notifications
You must be signed in to change notification settings - Fork 597
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
fixed php warning in GithubExceptionThrower #992
Conversation
fixes ``` Warning: Illegal string offset 'code' in GithubExceptionThrower.php on line 59 ``` when deleting a deployment which is not yet set to inactive
@@ -59,7 +59,12 @@ public function doHandleRequest(RequestInterface $request, callable $next, calla | |||
if (422 === $response->getStatusCode() && isset($content['errors'])) { | |||
$errors = []; | |||
foreach ($content['errors'] as $error) { | |||
switch ($error['code']) { | |||
$code = null; |
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.
when no $error['code']
was contained, the logic in the default-case of the switch statement worked for me.
this PR is just about removing the php warning which was emitted.
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.
Can you also add a testcase with the specific error response github is returning for this call? So we don't have any regressions in the future. Thanks!
Co-authored-by: Jeroen Thora <jeroenthora@gmail.com>
I verified the unit test fails without the patch:
|
Thank you @clxmstaab |
* 2.x: bug #992 fixed php warning in GithubExceptionThrower (clxmstaab, acrobat) phpdoc: fix typo Update changelog for 2.19.2 release
fixes
when deleting a deployment which is not yet set to inactive, see #991
I guess the warning beeing fixed is not explicitly related to the new endpoint added in #991 but I experienced it in this case.