Url   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

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