Completed
Push — master ( 44676f...b7bc18 )
by Jens
13:18
created

CustomerDeleteByKeyRequest::__construct()   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 0
Metric Value
dl 4
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
crap 2
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Request\Customers;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Request\AbstractDeleteByKeyRequest;
10
use Commercetools\Core\Model\Type\Type;
11
use Commercetools\Core\Response\ApiResponseInterface;
12
use Commercetools\Core\Model\Customer\Customer;
13
use Commercetools\Core\Model\MapperInterface;
14
15
/**
16
 * @package Commercetools\Core\Request\Customers
17
 * @link https://dev.commercetools.com/http-api-projects-customers.html#delete-customer-by-key
18
 * @method Customer mapResponse(ApiResponseInterface $response)
19
 * @method Customer mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
20
 */
21 View Code Duplication
class CustomerDeleteByKeyRequest extends AbstractDeleteByKeyRequest
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
    protected $resultClass = Customer::class;
24
25
    /**
26
     * @param string $id
27
     * @param int $version
28
     * @param Context $context
29
     */
30
    public function __construct($id, $version, Context $context = null)
31
    {
32
        parent::__construct(CustomersEndpoint::endpoint(), $id, $version, $context);
33
    }
34
35
    /**
36
     * @param string $key
37
     * @param int $version
38
     * @param Context $context
39
     * @return static
40
     */
41
    public static function ofKeyAndVersion($key, $version, Context $context = null)
42
    {
43
        return new static($key, $version, $context);
44
    }
45
}
46