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

AbstractProjectionRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 27
ccs 4
cts 4
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
getProjectionAction() 0 1 ?
A getPath() 0 4 1
A httpRequest() 0 4 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