DependencyInjection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 3 2
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\Module\monitor;
6
7
use function array_key_exists;
8
9
final class DependencyInjection
10
{
11
    /** @var array */
12
    private $vars;
13
14
15
    /**
16
     * @param array $vars
17
     */
18
    public function __construct(array $vars)
19
    {
20
        $this->vars = $vars;
21
    }
22
23
24
    /**
25
     * @param string $key
26
     *
27
     * @return mixed
28
     */
29
    public function get(string $key)
30
    {
31
        return array_key_exists($key, $this->vars) ? $this->vars[$key] : null;
32
    }
33
}
34