Total Complexity | 8 |
Total Lines | 91 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class Here extends AbstractProvider |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $app_id; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private $app_code; |
||
21 | |||
22 | /** |
||
23 | * @var bool |
||
24 | */ |
||
25 | private $useCIT; |
||
26 | |||
27 | /** |
||
28 | * Here constructor. |
||
29 | * |
||
30 | * @param ClientInterface $client |
||
31 | * @param string $appId an App ID |
||
32 | * @param string $appCode an App code |
||
33 | * @param bool $useCIT use Customer Integration Testing environment (CIT) instead of production |
||
34 | */ |
||
35 | public function __construct(ClientInterface $client, string $appId, string $appCode, bool $useCIT = false) |
||
36 | { |
||
37 | parent::__construct($client); |
||
38 | |||
39 | $this->app_id = $appId; |
||
40 | $this->app_code = $appCode; |
||
41 | $this->useCIT = $useCIT; |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @return string |
||
46 | */ |
||
47 | public function getName(): string |
||
48 | { |
||
49 | return 'here'; |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | */ |
||
55 | public function getAppId(): string |
||
56 | { |
||
57 | return $this->app_id; |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * @return string |
||
62 | */ |
||
63 | public function getAppCode(): string |
||
64 | { |
||
65 | return $this->app_code; |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * @return bool |
||
70 | */ |
||
71 | public function isCitEnabled(): bool |
||
72 | { |
||
73 | return $this->useCIT; |
||
74 | } |
||
75 | |||
76 | /** |
||
77 | * @return array |
||
78 | */ |
||
79 | public function getCredentials(): array |
||
80 | { |
||
81 | return [ |
||
82 | 'app_id' => $this->getAppId(), |
||
83 | 'app_code' => $this->getAppCode(), |
||
84 | ]; |
||
85 | } |
||
86 | |||
87 | /** |
||
88 | * @return DistanceMatrixQueryInterface |
||
89 | */ |
||
90 | public function createDistanceMatrixQuery(): DistanceMatrixQueryInterface |
||
91 | { |
||
92 | return new DistanceMatrixQuery($this); |
||
93 | } |
||
94 | |||
95 | /** |
||
96 | * @return string |
||
97 | */ |
||
98 | public function __toString() |
||
101 | } |
||
102 | } |
||
103 |