/plugin/PBAPI/PBAPI/Exception/Response.php

https://bitbucket.org/chamilo/chamilo-ext-repo-photobucket-dev/ · PHP · 39 lines · 14 code · 2 blank · 23 comment · 0 complexity · 3e238b6a599a8e09846a7070ced7cc47 MD5 · raw file

  1. <?php
  2. /**
  3. * Photobucket API
  4. * Fluent interface for PHP5
  5. * Response exception
  6. *
  7. * @author Photobucket
  8. * @package PBAPI
  9. * @subpackage Exception
  10. *
  11. * @copyright Copyright (c) 2008, Photobucket, Inc.
  12. * @license http://www.opensource.org/licenses/mit-license.php The MIT License
  13. */
  14. /**
  15. * Response exceptions for the PBAPI
  16. *
  17. * @package PBAPI
  18. * @subpackage Exception
  19. */
  20. class PBAPI_Exception_Response extends PBAPI_Exception
  21. {
  22. /**
  23. * Response magic tostring
  24. *
  25. * @return string
  26. */
  27. public function __toString()
  28. {
  29. $str = __CLASS__ . ' (' . $this->getCode() . '): "' . $this->getMessage() . "\"\n" . 'Method: ' . implode(':', $this->getMethodStack()) . "\n" . 'Params: ';
  30. foreach ($this->getParams() as $k => $v)
  31. {
  32. $str .= "$k => $v, ";
  33. }
  34. return $str;
  35. }
  36. }