Passed
Push — trunk ( ee04ee...d8d59f )
by Christian
13:00 queued 13s
created

CustomTriggerByNameNotFoundException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getStatusCode() 0 3 1
A getErrorCode() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\Content\Flow\Exception;
4
5
use Shopware\Core\Framework\Log\Package;
6
use Shopware\Core\Framework\ShopwareHttpException;
7
use Symfony\Component\HttpFoundation\Response;
8
9
/**
10
 * @internal
11
 */
12
#[Package('business-ops')]
13
class CustomTriggerByNameNotFoundException extends ShopwareHttpException
14
{
15
    public function __construct(string $eventName)
16
    {
17
        parent::__construct(
18
            'The provided event name {{ eventName }} is invalid or uninstalled and no custom trigger could be found.',
19
            ['eventName' => $eventName]
20
        );
21
    }
22
23
    public function getErrorCode(): string
24
    {
25
        return 'ADMINISTRATION__CUSTOM_TRIGGER_BY_NAME_NOT_FOUND';
26
    }
27
28
    public function getStatusCode(): int
29
    {
30
        return Response::HTTP_NOT_FOUND;
31
    }
32
}
33