Passed
Push — trunk ( e136f9...a572a3 )
by Christian
13:15 queued 22s
created

UserException::salesChannelNotFound()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\System\User;
4
5
use Shopware\Core\Framework\HttpException;
6
use Shopware\Core\Framework\Log\Package;
7
use Symfony\Component\HttpFoundation\Response;
8
9
#[Package('system-settings')]
10
class UserException extends HttpException
11
{
12
    final public const SALES_CHANNEL_NOT_FOUND = 'USER__SALES_CHANNEL_NOT_FOUND';
13
14
    public static function salesChannelNotFound(): HttpException
15
    {
16
        return new self(
17
            Response::HTTP_PRECONDITION_FAILED,
18
            self::SALES_CHANNEL_NOT_FOUND,
19
            'No sales channel found.',
20
        );
21
    }
22
}
23