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

PaymentByKeyGetRequest::ofKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
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\Model\Type\Type;
10
use Commercetools\Core\Request\AbstractByKeyGetRequest;
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://dev.commercetools.com/http-api-projects-payments.html#get-payment-by-key
18
 * @method Payment mapResponse(ApiResponseInterface $response)
19
 * @method Payment mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
20
 */
21 View Code Duplication
class PaymentByKeyGetRequest extends AbstractByKeyGetRequest
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 Context $context
28
     */
29 1
    public function __construct($key, Context $context = null)
30
    {
31 1
        parent::__construct(PaymentsEndpoint::endpoint(), $key, $context);
32 1
    }
33
34
    /**
35
     * @param string $key
36
     * @param Context $context
37
     * @return static
38
     */
39 1
    public static function ofKey($key, Context $context = null)
40
    {
41 1
        return new static($key, $context);
42
    }
43
}
44