Passed
Push — master ( d41f3d...32d286 )
by Edward
02:22
created

UnexpectedEntityException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

2 Methods

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