| Total Complexity | 4 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | final class Message implements MessageInterface |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | protected $body; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var ContainerInterface |
||
| 29 | */ |
||
| 30 | protected $metadata; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var callable |
||
| 34 | */ |
||
| 35 | protected $validator; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param string $body |
||
| 39 | * @param ContainerInterface $metadata |
||
| 40 | * @param callable $validator |
||
| 41 | */ |
||
| 42 | 23 | public function __construct($body, ContainerInterface $metadata, callable $validator) |
|
| 43 | { |
||
| 44 | 23 | $this->body = (string) $body; |
|
| 45 | 23 | $this->metadata = $metadata; |
|
| 46 | 23 | $this->validator = $validator; |
|
| 47 | 23 | } |
|
| 48 | |||
| 49 | /** |
||
| 50 | * @return string |
||
| 51 | */ |
||
| 52 | 7 | public function getBody() |
|
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return ContainerInterface |
||
| 59 | */ |
||
| 60 | 7 | public function getMetadata() |
|
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @return bool |
||
| 67 | */ |
||
| 68 | 11 | public function isValid() |
|
| 73 |