Passed
Push — master ( df2e7d...4ffc8b )
by Gabriel Felipe
01:40 queued 10s
created

ExploreResult::isInterestOverTimeSearch()   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
/**
6
 * @author Gabriel Felipe Soares <[email protected]>
7
 */
8
class ExploreResult
9
{
10
    public const ID_INTEREST_OVER_TIME = 'TIMESERIES';
11
    public const ID_INTEREST_BY_REGION = 'GEO_MAP';
12
    public const ID_RELATED_TOPICS = 'RELATED_TOPICS';
13
    public const ID_RELATED_QUERIES = 'RELATED_QUERIES';
14
15
    /**
16
     * @var string
17
     */
18
    private $id;
19
20
    /**
21
     * @var string
22
     */
23
    private $token;
24
25 11
    public function __construct(string $id, string $token)
26
    {
27 11
        $this->id = $id;
28 11
        $this->token = $token;
29 11
    }
30
31 9
    public function getToken(): string
32
    {
33 9
        return $this->token;
34
    }
35
36 5
    public function isRelatedQueriesSearch(): bool
37
    {
38 5
        return self::ID_RELATED_QUERIES === $this->id;
39
    }
40
41 5
    public function isRelatedTopicsSearch(): bool
42
    {
43 5
        return self::ID_RELATED_TOPICS === $this->id;
44
    }
45
46 3
    public function isInterestOverTimeSearch(): bool
47
    {
48 3
        return self::ID_INTEREST_OVER_TIME === $this->id;
49
    }
50
}
51