ServiceUnavailableException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
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