ServerException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: famoser
5
 * Date: 07.11.2016
6
 * Time: 11:12
7
 */
8
9
namespace Famoser\XKCDCache\Exceptions;
10
11
12
use Exception;
13
use Famoser\XKCDCache\Types\ServerError;
14
15
/**
16
 * a server exception occurs, if a critical action on the server fails (like saving to the database)
17
 * but the user has no way of changing anything of that behaviour. The user should not receive an unhelpful
18
 * error message, but rather a 'sorry, but we can't continue' kind of behaviour
19
 * @package Famoser\XKCDCache\Exceptions
20
 */
21
class ServerException extends Exception
22
{
23
    /**
24
     * ServerException constructor.
25
     * @param int $serverError
26
     */
27 2
    public function __construct(int $serverError)
28
    {
29 2
        parent::__construct(ServerError::toString($serverError), $serverError, null);
30 2
    }
31
}
32