Completed
Pull Request — master (#12)
by Sullivan
02:14
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
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