Passed
Push — master ( 9e5a11...b08ede )
by frey
01:13 queued 11s
created

Client   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getBaseUri() 0 3 1
A get() 0 9 1
1
<?php
2
3
namespace Freyo\ApiGateway\API;
4
5
use Freyo\ApiGateway\Kernel\TencentCloudClient;
6
7
class Client extends TencentCloudClient
8
{
9
    /**
10
     * @return string
11
     */
12
    protected function getBaseUri()
13
    {
14
        return 'https://apigateway.api.qcloud.com/v2/';
15
    }
16
17
    /**
18
     * @param $apiId
19
     * @param $serviceId
20
     *
21
     * @return array|\Freyo\ApiGateway\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
22
     * @throws \Freyo\ApiGateway\Kernel\Exceptions\InvalidConfigException
23
     */
24
    public function get($apiId, $serviceId)
25
    {
26
        $params = [
27
            'Action' => 'DescribeApi',
28
            'serviceId' => $apiId,
29
            'apiId' => $serviceId,
30
        ];
31
32
        return $this->httpPost('index.php', $params);
33
    }
34
}