Passed
Push — master ( 3c3598...bb5c48 )
by Christian
12:33 queued 10s
created

OrderInconsistentException::getOrderId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\Checkout\Cart\Exception;
4
5
use Shopware\Core\Framework\ShopwareHttpException;
6
use Symfony\Component\HttpFoundation\Response;
7
8
class OrderInconsistentException extends ShopwareHttpException
9
{
10
    /**
11
     * @var string
12
     */
13
    private $orderId;
14
15
    public function __construct(string $orderId, string $reason)
16
    {
17
        parent::__construct(
18
            'Inconsistent order with id "{{ orderId }}". Reason: {{ reason }}',
19
            ['orderId' => $orderId, 'reason' => $reason]
20
        );
21
22
        $this->orderId = $orderId;
23
    }
24
25
    public function getErrorCode(): string
26
    {
27
        return 'CHECKOUT__ORDER_INCONSISTENT';
28
    }
29
30
    public function getStatusCode(): int
31
    {
32
        return Response::HTTP_BAD_REQUEST;
33
    }
34
35
    public function getOrderId(): string
36
    {
37
        return $this->orderId;
38
    }
39
}
40