Completed
Pull Request — master (#12)
by Sullivan
02:14
created

__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
4
namespace Nexy\PayboxDirect\Request;
5
6
/**
7
 * @author Sullivan Senechal <[email protected]>
8
 */
9
abstract class AbstractReferencedTransactionRequest extends AbstractTransactionRequest
10
{
11
    /**
12
     * @var string
13
     */
14
    private $reference;
15
16
    /**
17
     * @param int $reference
18
     * @param int $amount
19
     */
20
    public function __construct($reference, $amount)
21
    {
22
        parent::__construct($amount);
23
24
        $this->reference = $reference;
0 ignored issues
show
Documentation Bug introduced by
The property $reference was declared of type string, but $reference is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
25
    }
26
27
    public function getParameters()
28
    {
29
        $parameters = [
30
            'REFERENCE' => $this->reference,
31
        ];
32
33
        return array_merge(parent::getParameters(), $parameters);
34
    }
35
}
36