Completed
Push — master ( dc8f37...8770f3 )
by Henry
15:26 queued 05:23
created

Text   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

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 trim;
6
7
/**
8
 * children class to filter the text
9
 *
10
 * @since 4.3.0
11
 *
12
 * @package Redaxscript
13
 * @category Filter
14
 * @author Henry Ruhs
15
 */
16
17
class Text implements FilterInterface
18
{
19
	/**
20
	 * sanitize the text
21
	 *
22
	 * @since 4.3.0
23
	 *
24
	 * @param int|string $text text to be sanitized
25
	 *
26
	 * @return string
27
	 */
28
29
	public function sanitize($text = null) : ?string
30
	{
31
		return (string)trim(filter_var($text, FILTER_SANITIZE_STRING)) ? : null;
32
	}
33
}
34