Completed
Branch BUG-10738-inconsistency-in-ses... (860590)
by
unknown
45:05 queued 33:37
created

InvalidStatusException::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 9

Duplication

Lines 14
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
eloc 9
nc 2
nop 5
dl 14
loc 14
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace EventEspresso\core\exceptions;
4
5
use Exception;
6
use InvalidArgumentException;
7
8
9 View Code Duplication
class InvalidStatusException extends InvalidArgumentException
10
{
11
    /**
12
     * InvalidStatusException constructor.
13
     * @param string $status the invalid status id that was supplied
14
     * @param string $domain the name of the domain, model, or class that the status belongs to
15
     * @param string $message custom message
16
     * @param int $code
17
     * @param Exception|null $previous
18
     */
19
    public function __construct($status, $domain, $message = '', $code = 0, Exception $previous = null)
20
    {
21
        if (empty($message)) {
22
            $message = sprintf(
23
                __(
24
                    '"%1$s" is not a valid %2$s status',
25
                    'event_espresso'
26
                ),
27
                $status,
28
                $domain
29
            );
30
        }
31
        parent::__construct($message, $code, $previous);
32
    }
33
}
34