Passed
Push — master ( 622029...98ce94 )
by Smoren
02:10
created

RetrospectiveCheck   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 11
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 4 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Smoren\Validator\Checks;
6
7
use Smoren\Validator\Exceptions\ValidationError;
8
use Smoren\Validator\Interfaces\CheckInterface;
9
10
/**
11
 * @internal
12
 */
13
class RetrospectiveCheck implements CheckInterface
14
{
15
    /**
16
     * {@inheritDoc}
17
     *
18
     * @throws ValidationError if there are previous errors
19
     */
20 3
    public function execute($value, array $previousErrors): void
21
    {
22 3
        if (\count($previousErrors)) {
23 3
            throw ValidationError::fromCheckErrors($value, $previousErrors);
24
        }
25
    }
26
}
27