|
@@ 23-30 (lines=8) @@
|
| 20 |
|
parent::__construct($message, $code, $previous); |
| 21 |
|
} |
| 22 |
|
|
| 23 |
|
public static function becauseOfError(int $responseCode, string $response, \Throwable $exception): self |
| 24 |
|
{ |
| 25 |
|
$self = new static('Request to OMS finished with error', 0, $exception); |
| 26 |
|
$self->response = $response; |
| 27 |
|
$self->responseCode = $responseCode; |
| 28 |
|
|
| 29 |
|
return $self; |
| 30 |
|
} |
| 31 |
|
|
| 32 |
|
public static function becauseResponseIsIncorrect(int $responseCode, string $response): self |
| 33 |
|
{ |
|
@@ 32-39 (lines=8) @@
|
| 29 |
|
return $self; |
| 30 |
|
} |
| 31 |
|
|
| 32 |
|
public static function becauseResponseIsIncorrect(int $responseCode, string $response): self |
| 33 |
|
{ |
| 34 |
|
$self = new static('Request to OMS is incorrect'); |
| 35 |
|
$self->response = $response; |
| 36 |
|
$self->responseCode = $responseCode; |
| 37 |
|
|
| 38 |
|
return $self; |
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
public function getResponse(): string |
| 42 |
|
{ |