Passed
Push — master ( acf3f9...98cfe3 )
by Derek Stephen
03:04
created

ValidatorAdapterZf::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Del\Form\Validator\Adapter;
4
5
use Del\Form\Validator\ValidatorInterface;
6
use Exception;
7
use Laminas\Validator\ValidatorInterface as LaminasValidatorInterface;
8
9
class ValidatorAdapterZf implements ValidatorInterface
10
{
11
    private $validator;
12
13
    /**
14
     * ValidatorAdapterZf constructor.
15
     */
16 12
    public function __construct(LaminasValidatorInterface $validator)
17
    {
18 12
        $this->validator = $validator;
19 12
    }
20
21
    /**
22
     * @param  mixed $value
23
     * @return bool
24
     * @throws Exception If validation of $value is impossible
25
     */
26 9
    public function isValid($value)
27
    {
28 9
        return $this->validator->isValid($value);
29
    }
30
31
    /**
32
     * @return array
33
     */
34 6
    public function getMessages()
35
    {
36 6
        return $this->validator->getMessages();
37
    }
38
39
40
}