Completed
Push — master ( 14c945...6811c1 )
by Henry
05:37
created

Number   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 17
ccs 0
cts 2
cp 0
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
6
/**
7
 * children class to filter the number
8
 *
9
 * @since 4.0.0
10
 *
11
 * @package Redaxscript
12
 * @category Filter
13
 * @author Henry Ruhs
14
 */
15
16
class Number implements FilterInterface
17
{
18
	/**
19
	 * sanitize the number
20
	 *
21
	 * @since 4.0.0
22
	 *
23
	 * @param string $number
24
	 *
25
	 * @return int
26
	 */
27
28
	public function sanitize(string $number = null) : int
29
	{
30
		return (int)filter_var($number, FILTER_SANITIZE_NUMBER_INT);
31
	}
32
}
33