Completed
Pull Request — master (#1653)
by Aristeides
05:03 queued 02:40
created

Kirki_Field_Dimension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A set_type() 0 5 1
A sanitize() 0 3 1
1
<?php
2
/**
3
 * Override field methods
4
 *
5
 * @package     Kirki
6
 * @subpackage  Controls
7
 * @copyright   Copyright (c) 2017, Aristeides Stathopoulos
8
 * @license     http://opensource.org/licenses/https://opensource.org/licenses/MIT
9
 * @since       2.3.2
10
 */
11
12
/**
13
 * Field overrides.
14
 */
15
class Kirki_Field_Dimension extends Kirki_Field {
16
17
	/**
18
	 * Sets the control type.
19
	 *
20
	 * @access protected
21
	 */
22
	protected function set_type() {
23
24
		$this->type = 'kirki-dimension';
25
26
	}
27
28
	/**
29
	 * Sanitizes the value.
30
	 *
31
	 * @access public
32
	 * @param string $value The value.
33
	 * @return string
34
	 */
35
	public function sanitize( $value ) {
36
		return Kirki_Sanitize_Values::css_dimension( $value );
37
	}
38
}
39