Completed
Push — master ( 48da13...c8b756 )
by Sullivan
02:22
created

AbstractReferencedBearerTransactionRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 7 7 1
A getParameters() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace Nexy\PayboxDirect\Request;
4
5
/**
6
 * Requests with card numbers or reference.
7
 *
8
 * @author Sullivan Senechal <[email protected]>
9
 */
10 View Code Duplication
abstract class AbstractReferencedBearerTransactionRequest extends AbstractReferencedTransactionRequest
0 ignored issues
show
Duplication introduced by
This class 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...
11
{
12
    use BearerRequestTrait;
13
14
    /**
15
     * @param int         $reference
16
     * @param int         $amount
17
     * @param string      $bearer
18
     * @param string      $validityDate
19
     * @param string|null $subscriberRef
20
     */
21
    public function __construct($reference, $amount, $bearer, $validityDate, $subscriberRef = null)
22
    {
23
        parent::__construct($reference, $amount, $subscriberRef);
24
25
        $this->bearer = $bearer;
26
        $this->validityDate = $validityDate;
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function getParameters()
33
    {
34
        return array_merge(parent::getParameters(), $this->getBearerParameters());
35
    }
36
}
37