Passed
Push — master ( 76b76b...ca78d8 )
by Edward
02:11
created

EncodingFailedException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 3 1
A __construct() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Remorhaz\JSON\Data\Export\Exception;
5
6
use LogicException;
7
use Throwable;
8
9
final class EncodingFailedException extends LogicException implements ExceptionInterface
10
{
11
12
    private $data;
13
14
    public function __construct($data, Throwable $previous = null)
15
    {
16
        $this->data = $data;
17
        parent::__construct("Failed to encode data to JSON", 0, $previous);
18
    }
19
20
    public function getData()
21
    {
22
        return $this->data;
23
    }
24
}
25