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

StateMachineStateNotFoundException::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::stateMachineStateNotFound instead
12
 */
13
#[Package('checkout')]
14
class StateMachineStateNotFoundException extends StateMachineException
15
{
16
    public function __construct(
17
        string $stateMachineName,
18
        string $technicalPlaceName
19
    ) {
20
        Feature::triggerDeprecationOrThrow(
21
            'v6.6.0.0',
22
            Feature::deprecatedClassMessage(self::class, 'v6.6.0.0', 'use StateMachineException::stateMachineStateNotFound instead')
23
        );
24
25
        parent::__construct(
26
            Response::HTTP_BAD_REQUEST,
27
            self::STATE_MACHINE_STATE_NOT_FOUND,
28
            'The place "{{ place }}" for state machine named "{{ stateMachine }}" was not found.',
29
            [
30
                'place' => $technicalPlaceName,
31
                'stateMachine' => $stateMachineName,
32
            ]
33
        );
34
    }
35
}
36