Passed
Push — master ( 3592a4...bf89a7 )
by Jean-Christophe
05:06
created

LessThanValidator::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\comparison;
4
5
use Ubiquity\contents\validation\validators\ValidatorHasNotNull;
6
7
class LessThanValidator extends ValidatorHasNotNull {
8
	
9
	protected $ref;
10 1
	public function __construct(){
11 1
		$this->message="This value should be smaller than `{ref}`";
12 1
	}
13 1
	public function validate($value) {
14 1
		parent::validate($value);
15 1
		return $value<$this->ref;
16
	}
17
	/**
18
	 * {@inheritDoc}
19
	 * @see \Ubiquity\contents\validation\validators\Validator::getParameters()
20
	 */
21 1
	public function getParameters(): array {
22 1
		return ["ref","value"];
23
	}
24
25
}
26
27