Completed
Push — master ( f2bd57...22a836 )
by Tim
01:36
created

DependencyInjection::get()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace \SimpleSAML\Module\monitor;
4
5
final class DependencyInjection
6
{
7
    /**
8
     * @var array
9
     */
10
    private $vars;
11
12
    /**
13
     * @param array $vars
14
     *
15
     * @return array
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
16
     */
17
    public function __construct($vars)
18
    {
19
        $this->vars = $vars;
20
        return $this;
0 ignored issues
show
Bug introduced by
Constructors do not have meaningful return values, anything that is returned from here is discarded. Are you sure this is correct?
Loading history...
21
    }
22
23
    public function get($key)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
24
    {
25
        return array_key_exists($key, $this->vars) ? $this->vars[$key] : null;
26
    }
27
}
28