Passed
Push — trunk ( d8cd01...b6c024 )
by Christian
13:44 queued 12s
created

StateMachineNotFoundException::getStatusCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\System\StateMachine\Exception;
4
5
use Shopware\Core\Framework\Feature;
6
use Shopware\Core\Framework\Log\Package;
7
use Shopware\Core\System\StateMachine\StateMachineException;
8
use Symfony\Component\HttpFoundation\Response;
9
10
/**
11
 * @deprecated tag:v6.6.0 - will be removed, use StateMachineException::stateMachineNotFound instead
12
 */
13
#[Package('checkout')]
14
class StateMachineNotFoundException extends StateMachineException
15
{
16
    public function __construct(string $stateMachineName)
17
    {
18
        Feature::triggerDeprecationOrThrow(
19
            'v6.6.0.0',
20
            Feature::deprecatedClassMessage(self::class, 'v6.6.0.0', 'use StateMachineException::stateMachineNotFound instead')
21
        );
22
23
        parent::__construct(
24
            Response::HTTP_BAD_REQUEST,
25
            self::STATE_MACHINE_NOT_FOUND,
26
            'The StateMachine named "{{ name }}" was not found.',
27
            ['name' => $stateMachineName]
28
        );
29
    }
30
}
31