Passed
Push — master ( 9e6441...cfa3d6 )
by Christian
14:05
created

GuestNotAuthenticatedException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 15
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getStatusCode() 0 3 1
A getErrorCode() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\Checkout\Order\Exception;
4
5
use Shopware\Core\Framework\ShopwareHttpException;
6
use Symfony\Component\HttpFoundation\Response;
7
8
class GuestNotAuthenticatedException extends ShopwareHttpException
9
{
10
    public function __construct()
11
    {
12
        parent::__construct('Guest not authenticated.');
13
    }
14
15
    public function getErrorCode(): string
16
    {
17
        return 'CHECKOUT__GUEST_NOT_AUTHENTICATED';
18
    }
19
20
    public function getStatusCode(): int
21
    {
22
        return Response::HTTP_FORBIDDEN;
23
    }
24
}
25