Passed
Push — master ( 0568ea...74fbac )
by Jean-Christophe
05:35
created

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