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

InvalidEntityException::getErrors()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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