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.

BancontactPayment::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 3
crap 1
1
<?php
2
3
namespace CMPayments\PaymentSdk\Entities;
4
5
use Money\Money;
6
7
/**
8
 * Class BancontactPayment
9
 * @package CMPayments\PaymentSdk\Entities
10
 * @author Jory Geerts <[email protected]>
11
 */
12
class BancontactPayment extends Payment
13
{
14
    /**
15
     * @var \DateTime
16
     */
17
    private $dueDate;
18
19
    /**
20
     * CreditCardPayment constructor.
21
     *
22
     * @param Money $money
23
     * @param array $issuers
0 ignored issues
show
Bug introduced by
There is no parameter named $issuers. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
24
     * @param string $purchaseId
25
     * @param \DateTime $expiryDate
26
     */
27 1
    public function __construct(Money $money, $purchaseId, \DateTime $expiryDate = null)
28
    {
29 1
        parent::__construct($money, 'Bancontact', $purchaseId);
30
31 1
        $this->dueDate = $expiryDate;
32 1
    }
33
34
    /** @inheritdoc */
35 1 View Code Duplication
    public function toArray()
0 ignored issues
show
Duplication introduced by
This method 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...
36
    {
37 1
        $array = parent::toArray();
38 1
        $array['capture'] = true;
39
40 1
        if ($this->dueDate) {
41 1
            $array['due_date'] = $this->dueDate->format(DATE_RFC3339);
42 1
        }
43
44 1
        $array['payment_details']['issuers'] = ['BCMC'];
45 1
        return $array;
46
    }
47
}
48