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

Request   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 11 11 3

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

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