| @@ 14-40 (lines=27) @@ | ||
| 11 | ||
| 12 | use Throwable; |
|
| 13 | ||
| 14 | class Error implements Result |
|
| 15 | { |
|
| 16 | private $conference; |
|
| 17 | ||
| 18 | private $throwable; |
|
| 19 | ||
| 20 | public function __construct(string $conference, Throwable $throwable) |
|
| 21 | { |
|
| 22 | $this->conference = $conference; |
|
| 23 | $this->throwable = $throwable; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function getMessage() : string |
|
| 27 | { |
|
| 28 | return $this->throwable->getMessage(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getThrowable() : Throwable |
|
| 32 | { |
|
| 33 | return $this->throwable; |
|
| 34 | } |
|
| 35 | ||
| 36 | public function getConference(): string |
|
| 37 | { |
|
| 38 | return $this->conference; |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 14-40 (lines=27) @@ | ||
| 11 | ||
| 12 | use Throwable; |
|
| 13 | ||
| 14 | class Failure implements Result |
|
| 15 | { |
|
| 16 | private $conference; |
|
| 17 | ||
| 18 | private $throwable; |
|
| 19 | ||
| 20 | public function __construct(string $conference, Throwable $throwable) |
|
| 21 | { |
|
| 22 | $this->conference = $conference; |
|
| 23 | $this->throwable = $throwable; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function getMessage() : string |
|
| 27 | { |
|
| 28 | return $this->throwable->getMessage(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function getThrowable() : Throwable |
|
| 32 | { |
|
| 33 | return $this->throwable; |
|
| 34 | } |
|
| 35 | ||
| 36 | public function getConference(): string |
|
| 37 | { |
|
| 38 | return $this->conference; |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||