TransportException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 31
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getCategory() 0 4 1
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