getParameters()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the Nexylan packages.
5
 *
6
 * (c) Nexylan SAS <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Nexy\PayboxDirect\Request;
13
14
use Symfony\Component\Validator\Constraints as Assert;
15
16
/**
17
 * @author Sullivan Senechal <[email protected]>
18
 */
19
abstract class AbstractReferencedTransactionRequest extends AbstractTransactionRequest
20
{
21
    /**
22
     * @var string
23
     *
24
     * @Assert\Type("string")
25
     * @Assert\Length(min=1, max=250)
26
     */
27
    private $reference;
28
29
    /**
30
     * @param string      $reference
31
     * @param int         $amount
32
     * @param string|null $subscriberRef
33
     */
34
    public function __construct($reference, $amount, $subscriberRef = null)
35
    {
36
        parent::__construct($amount, $subscriberRef);
37
38
        $this->reference = $reference;
39
    }
40
41
    public function getParameters()
42
    {
43
        $parameters = [
44
            'REFERENCE' => $this->reference,
45
        ];
46
47
        return array_merge(parent::getParameters(), $parameters);
48
    }
49
}
50