Completed
Push — master ( fa9a11...9c37c7 )
by Jens
13:15
created

AbstractProjectionRequest::httpRequest()   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
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 * @created: 02.02.15, 11:44
5
 */
6
7
namespace Commercetools\Core\Request;
8
9
use Commercetools\Core\Client\HttpRequest;
10
use Commercetools\Core\Client\HttpMethod;
11
use Commercetools\Core\Model\Common\Collection;
12
use Commercetools\Core\Model\Common\Context;
13
use Commercetools\Core\Model\Common\JsonDeserializeInterface;
14
use Commercetools\Core\Model\Common\JsonObject;
15
16
/**
17
 * @package Commercetools\Core\Request
18
 */
19
abstract class AbstractProjectionRequest extends AbstractApiRequest
20
{
21
    use StagedTrait;
22
23
    /**
24
     * @return string
25
     */
26
    abstract protected function getProjectionAction();
27
28
    /**
29
     * @return string
30
     * @internal
31
     */
32 10
    protected function getPath()
33
    {
34 10
        return (string)$this->getEndpoint() . '/' . $this->getProjectionAction() . $this->getParamString();
35
    }
36
37
    /**
38
     * @return HttpRequest
39
     * @internal
40
     */
41 10
    public function httpRequest()
42
    {
43 10
        return new HttpRequest(HttpMethod::GET, $this->getPath());
44
    }
45
}
46