Completed
Push — master ( 073f2f...b2ba42 )
by Joachim
12:40
created

AltapayPaymentRequestException::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
dl 7
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 3
1
<?php
2
namespace Loevgaard\DandomainAltapayBundle\Exception;
3
4
use Loevgaard\DandomainAltapayBundle\Entity\PaymentInterface;
5
use Symfony\Component\HttpFoundation\Request;
6
use Loevgaard\AltaPay\Payload\PaymentRequest as PaymentRequestPayload;
7
8
class AltapayPaymentRequestException extends PaymentException
9
{
10
    /**
11
     * @var PaymentRequestPayload
12
     */
13
    protected $payload;
14
    /**
15
     * @param string $message
16
     * @param Request $request
17
     * @param PaymentInterface $payment
18
     * @return PaymentException
19
     */
20 View Code Duplication
    public static function create(string $message, Request $request, PaymentInterface $payment) : PaymentException
0 ignored issues
show
Duplication introduced by
This method 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...
21
    {
22
        $e = new static($message);
23
        $e->setRequest($request);
24
        $e->setPayment($payment);
25
        return $e;
26
    }
27
}