Lines 0.00% 0 / 6
Methods 0.00% 0 / 4
Classes 0.00% 0 / 1
Name Lines Methods CRAP
 __construct 0.00% 0 / 1 0.00% 0 / 1 2
 recordReceived 0.00% 0 / 2 0.00% 0 / 1 2
 recordHandled 0.00% 0 / 2 0.00% 0 / 1 2
 recordDropped 0.00% 0 / 1 0.00% 0 / 1 2
9final class SubscriptionActivity
10{
11    public private(set) int $received = 0;
12
13    public private(set) int $handled = 0;
14
15    public private(set) int $dropped = 0;
16
17    public private(set) ?Instant $lastReceivedAt = null;
18
19    public private(set) ?Instant $lastHandledAt = null;
20
21    public function __construct(public readonly RegisteredSubscription $subscription) {}
22
23    public function recordReceived(Instant $at): void
24    {
25        ++$this->received;
26        $this->lastReceivedAt = $at;
27    }
28
29    public function recordHandled(Instant $at): void
30    {
31        ++$this->handled;
32        $this->lastHandledAt = $at;
33    }
34
35    public function recordDropped(): void
36    {
37        ++$this->dropped;
38    }
39}