Passed
Push — trunk ( ad06ea...8f56e6 )
by Christian
23:45 queued 17s
created

CustomerException::customerGroupNotFound()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\Checkout\Customer;
4
5
use Shopware\Core\Framework\HttpException;
6
use Shopware\Core\Framework\Log\Package;
7
use Symfony\Component\HttpFoundation\Response;
8
9
#[Package('customer-order')]
10
class CustomerException extends HttpException
11
{
12
    public const CUSTOMER_GROUP_NOT_FOUND = 'CHECKOUT__CUSTOMER_GROUP_NOT_FOUND';
13
14
    public static function customerGroupNotFound(string $id): self
15
    {
16
        return new self(
17
            Response::HTTP_BAD_REQUEST,
18
            self::CUSTOMER_GROUP_NOT_FOUND,
19
            'Customer group with id "{{ id }}" not found',
20
            ['id' => $id]
21
        );
22
    }
23
}
24