Passed
Push — master ( ee4606...24a9ec )
by Jean-Christophe
06:42
created

IsNullValidator::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 2
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Ubiquity\contents\validation\validators\basic;
4
5
use Ubiquity\contents\validation\validators\Validator;
6
7
class IsNullValidator extends Validator {
8
	
9 1
	public function __construct(){
10 1
		$this->message="This value should be null";
11 1
	}
12 1
	public function validate($value) {
13 1
		return $value===null;
14
	}
15
	
16
	/**
17
	 * {@inheritDoc}
18
	 * @see \Ubiquity\contents\validation\validators\Validator::getParameters()
19
	 */
20
	public function getParameters(): array {
21
		return ["value"];
22
	}
23
}
24
25