Lines 75.00% 3 / 4
Functions and Methods 75.00% 3 / 4
Classes and Traits 0.00% 0 / 1
Name Lines Functions and Methods CRAP Classes and Traits
UnsubscribeEvents 75.00% 3 / 4 75.00% 3 / 4 4.25 0.00% 0 / 1
 __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% 1 / 1 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Client\Connection\Command;
6
7final readonly class UnsubscribeEvents implements HaCommand
8{
9    public function __construct(public int $subscriptionId) {}
10
11    public function type(): string
12    {
13        return 'unsubscribe_events';
14    }
15
16    public function describe(): string
17    {
18        return \sprintf('unsubscribe_events %d', $this->subscriptionId);
19    }
20
21    public function toMessage(): array
22    {
23        return ['type' => $this->type(), 'subscription' => $this->subscriptionId];
24    }
25}