Completed
Push — master ( aaff7d...f806fe )
by Sullivan
03:03
created

InvalidRequestPropertiesException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 3
1
<?php
2
3
namespace Nexy\PayboxDirect\Exception;
4
5
use Nexy\PayboxDirect\Request\RequestInterface;
6
use Symfony\Component\Validator\ConstraintViolationListInterface;
7
8
/**
9
 * @author Sullivan Senechal <[email protected]>
10
 */
11
final class InvalidRequestPropertiesException extends \LogicException
12
{
13
    /**
14
     * @var ConstraintViolationListInterface
15
     */
16
    private $errors;
17
18
    /**
19
     * InvalidRequestPropertiesException constructor.
20
     *
21
     * @param RequestInterface                 $request
22
     * @param ConstraintViolationListInterface $errors
23
     * @param \Exception                       $previous
24
     */
25
    public function __construct(RequestInterface $request, ConstraintViolationListInterface $errors, \Exception $previous = null)
26
    {
27
        parent::__construct('', 0, $previous);
28
29
        $this->message = PHP_EOL.(string) $errors;
30
        $this->errors = $errors;
31
    }
32
33
    /**
34
     * @return ConstraintViolationListInterface
35
     */
36
    public function getErrors()
37
    {
38
        return $this->errors;
39
    }
40
}
41