Completed
Push — master ( e8b86c...279d13 )
by Sullivan
02:12
created

AbstractReferencedTransactionRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getParameters() 0 8 1
1
<?php
2
3
namespace Nexy\PayboxDirect\Request;
4
5
/**
6
 * @author Sullivan Senechal <[email protected]>
7
 */
8
abstract class AbstractReferencedTransactionRequest extends AbstractTransactionRequest
9
{
10
    /**
11
     * @var string
12
     */
13
    private $reference;
14
15
    /**
16
     * @param int $reference
17
     * @param int $amount
18
     */
19
    public function __construct($reference, $amount)
20
    {
21
        parent::__construct($amount);
22
23
        $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...
24
    }
25
26
    public function getParameters()
27
    {
28
        $parameters = [
29
            'REFERENCE' => $this->reference,
30
        ];
31
32
        return array_merge(parent::getParameters(), $parameters);
33
    }
34
}
35