CoordinateField   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A init() 0 5 2
1
<?php
2
	/**
3
	 * @package Demos
4
	 */
5
	class CoordinateField extends Field
6
	{
7
		function __construct($name, $default, $hint = 'Smart coordinate')
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
8
		{
9
			parent::__construct($name, $default, $hint);
10
		}
11
		
12
		function init($request)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
13
		{
14
			$this->value = $request->getCoordinate($this->name, $this->default);
15
			if ($this->value > 1000)
16
				$this->value = 1000;
17
		}
18
	}
19