Settings   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 23
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace App\Infrastructure\Utility;
4
5
class Settings
6
{
7
    /** @var array<string, mixed> */
8
    private array $settings;
9
10
    /**
11
     * @param array<string, mixed> $settings
12
     */
13 14
    public function __construct(array $settings)
14
    {
15 14
        $this->settings = $settings;
16
    }
17
18
    /**
19
     * Get settings by key.
20
     *
21
     * @param string $key
22
     *
23
     * @return mixed
24
     */
25 14
    public function get(string $key): mixed
26
    {
27 14
        return $this->settings[$key] ?? null;
28
    }
29
}
30