Completed
Push — master ( b79065...3491b2 )
by
unknown
09:59
created

GetAll::getMethod()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Cardinity\Method\VoidPayment;
4
5
use Cardinity\Method\MethodInterface;
6
use Cardinity\Method\MethodResultCollectionInterface;
7
use Symfony\Component\Validator\Constraints as Assert;
8
9 View Code Duplication
class GetAll implements MethodResultCollectionInterface
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...
10
{
11
    private $paymentId;
12
13
    public function __construct($paymentId)
14
    {
15
        $this->paymentId = $paymentId;
16
    }
17
18
    public function getAction()
19
    {
20
        return sprintf(
21
            'payments/%s/voids',
22
            $this->getPaymentId()
23
        );
24
    }
25
26
    public function getMethod()
27
    {
28
        return MethodInterface::GET;
29
    }
30
31
    public function createResultObject()
32
    {
33
        return new VoidPayment();
34
    }
35
36
    public function getAttributes()
37
    {
38
        return [];
39
    }
40
41
    public function getValidationConstraints()
42
    {
43
        return new Assert\Collection([]);
44
    }
45
46
    public function getPaymentId()
47
    {
48
        return $this->paymentId;
49
    }
50
}
51