Completed
Branch master (841483)
by methylbro
02:19
created

GetUsersByFilterResponse   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 38
loc 38
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 6 6 1
A getCode() 4 4 1
A getIds() 4 4 1

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
/**
4
 * This file is part of the Mediapart Selligent Client API
5
 *
6
 * CC BY-NC-SA <https://github.com/mediapart/selligent>
7
 *
8
 * For the full license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Mediapart\Selligent\Response;
13
14
use Mediapart\Selligent\Response;
15
use Mediapart\Selligent\Properties;
16
17
/**
18
 *
19
 */
20 View Code Duplication
class GetUsersByFilterResponse extends Response
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...
21
{
22
    /**
23
     * @var integer
24
     */
25
    protected $GetUsersByFilterResult;
26
27
    /**
28
     * @var stdClass
29
     */
30
    protected $ResultIDs;
31
32
    /**
33
     *
34
     */
35 1
    public function __construct()
36
    {
37 1
        $this->GetUsersByFilterResult = Response::ERROR_NORESULT;
38 1
        $this->ResultIDs = new \stdClass;
0 ignored issues
show
Documentation Bug introduced by
It seems like new \stdClass() of type object<stdClass> is incompatible with the declared type object<Mediapart\Selligent\Response\stdClass> of property $ResultIDs.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
39 1
        $this->ResultIDs->int = [];
40 1
    }
41
42
    /**
43
     * {@inheritDoc}
44
     */
45 1
    public function getCode()
46
    {
47 1
        return $this->GetUsersByFilterResult;
48
    }
49
50
    /**
51
     * @return Array[integer]
0 ignored issues
show
Documentation introduced by
The doc-type Array[integer] could not be parsed: Expected "]" at position 2, but found "integer". (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
52
     */
53 1
    public function getIds()
54
    {
55 1
        return $this->ResultIDs->int;
56
    }
57
}
58