Completed
Push — master ( e15c58...b150a8 )
by Changwan
07:08
created

InternalServerErrorException::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 2
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace Wandu\Http\Exception;
3
4
use Psr\Http\Message\ResponseInterface;
5
use Wandu\Http\Psr\Response;
6
7
class InternalServerErrorException extends HttpException
8
{
9
    /**
10
     * @param \Psr\Http\Message\ResponseInterface $response
11
     * @param array $attributes
12
     */
13 4
    public function __construct(
14
        ResponseInterface $response = null,
15
        array $attributes = []
16
    ) {
17 4
        $response = $response ?: new Response();
18 4
        parent::__construct($response->withStatus(500), $attributes);
19 4
    }
20
}
21