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

AbstractByKeyGetRequest::setKey()   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 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 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