_Integer::validate()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
eloc 2
nc 2
nop 1
1
<?php
2
3
/**
4
 * @package Cadmium\System\Utils
5
 * @author Anton Romanov
6
 * @copyright Copyright (c) 2015-2017, Anton Romanov
7
 * @link http://cadmium-cms.com
8
 */
9
10
namespace Utils\Schema {
11
12
	class _Integer {
13
14
		/**
15
		 * Validate a value
16
		 *
17
		 * @return int|null : the validated value or null on failure
18
		 */
19
20
		public function validate($value) {
21
22
			return (is_scalar($value) ? intval($value) : null);
23
		}
24
	}
25
}
26