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

RequiredConstraint::validate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

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