KickBoxApiException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 6
nc 1
nop 4
crap 1
1
<?php
2
3
/*
4
 * This file is part of the Kickbox Bundle.
5
 *
6
 * (c) Abdoul Ndiaye <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Andi\KickBoxBundle\Exception;
13
14
use GuzzleHttp\Exception\BadResponseException;
15
use Psr\Http\Message\RequestInterface;
16
use Psr\Http\Message\ResponseInterface;
17
18
/**
19
 * Exception thrown if a kickbox api call has not a 2xx http status code.
20
 *
21
 * @author Abdoul Ndiaye <[email protected]>
22
 */
23
class KickBoxApiException extends BadResponseException
24
{
25
    const MESSAGE = 'An error occurred during the api call : ';
26
27
    /**
28
     * {@inheritdoc}
29
     */
30 2
    public function __construct(
31
        $message,
32
        RequestInterface $request,
33
        ResponseInterface $response = null,
34
        \Exception $previous = null
35
    ) {
36 2
        parent::__construct(self::MESSAGE . $message, $request, $response, $previous);
37 2
    }
38
}
39