HttpException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 4
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the dingtalk.
4
 * User: Ilham Tahir <[email protected]>
5
 * This source file is subject to the MIT license that is bundled
6
 * with this source code in the file LICENSE.
7
 */
8
9
namespace Aplisin\DingTalk\Kernel\Exceptions;
10
11
use Psr\Http\Message\ResponseInterface;
12
13
class HttpException extends Exception
14
{
15
    public $response;
16
17
    public $formattedResponse;
18
19
    public function __construct($message, ResponseInterface $response = null, $formattedResponse = null, $code = null)
20
    {
21
        parent::__construct($message, $code);
22
23
        $this->response = $response;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 10 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
24
        $this->formattedResponse = $formattedResponse;
25
26
        if ($response) {
27
            $response->getBody()->rewind();
28
        }
29
    }
30
}
31