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

SystemError::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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