Passed
Pull Request — new-parser-ast-metadata (#3)
by
unknown
03:27
created

RequiredConstraint   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 4 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Annotations\Metadata\Constraint;
6
7
final class RequiredConstraint implements Constraint
8
{
9
    /**
10
     * @param mixed $value
11
     */
12 3
    public function validate($value) : void
13
    {
14 3
        if ($value === null) {
15 2
            throw MissingRequiredValue::new();
16
        }
17 2
    }
18
}
19