Completed
Push — master ( 1a7371...4a1bf4 )
by Stephanie
22s
created

FrmFieldPhone::sanitize_value()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @since 3.0
5
 */
6
class FrmFieldPhone extends FrmFieldType {
7
8
	/**
9
	 * @var string
10
	 * @since 3.0
11
	 */
12
	protected $type = 'phone';
13
	protected $display_type = 'text';
14
15
	/**
16
	 * @var bool
17
	 * @since 3.0
18
	 */
19
	protected $holds_email_values = true;
20
21 View Code Duplication
	protected function field_settings_for_type() {
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
22
		return array(
23
			'size'           => true,
24
			'clear_on_focus' => true,
25
			'invalid'        => true,
26
			'format'         => true,
27
		);
28
	}
29
30
	protected function html5_input_type() {
31
		$frm_settings = FrmAppHelper::get_settings();
32
33
		return $frm_settings->use_html ? 'tel' : 'text';
34
	}
35
36
	/**
37
	 * @since 4.0
38
	 */
39
	public function sanitize_value( &$value ) {
40
		FrmAppHelper::sanitize_value( 'sanitize_text_field', $value );
41
	}
42
}
43