Completed
Push — master ( f8bd36...f2dc96 )
by Jean-Christophe
01:33
created

ValidatorMultipleNotNull   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A validate() 0 7 3
1
<?php
2
3
namespace Ubiquity\contents\validation\validators\multiples;
4
5
abstract class ValidatorMultipleNotNull extends ValidatorMultiple {
6
	protected $notNull;
7
	public function __construct(){
8
		$this->message=[
9
				"notNull"=>"This value should not be null"
10
		];
11
	}
12
	
13
	public function validate($value) {
14
		if($this->notNull===true && null===$value){
15
			$this->violation="notNull";
16
			return false;
17
		}
18
		return true;
19
	}
20
21
}
22
23