Passed
Push — trunk ( 29fffa...ce05d4 )
by Christian
13:01 queued 12s
created

getSnippetKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 1
c 1
b 1
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\Checkout\Customer\Exception;
4
5
use Shopware\Core\Framework\ShopwareHttpException;
6
use Symfony\Component\HttpFoundation\Response;
7
8
class CustomerOptinNotCompletedException extends ShopwareHttpException
9
{
10
    /**
11
     * @deprecated tag:v6.6.0 the $message parameter will be removed without replacement
12
     */
13
    public function __construct(string $id, ?string $message = null)
14
    {
15
        parent::__construct(
16
            $message ?? 'The customer with the id "{{ customerId }}" has not completed the opt-in.',
17
            ['customerId' => $id]
18
        );
19
    }
20
21
    public function getErrorCode(): string
22
    {
23
        return 'CHECKOUT__CUSTOMER_OPTIN_NOT_COMPLETED';
24
    }
25
26
    public function getStatusCode(): int
27
    {
28
        return Response::HTTP_UNAUTHORIZED;
29
    }
30
31
    public function getSnippetKey(): string
32
    {
33
        return 'account.doubleOptinAccountAlert';
34
    }
35
}
36