Passed
Push — develop ( e68aaf...da32ce )
by Jens
08:58
created

PaymentUpdateByKeyRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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