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

ElasticsearchProductException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 11
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A configNotFound() 0 6 1
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