| Total Complexity | 5 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class CouldNotSendNotification extends Exception |
||
| 9 | { |
||
| 10 | protected $interfaxMessage; |
||
| 11 | protected $responseAttributes; |
||
| 12 | |||
| 13 | 6 | final public function __construct(string $message, int $code, Exception $previous = null, InterfaxMessage $interfaxMessage, array $responseAttributes) |
|
| 14 | { |
||
| 15 | 6 | parent::__construct($message, $code, $previous); |
|
| 16 | |||
| 17 | 6 | $this->interfaxMessage = $interfaxMessage; |
|
| 18 | 6 | $this->responseAttributes = $responseAttributes; |
|
| 19 | } |
||
| 20 | |||
| 21 | 6 | public static function serviceRespondedWithAnError($message, $responseAttributes, string $exceptionMessage = 'The fax failed to send via InterFAX.') |
|
| 22 | { |
||
| 23 | 6 | return new static($exceptionMessage, $responseAttributes['status'], null, $message, $responseAttributes); |
|
| 24 | } |
||
| 25 | |||
| 26 | 1 | public function getUser() |
|
| 27 | { |
||
| 28 | 1 | return $this->interfaxMessage->user; |
|
| 29 | } |
||
| 30 | |||
| 31 | 1 | public function getMetadata() |
|
| 34 | } |
||
| 35 | |||
| 36 | 1 | public function getAttributes() |
|
| 39 | } |
||
| 40 | } |
||
| 41 |