Code Duplication    Length = 28-28 lines in 2 locations

src/Request/AbstractByKeyGetRequest.php 1 location

@@ 21-48 (lines=28) @@
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
    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

src/Request/AbstractDeleteByKeyRequest.php 1 location

@@ 22-49 (lines=28) @@
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
    public function getKey()
28
    {
29
        return $this->getId();
30
    }
31
32
    /**
33
     * @param $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
    protected function getPath()
46
    {
47
        return (string)$this->getEndpoint() . '/key=' . $this->getId() . $this->getParamString();
48
    }
49
}
50