Passed
Branch php-scrutinizer (9ddcba)
by Jens
09:45
created

PaymentDeleteByKeyRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 3
crap 2
1
<?php
2
/**
3
 * @author @jenschude <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Request\Payments;
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\Payment\Payment;
13
use Commercetools\Core\Model\MapperInterface;
14
15
/**
16
 * @package Commercetools\Core\Request\Payments
17
 * @link https://docs.commercetools.com/http-api-projects-payments.html#delete-payment-by-key
18
 * @method Payment mapResponse(ApiResponseInterface $response)
19
 * @method Payment mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
20
 */
21
class PaymentDeleteByKeyRequest extends AbstractDeleteByKeyRequest
22
{
23
    protected $resultClass = Payment::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(PaymentsEndpoint::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