Passed
Push — trunk ( 2ef630...41af6c )
by Christian
10:02 queued 15s
created

CustomerOptinNotCompletedException::getStatusCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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