Completed
Push — master ( a1a3b2...ba72b8 )
by Derek Stephen
07:25
created

ValidatorAdapterZf::getMessages()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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