Completed
Push — master ( 587f5e...7e0186 )
by Jean-Christophe
04:40
created

EmailValidator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
namespace Ubiquity\contents\validation\validators\strings;
4
5
/**
6
 * Validates an email address
7
 * Usage @validator("email")
8
 * @author jc
9
 * @version 1.0.0
10
 */
11
class EmailValidator extends RegexValidator {
12
	
13 1
	public function __construct(){
14 1
		$this->message="{value} is not a valid email address";
15 1
		$this->ref="/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$/i";
16 1
		$this->match=true;
17 1
	}
18
}
19
20