ExploreResult   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 48
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

6 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
A isInterestByRegionSearch() 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 16
    public function __construct(string $id, string $token)
26
    {
27 16
        $this->id = $id;
28 16
        $this->token = $token;
29 16
    }
30
31 14
    public function getToken(): string
32
    {
33 14
        return $this->token;
34
    }
35
36 7
    public function isRelatedQueriesSearch(): bool
37
    {
38 7
        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 3
    public function isInterestByRegionSearch(): bool
52
    {
53 3
        return self::ID_INTEREST_BY_REGION === $this->id;
54
    }
55
}
56