Passed
Push — master ( f5f62a...783e97 )
by Christian
12:34 queued 10s
created

PatternNotComplexEnoughException::getStatusCode()   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
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\Checkout\Promotion\Exception;
4
5
use Shopware\Core\Framework\ShopwareHttpException;
6
use Symfony\Component\HttpFoundation\Response;
7
8
class PatternNotComplexEnoughException extends ShopwareHttpException
9
{
10
    public const ERROR_CODE = 'PROMOTION__INDIVIDUAL_CODES_PATTERN_INSUFFICIENTLY_COMPLEX';
11
12
    public function __construct()
13
    {
14
        parent::__construct(
15
            'The amount of possible codes is too low for the current pattern. Make sure your pattern is sufficiently complex.'
16
        );
17
    }
18
19
    public function getErrorCode(): string
20
    {
21
        return self::ERROR_CODE;
22
    }
23
24
    public function getStatusCode(): int
25
    {
26
        return Response::HTTP_BAD_REQUEST;
27
    }
28
}
29