Completed
Push — master ( 68f55d...8225e8 )
by Julián
02:06
created

TransportException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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