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

CustomerAuthThrottledException::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 CustomerAuthThrottledException extends CustomerException
11
{
12
    public function __construct(
13
        private readonly int $waitTime,
14
        ?\Throwable $e = null
15
    ) {
16
        parent::__construct(
17
            Response::HTTP_TOO_MANY_REQUESTS,
18
            self::CUSTOMER_AUTH_THROTTLED,
19
            'Customer auth throttled for {{ seconds }} seconds.',
20
            ['seconds' => $this->waitTime],
21
            $e
22
        );
23
    }
24
25
    public function getWaitTime(): int
26
    {
27
        return $this->waitTime;
28
    }
29
}
30