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

DependencyInjectionFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 3
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