ValidatorAdapterZf   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 3
c 2
b 0
f 0
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getMessages() 0 3 1
A isValid() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Del\Form\Validator\Adapter;
6
7
use Del\Form\Validator\ValidatorInterface;
8
use Exception;
9
use Laminas\Validator\ValidatorInterface as LaminasValidatorInterface;
10
11
class ValidatorAdapterZf implements ValidatorInterface
12
{
13 13
    public function __construct(
14
        private LaminasValidatorInterface $validator
15 13
    ) {}
16
17
    /**
18
     * @todo exception types
19
     * @throws Exception If validation of $value is impossible
20
     */
21 10
    public function isValid(mixed $value): bool
22
    {
23 10
        return $this->validator->isValid($value);
24
    }
25
26 6
    public function getMessages(): array
27
    {
28 6
        return $this->validator->getMessages();
29
    }
30
31
32
}
33