Email   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 17
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A sanitize() 0 4 1
1
<?php
2
namespace Redaxscript\Filter;
3
4
use function filter_var;
5
use function strtolower;
6
7
/**
8
 * children class to filter the email
9
 *
10
 * @since 2.2.0
11
 *
12
 * @package Redaxscript
13
 * @category Filter
14
 * @author Henry Ruhs
15
 */
16
17
class Email implements FilterInterface
18
{
19
	/**
20
	 * sanitize the email
21
	 *
22
	 * @since 2.2.0
23
	 *
24
	 * @param string $email email address
25
	 *
26
	 * @return string
27
	 */
28
29 4
	public function sanitize(string $email = null) : string
30
	{
31 4
		return filter_var(strtolower($email), FILTER_SANITIZE_EMAIL);
32
	}
33
}