Completed
Push — master ( 2ed5ca...76d54c )
by Joachim
04:02
created

UnexpectedStatusException::getActualStatus()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Setono\SyliusStockMovementPlugin\Exception;
6
7
use InvalidArgumentException;
8
use Safe\Exceptions\StringsException;
9
use function Safe\sprintf;
10
11
final class UnexpectedStatusException extends InvalidArgumentException implements ExceptionInterface
12
{
13
    /** @var string */
14
    private $actualStatus;
15
16
    /** @var string */
17
    private $expectedStatus;
18
19
    /**
20
     * @throws StringsException
21
     */
22
    public function __construct(string $actualStatus, string $expectedStatus)
23
    {
24
        $this->actualStatus = $actualStatus;
25
        $this->expectedStatus = $expectedStatus;
26
27
        $message = sprintf(
28
            'Unexpected status. Status was "%s". Expected status was "%s"',
29
            $this->actualStatus,
30
            $this->expectedStatus
31
        );
32
33
        parent::__construct($message);
34
    }
35
36
    public function getActualStatus(): string
37
    {
38
        return $this->actualStatus;
39
    }
40
41
    public function getExpectedStatus(): string
42
    {
43
        return $this->expectedStatus;
44
    }
45
}
46