Total Complexity | 5 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
10 | final class Request |
||
11 | { |
||
12 | 44 | public function __construct(private MessageInterface $message, private ?AdapterInterface $adapter) |
|
13 | { |
||
14 | 44 | } |
|
15 | |||
16 | 38 | public function getMessage(): MessageInterface |
|
17 | { |
||
18 | 38 | return $this->message; |
|
19 | } |
||
20 | |||
21 | 11 | public function getAdapter(): ?AdapterInterface |
|
22 | { |
||
23 | 11 | return $this->adapter; |
|
24 | } |
||
25 | |||
26 | 31 | public function withMessage(MessageInterface $message): self |
|
27 | { |
||
28 | 31 | $instance = clone $this; |
|
29 | 31 | $instance->message = $message; |
|
30 | |||
31 | 31 | return $instance; |
|
32 | } |
||
33 | |||
34 | 5 | public function withAdapter(AdapterInterface $adapter): self |
|
40 | } |
||
41 | } |
||
42 |