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

PaymentDeleteByKeyRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 23
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ofKeyAndVersion() 0 3 1
A __construct() 0 3 1
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