Completed
Push — master ( 74929b...718547 )
by Tobias
03:47
created

GenericHTTPError::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 5
crap 1
1
<?php
2
3
/*
4
 * Copyright (C) 2013-2016 Mailgun
5
 *
6
 * This software may be modified and distributed under the terms
7
 * of the MIT license. See the LICENSE file for details.
8
 */
9
10
namespace Mailgun\Connection\Exceptions;
11
12
use Mailgun\Exception;
13
14
class GenericHTTPError extends \Exception implements Exception
15
{
16
    protected $httpResponseCode;
17
    protected $httpResponseBody;
18
19 1
    public function __construct($message = null, $response_code = null, $response_body = null, $code = 0, \Exception $previous = null)
20
    {
21 1
        parent::__construct($message, $code, $previous);
22
23 1
        $this->httpResponseCode = $response_code;
24 1
        $this->httpResponseBody = $response_body;
25 1
    }
26
27
    public function getHttpResponseCode()
28
    {
29
        return $this->httpResponseCode;
30
    }
31
32
    public function getHttpResponseBody()
33
    {
34
        return $this->httpResponseBody;
35
    }
36
}
37