WrongStatusException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Pagantis\ModuleUtils\Exception;
4
5
/**
6
 * Class WrongStatusException
7
 *
8
 * @package Pagantis\ModuleUtils\Exception
9
 */
10
class WrongStatusException extends AbstractException
11
{
12
    /**
13
     * ERROR_MESSAGE
14
     */
15
    const ERROR_MESSAGE = 'Order status is not authorized. Current status: %s';
16
17
    /**
18
     * ERROR_CODE
19
     */
20
    const ERROR_CODE = 403;
21
22
    /**
23
     * WrongStatusException constructor.
24
     *
25
     * @param $currentStatus
26
     */
27
    public function __construct($currentStatus)
28
    {
29
        $this->code = self::ERROR_CODE;
30
        $this->message = sprintf(self::ERROR_MESSAGE, $currentStatus);
31
32
        return parent::__construct($this->getMessage(), $this->getCode());
33
    }
34
}
35