Passed
Push — master ( b2cf4a...c48dc4 )
by Samuel
02:01
created

Settings::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace App\Core\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 17
    public function __construct(array $settings)
14
    {
15 17
        $this->settings = $settings;
16
    }
17
18
    /**
19
     * Get settings by key.
20
     *
21
     * @param string $key
22
     *
23
     * @return mixed
24
     */
25 17
    public function get(string $key): mixed
26
    {
27 17
        return $this->settings[$key] ?? null;
28
    }
29
}
30