ValidatorCollection::current()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 1
c 2
b 1
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
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