| @@ 17-67 (lines=51) @@ | ||
| 14 | /** |
|
| 15 | * @author Tobias Nyholm <[email protected]> |
|
| 16 | */ |
|
| 17 | final class DeleteResponse implements ApiResponse |
|
| 18 | { |
|
| 19 | /** |
|
| 20 | * @var string |
|
| 21 | */ |
|
| 22 | private $message; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @var string |
|
| 26 | */ |
|
| 27 | private $error; |
|
| 28 | ||
| 29 | /** |
|
| 30 | * @param string $message |
|
| 31 | * @param string $error |
|
| 32 | */ |
|
| 33 | private function __construct($message, $error) |
|
| 34 | { |
|
| 35 | $this->message = $message; |
|
| 36 | $this->error = $error; |
|
| 37 | } |
|
| 38 | ||
| 39 | /** |
|
| 40 | * @param array $data |
|
| 41 | * |
|
| 42 | * @return self |
|
| 43 | */ |
|
| 44 | public static function create(array $data) |
|
| 45 | { |
|
| 46 | return new self( |
|
| 47 | isset($data['message']) ? $data['message'] : null, |
|
| 48 | isset($data['error']) ? $data['error'] : null |
|
| 49 | ); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * @return string |
|
| 54 | */ |
|
| 55 | public function getMessage() |
|
| 56 | { |
|
| 57 | return $this->message; |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * @return string |
|
| 62 | */ |
|
| 63 | public function getError() |
|
| 64 | { |
|
| 65 | return $this->error; |
|
| 66 | } |
|
| 67 | } |
|
| 68 | ||
| @@ 12-61 (lines=50) @@ | ||
| 9 | ||
| 10 | namespace Mailgun\Model; |
|
| 11 | ||
| 12 | final class ErrorResponse implements ApiResponse |
|
| 13 | { |
|
| 14 | /** |
|
| 15 | * @var string |
|
| 16 | */ |
|
| 17 | private $message; |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @var string |
|
| 21 | */ |
|
| 22 | private $error; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @param string $error |
|
| 26 | */ |
|
| 27 | private function __construct($message, $error) |
|
| 28 | { |
|
| 29 | $this->message = $message; |
|
| 30 | $this->error = $error; |
|
| 31 | } |
|
| 32 | ||
| 33 | /** |
|
| 34 | * @param array |
|
| 35 | * |
|
| 36 | * @return self |
|
| 37 | */ |
|
| 38 | public static function create(array $data) |
|
| 39 | { |
|
| 40 | return new self( |
|
| 41 | isset($data['message']) ? $data['message'] : null, |
|
| 42 | isset($data['error']) ? $data['error'] : null |
|
| 43 | ); |
|
| 44 | } |
|
| 45 | ||
| 46 | /** |
|
| 47 | * @return string |
|
| 48 | */ |
|
| 49 | public function getMessage() |
|
| 50 | { |
|
| 51 | return $this->message; |
|
| 52 | } |
|
| 53 | ||
| 54 | /** |
|
| 55 | * @return string |
|
| 56 | */ |
|
| 57 | public function getError() |
|
| 58 | { |
|
| 59 | return $this->error; |
|
| 60 | } |
|
| 61 | } |
|
| 62 | ||
| @@ 17-67 (lines=51) @@ | ||
| 14 | /** |
|
| 15 | * @author David Garcia <[email protected]> |
|
| 16 | */ |
|
| 17 | final class DeleteResponse implements ApiResponse |
|
| 18 | { |
|
| 19 | /** |
|
| 20 | * @var string |
|
| 21 | */ |
|
| 22 | private $message; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @var string |
|
| 26 | */ |
|
| 27 | private $error; |
|
| 28 | ||
| 29 | /** |
|
| 30 | * @param array $data |
|
| 31 | * |
|
| 32 | * @return self |
|
| 33 | */ |
|
| 34 | public static function create(array $data) |
|
| 35 | { |
|
| 36 | return new self( |
|
| 37 | isset($data['message']) ? $data['message'] : null, |
|
| 38 | isset($data['error']) ? $data['error'] : null |
|
| 39 | ); |
|
| 40 | } |
|
| 41 | ||
| 42 | /** |
|
| 43 | * @param string $message |
|
| 44 | * @param string $error |
|
| 45 | */ |
|
| 46 | private function __construct($message, $error) |
|
| 47 | { |
|
| 48 | $this->message = $message; |
|
| 49 | $this->error = $error; |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * @return string |
|
| 54 | */ |
|
| 55 | public function getMessage() |
|
| 56 | { |
|
| 57 | return $this->message; |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * @return string |
|
| 62 | */ |
|
| 63 | public function getError() |
|
| 64 | { |
|
| 65 | return $this->error; |
|
| 66 | } |
|
| 67 | } |
|
| 68 | ||