Passed
Push — trunk ( 325349...f71779 )
by Christian
12:37 queued 16s
created

ElasticsearchProductException::configNotFound()   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\Elasticsearch\Product;
4
5
use Shopware\Core\Framework\HttpException;
6
use Shopware\Core\Framework\Log\Package;
7
use Symfony\Component\HttpFoundation\Response;
8
9
#[Package('core')]
10
class ElasticsearchProductException extends HttpException
11
{
12
    public const ES_PRODUCT_CONFIG_NOT_FOUND = 'ELASTICSEARCH_PRODUCT__CONFIGURATION_NOT_FOUND';
13
14
    public static function configNotFound(): self
15
    {
16
        return new self(
17
            Response::HTTP_INTERNAL_SERVER_ERROR,
18
            self::ES_PRODUCT_CONFIG_NOT_FOUND,
19
            'Configuration for product elasticsearch definition not found',
20
        );
21
    }
22
}
23