Completed
Push — develop ( 5e9601...0ad397 )
by
unknown
11:49
created

AbstractByKeyGetRequest::getKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 4
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
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 View Code Duplication
abstract class AbstractByKeyGetRequest extends AbstractByIdGetRequest
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
22
{
23
    /**
24
     * @return string
25
     */
26
    public function getKey()
27
    {
28
        return $this->getId();
29
    }
30
31
    /**
32
     * @param string $key
33
     * @return $this
34
     */
35
    public function setKey($key)
36
    {
37
        return $this->setId($key);
38
    }
39
40
    /**
41
     * @return string
42
     * @internal
43
     */
44
    protected function getPath()
45
    {
46
        return (string)$this->getEndpoint() . '/key=' . $this->getKey() . $this->getParamString();
47
    }
48
}
49