ServiceUnavailableException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 3
1
<?php
2
3
namespace App\ExchangeRates\Exception;
4
5
use RuntimeException;
6
use Throwable;
7
8
class ServiceUnavailableException extends RuntimeException
9
{
10
    /**
11
     * ServiceUnavailableException constructor.
12
     *
13
     * @param string         $message
14
     * @param int            $code
15
     * @param Throwable|null $previous
16
     */
17
    public function __construct(string $message = '', int $code = 500, Throwable $previous = null)
18
    {
19
        if (empty($message)) {
20
            $message = 'Service temporarily unavailable. Please try again later.';
21
        }
22
23
        parent::__construct($message, $code, $previous);
24
    }
25
}
26