OAuthErrorObject.php 861 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Stripe;
  3. /**
  4. * Class OAuthErrorObject.
  5. *
  6. * @property string $error
  7. * @property string $error_description
  8. */
  9. class OAuthErrorObject extends StripeObject
  10. {
  11. /**
  12. * Refreshes this object using the provided values.
  13. *
  14. * @param array $values
  15. * @param null|array|string|Util\RequestOptions $opts
  16. * @param bool $partial defaults to false
  17. */
  18. public function refreshFrom($values, $opts, $partial = false)
  19. {
  20. // Unlike most other API resources, the API will omit attributes in
  21. // error objects when they have a null value. We manually set default
  22. // values here to facilitate generic error handling.
  23. $values = \array_merge([
  24. 'error' => null,
  25. 'error_description' => null,
  26. ], $values);
  27. parent::refreshFrom($values, $opts, $partial);
  28. }
  29. }