Completed
Push — develop ( 6a0b8a...755a17 )
by Daniel
07:17
created

number::get_field_value()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
/**
3
 *
4
 * @package sitemaker
5
 * @copyright (c) 2013 Daniel A. (blitze)
6
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
7
 *
8
 */
9
10
namespace blitze\content\services\form\field;
11
12
class number extends base
13
{
14
	/**
15
	 * @inheritdoc
16
	 */
17 3
	public function get_field_value($name, $value)
18
	{
19 3
		return $this->request->variable($name, (int) $value);
20
	}
21
22
	/**
23
	 * @inheritdoc
24
	 */
25 4
	public function get_default_props()
26
	{
27
		return array(
28 4
			'min'	=> 0,
29 4
			'max'	=> 0,
30 4
			'step'	=> 1,
31 4
			'size'	=> 10,
32 4
		);
33
	}
34
35
	/**
36
	 * @inheritdoc
37
	 */
38 5
	public function get_name()
39
	{
40 5
		return 'number';
41
	}
42
}
43