Passed
Push — trunk ( f4162f...7ce20e )
by Christian
12:30 queued 14s
created

PatternNotComplexEnoughException::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\Promotion\Exception;
4
5
use Shopware\Core\Checkout\Promotion\PromotionException;
6
use Shopware\Core\Framework\Feature;
7
use Shopware\Core\Framework\Log\Package;
8
use Symfony\Component\HttpFoundation\Response;
9
10
/**
11
 * @deprecated tag:v6.6.0 - will be removed, use PromotionException::patternNotComplexEnough instead
12
 */
13
#[Package('checkout')]
14
class PatternNotComplexEnoughException extends PromotionException
15
{
16
    final public const ERROR_CODE = 'PROMOTION__INDIVIDUAL_CODES_PATTERN_INSUFFICIENTLY_COMPLEX';
17
18
    public function __construct()
19
    {
20
        Feature::triggerDeprecationOrThrow(
21
            'v6.6.0.0',
22
            Feature::deprecatedClassMessage(self::class, 'v6.6.0.0', 'use PromotionException::patternNotComplexEnough instead')
23
        );
24
25
        parent::__construct(
26
            Response::HTTP_BAD_REQUEST,
27
            self::PATTERN_NOT_COMPLEX_ENOUGH,
28
            'The amount of possible codes is too low for the current pattern. Make sure your pattern is sufficiently complex.'
29
        );
30
    }
31
}
32