Number   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
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 2
	public function sanitize(string $number = null) : int
29
	{
30 2
		return (int)filter_var($number, FILTER_SANITIZE_NUMBER_INT);
31
	}
32
}
33