Passed
Push — trunk ( ccf801...a9c55d )
by Christian
09:47 queued 12s
created

ThemeException::themeMediaStillInUse()   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
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Storefront\Theme\Exception;
4
5
use Shopware\Core\Framework\HttpException;
6
use Shopware\Core\Framework\Log\Package;
7
use Symfony\Component\HttpFoundation\Response;
8
9
#[Package('storefront')]
10
class ThemeException extends HttpException
11
{
12
    public const THEME_MEDIA_IN_USE_EXCEPTION = 'THEME__MEDIA_IN_USE_EXCEPTION';
13
14
    public static function themeMediaStillInUse(): self
15
    {
16
        return new self(
17
            Response::HTTP_BAD_REQUEST,
18
            self::THEME_MEDIA_IN_USE_EXCEPTION,
19
            'Media entity is still in use by a theme'
20
        );
21
    }
22
}
23