Lines 0.00% 0 / 2
Functions and Methods 0.00% 0 / 2
Classes and Traits 0.00% 0 / 1
Name Lines Functions and Methods CRAP Classes and Traits
RecordedStateReader 0.00% 0 / 2 0.00% 0 / 2 6 0.00% 0 / 1
 __construct 0.00% 0 / 1 0.00% 0 / 1 2
 readCurrentStates 0.00% 0 / 1 0.00% 0 / 1 2
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Testing\HaContext;
6
7use Stewart\Contracts\Entity\EntityId;
8use Stewart\Contracts\Registry\EntityFilter;
9use Stewart\Contracts\Selector\Collection\SelectorCollection;
10use Stewart\Contracts\Selector\Selector;
11use Stewart\Contracts\State\Collection\EntityStateCollection;
12use Stewart\Support\State\CurrentStateReader;
13
14final readonly class RecordedStateReader implements CurrentStateReader
15{
16    public function __construct(
17        private RecordingHaContext $ha,
18        private string|EntityId|Selector|SelectorCollection|EntityFilter $selector,
19    ) {}
20
21    public function readCurrentStates(): EntityStateCollection
22    {
23        return $this->ha->listStates($this->selector);
24    }
25}