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

ValidatorAdapterZf   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 28
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isValid() 0 3 1
A getMessages() 0 3 1
A __construct() 0 3 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
}