HttpException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 4
1
<?php
2
3
namespace TelegramBot\Api;
4
5
/**
6
 * Class HttpException
7
 *
8
 * @codeCoverageIgnore
9
 * @package TelegramBot\Api
10
 */
11
class HttpException extends Exception
12
{
13
    /**
14
     * @var array
15
     */
16
    protected $parameters = [];
17
18
    /**
19
     * HttpException constructor.
20
     *
21
     * @param string $message [optional] The Exception message to throw.
22
     * @param int $code [optional] The Exception code.
23
     * @param \Throwable|\Exception $previous [optional] The previous throwable used for the exception chaining.
24
     * @param array $parameters [optional] Array of parameters returned from API.
25
     */
26
    public function __construct($message = '', $code = 0, $previous = null, $parameters = [])
27
    {
28
        $this->parameters = $parameters;
29
30
        parent::__construct($message, $code, $previous);
31
    }
32
33
    /**
34
     * @return array
35
     */
36
    public function getParameters()
37
    {
38
        return $this->parameters;
39
    }
40
}
41