Completed
Push — master ( 3830bc...2c9d17 )
by Samuel
02:31
created

ValidationFailedException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Kelemen\ApiNette\Exception;
4
5
use Kelemen\ApiNette\Validator\ValidatorInterface;
6
7
class ValidationFailedException extends ApiNetteException
8
{
9
    /** @var ValidatorInterface */
10
    private $validator;
11
12
    /**
13
     * @param ValidatorInterface $validator
14
     */
15 2
    public function __construct(ValidatorInterface $validator)
16
    {
17 2
        parent::__construct("", 0, null);
18 2
        $this->validator = $validator;
19 2
    }
20
21
    /**
22
     * @return ValidatorInterface
23
     */
24 2
    public function getValidator()
25
    {
26 2
        return $this->validator;
27
    }
28
}
29