GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — 1.x ( f2247a...73fe3f )
by Jakub
04:00
created

RefundPayment::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 12

Duplication

Lines 15
Ratio 100 %

Importance

Changes 0
Metric Value
dl 15
loc 15
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 12
nc 1
nop 4
1
<?php
2
3
namespace zaporylie\Vipps\Resource\Payment;
4
5
use zaporylie\Vipps\Model\Payment\RequestRefundPayment;
6
use zaporylie\Vipps\Model\Payment\ResponseRefundPayment;
7
use zaporylie\Vipps\Resource\HttpMethod;
8
use zaporylie\Vipps\VippsInterface;
9
10
/**
11
 * Class RefundPayment
12
 *
13
 * @package Vipps\Resource\Payment
14
 */
15 View Code Duplication
class RefundPayment extends PaymentResourceBase
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...
16
{
17
18
    /**
19
     * @var \zaporylie\Vipps\Resource\HttpMethod
20
     */
21
    protected $method = HttpMethod::POST;
22
23
    /**
24
     * @var string
25
     */
26
    protected $path = '/Ecomm/v1/payments/{id}/refund';
27
28
    /**
29
     * InitiatePayment constructor.
30
     *
31
     * @param \zaporylie\Vipps\VippsInterface $vipps
32
     * @param string $subscription_key
33
     * @param string $order_id
34
     * @param \zaporylie\Vipps\Model\Payment\RequestRefundPayment $requestObject
35
     */
36
    public function __construct(
37
        VippsInterface $vipps,
38
        $subscription_key,
39
        $order_id,
40
        RequestRefundPayment $requestObject
41
    ) {
42
        parent::__construct($vipps, $subscription_key);
43
        $this->body = $this
44
            ->getSerializer()
45
            ->serialize(
46
                $requestObject,
47
                'json'
48
            );
49
        $this->id = $order_id;
50
    }
51
52
    /**
53
     * @return \zaporylie\Vipps\Model\Payment\ResponseRefundPayment
54
     */
55
    public function call()
56
    {
57
        $response = $this->makeCall();
58
        $body = $response->getBody()->getContents();
59
        /** @var \zaporylie\Vipps\Model\Payment\ResponseRefundPayment $responseObject */
60
        $responseObject = $this
61
            ->getSerializer()
62
            ->deserialize(
63
                $body,
64
                ResponseRefundPayment::class,
65
                'json'
66
            );
67
68
        return $responseObject;
69
    }
70
}
71