Completed
Push — master ( 8253ba...a023d2 )
by Daniel
16:49 queued 05:23
created

InvalidEntityException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getErrors() 0 3 1
1
<?php
2
3
namespace Silverback\ApiComponentBundle\Exception;
4
5
use Symfony\Component\Validator\ConstraintViolationListInterface;
6
use Throwable;
7
8
class InvalidEntityException extends \InvalidArgumentException
9
{
10
    /**
11
     * @var ConstraintViolationListInterface
12
     */
13
    private $errors;
14
15
    public function __construct(ConstraintViolationListInterface $errors, string $message = '', int $code = 0, Throwable $previous = null)
16
    {
17
        $this->errors = $errors;
18
        parent::__construct((string) $errors . '. ' . $message, $code, $previous);
19
    }
20
21
    public function getErrors()
22
    {
23
        return $this->errors;
24
    }
25
}
26