Lines
90.00%
9 / 10
Methods
75.00%
3 / 4
Classes
0.00%
0 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| type | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| describe | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| toMessage | 100.00% | 7 / 7 | 100.00% | 1 / 1 | 1 | ||
| 11 | final readonly class SubscribeComponentSession implements SubscriptionCommand | |
| 12 | { | |
| 13 | public function __construct(public ComponentSessionRequest $request) {} | |
| 14 | ||
| 15 | public function type(): string | |
| 16 | { | |
| 17 | return 'stewart/session/subscribe'; | |
| 18 | } | |
| 19 | ||
| 20 | public function describe(): string | |
| 21 | { | |
| 22 | return \sprintf('%s "%s"', $this->type(), $this->request->instance); | |
| 23 | } | |
| 24 | ||
| 25 | public function toMessage(): array | |
| 26 | { | |
| 27 | return [ | |
| 28 | 'type' => $this->type(), | |
| 29 | 'instance' => $this->request->instance->value, | |
| 30 | 'protocol' => ComponentProtocol::VERSION, | |
| 31 | 'stewart_version' => $this->request->stewartVersion, | |
| 32 | 'command_timeout' => $this->request->commandTimeout->toSeconds(), | |
| 33 | ]; | |
| 34 | } | |
| 35 | } |