ValidatorAdapterZf::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 0
c 2
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
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