Completed
Push — develop ( 58cdba...7f1e46 )
by Jens
08:46
created

AbstractByKeyGetRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 28
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getKey() 0 4 1
A getPath() 0 4 1
A setKey() 0 4 1
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 * @created: 26.01.15, 17:25
5
 */
6
7
namespace Commercetools\Core\Request;
8
9
use Psr\Http\Message\ResponseInterface;
10
use Commercetools\Core\Client;
11
use Commercetools\Core\Client\HttpMethod;
12
use Commercetools\Core\Client\HttpRequest;
13
use Commercetools\Core\Client\JsonEndpoint;
14
use Commercetools\Core\Model\Common\Context;
15
use Commercetools\Core\Response\ResourceResponse;
16
17
/**
18
 * @package Commercetools\Core\Request
19
 * @method ResourceResponse executeWithClient(Client $client)
20
 */
21
abstract class AbstractByKeyGetRequest extends AbstractByIdGetRequest
22
{
23
    /**
24
     * @return string
25
     */
26 6
    public function getKey()
27
    {
28 6
        return $this->getId();
29
    }
30
31
    /**
32
     * @param string $key
33
     * @return $this
34
     */
35 1
    public function setKey($key)
36
    {
37 1
        return $this->setId($key);
38
    }
39
40
    /**
41
     * @return string
42
     * @internal
43
     */
44 5
    protected function getPath()
45
    {
46 5
        return (string)$this->getEndpoint() . '/key=' . $this->getKey() . $this->getParamString();
47
    }
48
}
49