Lines 100.00% 9 / 9
Methods 100.00% 3 / 3
Classes 100.00% 1 / 1
Covered by tests of size
Name Lines Methods CRAP
 __construct 100.00% 7 / 7 100.00% 1 / 1 1
 getHosts 100.00% 1 / 1 100.00% 1 / 1 1
 getIndex 100.00% 1 / 1 100.00% 1 / 1 1
22readonly class OpenSearchConfiguration
23{
24    /** @var string[] */
25    private array $hosts;
26
27    private string $index;
28
29    public function __construct(string $filename)
30    {
31        $PMF_OS = [
32            'hosts' => [],
33            'index' => '',
34        ];
35
36        include $filename;
37
38        $this->hosts = $PMF_OS['hosts'];
39        $this->index = $PMF_OS['index'];
40    }
41
42    /**
43     * @return string[]
44     */
45    public function getHosts(): array
46    {
47        return $this->hosts;
48    }
49
50    public function getIndex(): string
51    {
52        return $this->index;
53    }
54}