Completed
Push — master ( c88b01...7482e8 )
by Tim
01:48
created

DependencyInjectionFactory::__construct()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 6
nc 3
nop 1
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace \SimpleSAML\Module\monitor;
4
5
abstract class DependencyInjectionFactory
6
{
7
    /**
8
     * @param array $vars
9
     *
10
     * @return Request
11
     */
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...
12
13
    public function __construct($vars)
14
    {
15
        $objectVars = get_object_vars($this);
16
        foreach ($vars as $property => $value)
17
        {
18
            if (array_key_exists($property, $objectVars)) {
19
                $this->$property = $value;
20
            }
21
        }
22
        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...
23
    }
24
}
25