TransportException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 3
1
<?php
2
3
/*
4
 * A PSR7 aware cURL client (https://github.com/juliangut/spiral).
5
 *
6
 * @license BSD-3-Clause
7
 * @link https://github.com/juliangut/spiral
8
 * @author Julián Gutiérrez <[email protected]>
9
 */
10
11
namespace Jgut\Spiral\Exception;
12
13
/**
14
 * Transport exception.
15
 */
16
class TransportException extends \RuntimeException
17
{
18
    /**
19
     * @var string
20
     */
21
    protected $category;
22
23
    /**
24
     * TransportException constructor.
25
     *
26
     * @param string $message
27
     * @param int    $code
28
     * @param string $category
29
     */
30
    public function __construct($message, $code = 0, $category = '')
31
    {
32
        parent::__construct($message, $code);
33
34
        $this->category = trim($category);
35
    }
36
37
    /**
38
     * Retrieve category.
39
     *
40
     * @return string
41
     */
42
    public function getCategory()
43
    {
44
        return $this->category;
45
    }
46
}
47