GetSegmentsResponse::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1
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\ArrayOfSegmentsInfo;
16
17
/**
18
 * Gets the segments for a specific list
19
 */
20
class GetSegmentsResponse extends Response
21
{
22
    /**
23
     * @var int The result of the function
24
     */
25
    protected $GetSegmentsResult;
26
27
    /**
28
     * @var ArrayOfSegmentsInfo List of found segments
29
     */
30
    protected $segments;
31
32 1
    public function __construct()
33
    {
34 1
        $this->GetSegmentsResult = Response::ERROR_NORESULT;
35 1
        $this->segments = [];
0 ignored issues
show
Documentation Bug introduced by
It seems like array() of type array is incompatible with the declared type object<Mediapart\Selligent\ArrayOfSegmentsInfo> of property $segments.

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...
36 1
    }
37
38
    /**
39
     * {@inheritDoc}
40
     */
41 1
    public function getCode()
42
    {
43 1
        return $this->GetSegmentsResult;
44
    }
45
46
    /**
47
     * @return ArrayOfSegmentsInfo List of found segments
48
     */
49 1
    public function getSegments()
50
    {
51 1
        return $this->segments;
52
    }
53
}
54