HttpException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 2
b 0
f 0
dl 0
loc 28
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getParameters() 0 3 1
A __construct() 0 5 1
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