IsFalseValidator   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
eloc 7
c 0
b 0
f 0
dl 0
loc 21
ccs 0
cts 9
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A getParameters() 0 2 1
A validate() 0 6 2
1
<?php
2
3
namespace Ubiquity\contents\validation\validators\basic;
4
5
use Ubiquity\utils\base\UString;
6
use Ubiquity\contents\validation\validators\ValidatorHasNotNull;
7
8
class IsFalseValidator extends ValidatorHasNotNull {
9
10
	public function __construct() {
11
		$this->message = "This value should return false";
12
	}
13
14
	public function validate($value) {
15
		parent::validate ( $value );
16
		if ($this->notNull !== false) {
17
			return UString::isBooleanFalse ( $value );
18
		}
19
		return true;
20
	}
21
22
	/**
23
	 *
24
	 * {@inheritdoc}
25
	 * @see \Ubiquity\contents\validation\validators\Validator::getParameters()
26
	 */
27
	public function getParameters(): array {
28
		return [ "value" ];
29
	}
30
}
31
32