| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | 4 | public function decode(Message $message): Activity |
|
| 31 | { |
||
| 32 | 4 | if ((string) $message->mediaType() !== 'application/json') { |
|
| 33 | 2 | throw new UnknownMessage((string) $message->content()); |
|
| 34 | } |
||
| 35 | |||
| 36 | 2 | $content = Format::decode((string) $message->content()); |
|
| 37 | |||
| 38 | 2 | return new Activity( |
|
| 39 | 2 | Type::{$content['type']}(), |
|
| 40 | 2 | $content['data'] |
|
| 41 | ); |
||
| 44 |