Completed
Push — master ( a0145b...6ac3b6 )
by Andrii
11:55
created

SystemError   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getData() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace hiapi\exceptions;
5
6
use Throwable;
7
8
/**
9
 * SystemError for unprocessable exceptions.
10
 * Keeps additional data.
11
 */
12
class SystemError extends \RuntimeException
13
{
14
    /** @var mixed */
15
    private $data;
16
17
    public function __construct($data, Throwable $previous = null, int $code = 0)
18
    {
19
        parent::__construct('System error', $code, $previous);
20
        $this->data = $data;
21
    }
22
23
    public function getData()
24
    {
25
        return $this->data;
26
    }
27
}
28