RequiredValidator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 12
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 7 2
1
<?php declare(strict_types=1);
2
3
namespace indigerd\scenarios\validation\validator;
4
5
class RequiredValidator extends AbstractValidator
6
{
7
    protected $message = 'Value is required';
8
9 3
    public function validate($value, array $context = []): bool
10
    {
11 3
        if (empty($value)) {
12 2
            return false;
13
        }
14 3
        return true;
15
    }
16
}
17