| Total Complexity | 5 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class ChangeAddressResponse { |
||
| 8 | |||
| 9 | private $errorMessages; |
||
| 10 | |||
| 11 | private function __construct( array $errorMessages = [] ) { |
||
| 12 | $this->errorMessages = $errorMessages; |
||
| 13 | } |
||
| 14 | |||
| 15 | public static function newErrorResponse( array $errorMessages ): self { |
||
| 16 | return new self( $errorMessages ); |
||
| 17 | } |
||
| 18 | |||
| 19 | public static function newSuccessResponse(): self { |
||
| 20 | return new self(); |
||
| 21 | } |
||
| 22 | |||
| 23 | public function isSuccess(): bool { |
||
| 24 | return count( $this->errorMessages ) === 0; |
||
| 25 | } |
||
| 26 | |||
| 27 | public function getErrors(): array { |
||
| 29 | } |
||
| 30 | |||
| 31 | } |