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

ExploreResult   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 43
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getToken() 0 4 1
A isRelatedQueriesSearch() 0 4 1
A isRelatedTopicsSearch() 0 4 1
A isInterestOverTimeSearch() 0 4 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