Closed ldesgrange closed 3 years ago
In RestTool.php there was the following code:
$error->Errors = property_exists($response, 'Errors') ? $response->Errors : property_exists($response, 'errors') ? $response->errors : null;
Which I think was wrong and has been automatically replaced by:
https://github.com/Mangopay/mangopay2-php-sdk/blob/d7538fe15150198261b0def8485cc352a6b5c096/MangoPay/Libraries/RestTool.php#L356-L358
See https://wiki.php.net/rfc/ternary_associativity, this makes it more explicit that the code was wrong as PHP had left-associative ternary operator (now deprecated).
The correct code should be:
$error->Errors = property_exists($response, 'Errors') ? $response->Errors : (property_exists($response, 'errors') ? $response->errors : null);
Thankfully MANGOPAY API seems to return errors (and not Errors) so this bug should not be triggered.
errors
Errors
Hello @ldesgrange We'll look into it, thanks
Thank @ldesgrange, it has been fixed.
If you have other feedback regarding this SDK, don't hesitate to book a slot in my agenda.
In RestTool.php there was the following code:
Which I think was wrong and has been automatically replaced by:
https://github.com/Mangopay/mangopay2-php-sdk/blob/d7538fe15150198261b0def8485cc352a6b5c096/MangoPay/Libraries/RestTool.php#L356-L358
See https://wiki.php.net/rfc/ternary_associativity, this makes it more explicit that the code was wrong as PHP had left-associative ternary operator (now deprecated).
The correct code should be:
Thankfully MANGOPAY API seems to return
errors
(and notErrors
) so this bug should not be triggered.