Passed
Push — master ( 8ec95c...ad8656 )
by Jean-Christophe
05:01
created

IsEmptyValidator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 4
dl 0
loc 15
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getParameters() 0 2 1
A __construct() 0 2 1
A validate() 0 2 1
1
<?php
2
3
namespace Ubiquity\contents\validation\validators\basic;
4
5
use Ubiquity\contents\validation\validators\Validator;
6
7
class IsEmptyValidator extends Validator {
8
	
9 1
	public function __construct(){
10 1
		$this->message="This value should be empty";
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 1
	public function getParameters(): array {
21 1
		return ["value"];
22
	}
23
}
24
25