Completed
Push — master ( 645e2d...f9b1bd )
by Adam
02:34
created

ExceptionWithData   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 25
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getData() 0 4 1
1
<?php
2
3
namespace PhpJsonRpc\Server\Error\Exception;
4
5
class ExceptionWithData extends \Exception
6
{
7
    /**
8
     * @var mixed|null
9
     */
10
    protected $data;
11
12
    /**
13
     * @param mixed|null $data
14
     */
15 18
    public function __construct($data = null)
16
    {
17 18
        parent::__construct($this->getMessage(), $this->getCode());
18
19 18
        $this->data = $data;
20 18
    }
21
22
    /**
23
     * @return mixed|null
24
     */
25
    public function getData()
26
    {
27
        return $this->data;
28
    }
29
}
30