| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 15 | public function __invoke(Envelope $envelope): bool |
|
| 30 | { |
||
| 31 | 15 | $request = $envelope->getRequest(); |
|
| 32 | 15 | $headerValue = $request->headers->get($this->getSelector()); |
|
| 33 | 15 | $headerValueIsValid = ($this->getValidator())($headerValue); |
|
| 34 | |||
| 35 | 15 | if (!$headerValueIsValid) { |
|
| 36 | 10 | $this->envelopeAddLogEntry( |
|
| 37 | 10 | $envelope, |
|
| 38 | 10 | "The value of header `{$this->getSelector()}`, `{$headerValue}`, is invalid" |
|
| 39 | 10 | ); |
|
| 40 | |||
| 41 | 10 | return true; |
|
| 42 | } |
||
| 43 | |||
| 44 | 5 | return false; |
|
| 45 | } |
||
| 57 |