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

AbstractDeleteByKeyRequest::getPath()   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 0
crap 1
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 * @created: 26.01.15, 17:22
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\Request\Query\Parameter;
16
use Commercetools\Core\Response\ResourceResponse;
17
18
/**
19
 * @package Commercetools\Core\Request
20
 * @method ResourceResponse executeWithClient(Client $client)
21
 */
22
abstract class AbstractDeleteByKeyRequest extends AbstractDeleteRequest
23
{
24
    /**
25
     * @return string
26
     */
27 1
    public function getKey()
28
    {
29 1
        return $this->getId();
30
    }
31
32
    /**
33
     * @param $key
34
     * @return $this
35
     */
36 1
    public function setKey($key)
37
    {
38 1
        return $this->setId($key);
39
    }
40
41
    /**
42
     * @return string
43
     * @internal
44
     */
45 3
    protected function getPath()
46
    {
47 3
        return (string)$this->getEndpoint() . '/key=' . $this->getId() . $this->getParamString();
48
    }
49
}
50