Completed
Push — master ( 79dd3c...f666f7 )
by
unknown
10s
created

Query::getContentType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Xsolve\SalesforceClient\Request;
4
5
use Xsolve\SalesforceClient\Enum\ContentType;
6
use Xsolve\SalesforceClient\Enum\RequestMethod;
7
8
class Query implements RequestInterface
9
{
10
    const ENDPOINT = '/query/';
11
12
    /**
13
     * @var string
14
     */
15
    private $queryString;
16
17 4
    public function __construct(string $queryString)
18
    {
19 4
        $this->queryString = $queryString;
20 4
    }
21
22 4
    public function getEndpoint(): string
23
    {
24 4
        return sprintf(
25 4
            '%s?%s',
26 4
            self::ENDPOINT,
27 4
            http_build_query(['q' => $this->queryString], null, '&')
28
        );
29
    }
30
31 3
    public function getMethod(): RequestMethod
32
    {
33 3
        return RequestMethod::GET();
34
    }
35
36 3
    public function getParams(): array
37
    {
38 3
        return [];
39
    }
40
41 3
    public function getContentType(): ContentType
42
    {
43 3
        return ContentType::FORM();
44
    }
45
}
46