Completed
Push — master ( 92cdcd...79386d )
by Zack
20:40 queued 10:41
created

GravityView_Admin_View_Field   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 42
rs 10
wmc 4
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
B additional_info() 0 36 4
1
<?php
2
/**
3
 * @file class-gravityview-admin-view-field.php
4
 * @since 1.17.3
5
 */
6
7
class GravityView_Admin_View_Field extends GravityView_Admin_View_Item {
8
9
	protected $label_type = 'field';
10
11
	protected function additional_info() {
12
13
		$field_info = '';
14
15
		$field_info_items = array();
16
17
		// Fields with IDs, not like Source URL or Entry ID
18
		if( is_numeric( $this->id ) ) {
19
20
			$field_type_title = GFCommon::get_field_type_title( $this->item['input_type'] );
21
22
			$field_info_items[] = array(
23
				'value' => sprintf( __('Type: %s', 'gravityview'), $field_type_title )
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after opening bracket; 0 found
Loading history...
Coding Style introduced by
Expected 1 spaces before closing bracket; 0 found
Loading history...
24
			);
25
26
			$field_info_items[] = array(
27
				'value' => sprintf( __('Field ID: %s', 'gravityview'), $this->id ),
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after opening bracket; 0 found
Loading history...
Coding Style introduced by
Expected 1 spaces before closing bracket; 0 found
Loading history...
28
			);
29
30
		}
31
32
		if( !empty( $this->item['desc'] ) ) {
0 ignored issues
show
introduced by
Expected 1 space after "!"; 0 found
Loading history...
33
			$field_info_items[] = array(
34
				'value' => $this->item['desc']
0 ignored issues
show
introduced by
Each line in an array declaration must end in a comma
Loading history...
35
			);
36
		}
37
38
		if( !empty( $this->item['adminLabel'] ) ) {
0 ignored issues
show
introduced by
Expected 1 space after "!"; 0 found
Loading history...
39
			$field_info_items[] = array(
40
				'value' => sprintf( __('Admin Label: %s', 'gravityview' ), $this->item['adminLabel'] ),
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after opening bracket; 0 found
Loading history...
41
				'class'	=> 'gv-sublabel'
0 ignored issues
show
introduced by
Each line in an array declaration must end in a comma
Loading history...
42
			);
43
		}
44
45
		return $field_info_items;
46
	}
47
48
}
49