Completed
Push — develop ( 524b9a...309d50 )
by Jens
09:14
created

AbstractUpdateByKeyRequest   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 2
cts 2
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getKey() 0 4 1
A setKey() 0 4 1
A getPath() 0 4 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\HttpMethod;
11
use Commercetools\Core\Client\JsonEndpoint;
12
use Commercetools\Core\Client\JsonRequest;
13
use Commercetools\Core\Error\Message;
14
use Commercetools\Core\Model\Common\Context;
15
use Commercetools\Core\Model\Common\ContextAwareInterface;
16
use Commercetools\Core\Response\ResourceResponse;
17
use Commercetools\Core\Error\UpdateActionLimitException;
18
19
/**
20
 * @package Commercetools\Core\Request
21
 */
22
abstract class AbstractUpdateByKeyRequest extends AbstractUpdateRequest
23
{
24
    /**
25
     * @return string
26
     */
27
    public function getKey()
28
    {
29
        return $this->getId();
30
    }
31
32
    /**
33
     * @param string $key
34
     * @return $this
35
     */
36
    public function setKey($key)
37
    {
38
        return $this->setId($key);
39
    }
40
41
    /**
42
     * @return string
43
     * @internal
44
     */
45 2
    protected function getPath()
46
    {
47 2
        return (string)$this->getEndpoint() . '/key=' . $this->getId();
48
    }
49
}
50