Completed
Push — master ( 4ffc8b...8e0049 )
by Gabriel Felipe
02:04 queued 10s
created

InterestByRegionResult::hasData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php declare(strict_types=1);
2
3
namespace GSoares\GoogleTrends\Result;
4
5
use JsonSerializable;
6
7
/**
8
 * @author Gabriel Felipe Soares <[email protected]>
9
 */
10
class InterestByRegionResult implements JsonSerializable
11
{
12
    /**
13
     * @var string
14
     */
15
    private $geoCode;
16
17
    /**
18
     * @var string
19
     */
20
    private $geoName;
21
22
    /**
23
     * @var int
24
     */
25
    private $value;
26
27
    /**
28
     * @var int
29
     */
30
    private $maxValueIndex;
31
32
    /**
33
     * @var bool
34
     */
35
    private $hasData;
36
37 3
    public function __construct(
38
        string $geoCode,
39
        string $geoName,
40
        int $value,
41
        int $maxValueIndex,
42
        bool $hasData
43
    ) {
44 3
        $this->geoCode = $geoCode;
45 3
        $this->geoName = $geoName;
46 3
        $this->value = $value;
47 3
        $this->maxValueIndex = $maxValueIndex;
48 3
        $this->hasData = $hasData;
49 3
    }
50
51 1
    public function getGeoCode(): string
52
    {
53 1
        return $this->geoCode;
54
    }
55
56 1
    public function getGeoName(): string
57
    {
58 1
        return $this->geoName;
59
    }
60
61 1
    public function getValue(): int
62
    {
63 1
        return $this->value;
64
    }
65
66 1
    public function getMaxValueIndex(): int
67
    {
68 1
        return $this->maxValueIndex;
69
    }
70
71 1
    public function hasData(): bool
72
    {
73 1
        return $this->hasData;
74
    }
75
76
    /**
77
     * @inheritDoc
78
     */
79 1
    public function jsonSerialize(): array
80
    {
81
        return [
82 1
            'geoCode' => $this->getGeoCode(),
83 1
            'geoName' => $this->getGeoName(),
84 1
            'value' => $this->getValue(),
85 1
            'maxValueIndex' => $this->getMaxValueIndex(),
86 1
            'hasData' => $this->hasData(),
87
        ];
88
    }
89
}
90