ValidatorCollection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A current() 0 3 1
A append() 0 6 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Del\Form\Collection;
6
7
use Del\Form\Validator\ValidatorInterface;
8
use InvalidArgumentException;
9
10
class ValidatorCollection extends AbstractCollection implements CollectionInterface
11
{
12 27
    public function append(mixed $validator): void
13
    {
14 27
        if (!$validator instanceof ValidatorInterface) {
15 1
            throw new InvalidArgumentException('You can only append a Del\Form\Validator\ValidatorInterface.');
16
        }
17 26
        parent::append($validator);
18
    }
19
20 24
    public function current(): mixed
21
    {
22 24
        return parent::current();
23
    }
24
}
25