Passed
Push — master ( 17e6cc...350d8b )
by Aleksandr
41:29 queued 06:24
created

NotNullConstraint   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 8
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 6 2
1
<?php
2
3
namespace Kuperwood\Eav\Validation\Constraints;
4
5
use Kuperwood\Eav\Interfaces\ConstraintInterface;
6
7
class NotNullConstraint implements ConstraintInterface
8
{
9
    public function validate($value): ?string
10
    {
11
        if ($value === null) {
12
            return "This value cannot be null.";
13
        }
14
        return null;
15
    }
16
}
17