Completed
Push — master ( 073b67...df2b0c )
by Tim
01:48
created

Request::__construct()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 6

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
cc 3
eloc 6
nc 3
nop 1
dl 11
loc 11
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace \SimpleSAML\Module\monitor\DependencyInjection;
4
5 View Code Duplication
class Request
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
6
{
7
    // The canonical list of acceptable request parameters
8
    /**
9
     * @var mixed
10
     */
11
    public $xml;
12
13
    /**
14
     * @param array $requestVars
15
     *
16
     * @return Request
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...
17
     */
18
    public function __construct($requestVars)
19
    {
20
        $objectVars = get_object_vars($this);
21
        foreach ($requestVars as $property => $value)
22
        {
23
            if (array_key_exists($property, $objectVars)) {
24
                $this->$property = $value;
25
            }
26
        }
27
        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...
28
    }
29
}
30