Code Duplication    Length = 10-12 lines in 3 locations

core/Field/Gravity_Form_Field.php 1 location

@@ 62-72 (lines=11) @@
59
	 * @param bool $load  Should the value be loaded from the database or use the value from the current instance.
60
	 * @return array
61
	 */
62
	public function to_json( $load ) {
63
		$field_data = parent::to_json( $load );
64
65
		$this->set_options( apply_filters( 'crb_gravity_form_options', $this->options ) );
66
67
		$field_data = array_merge( $field_data, array(
68
			'options' => $this->parse_options( $this->options ),
69
		) );
70
71
		return $field_data;
72
	}
73
74
	/**
75
	 * The main Underscore template of this field.

core/Field/Select_Field.php 1 location

@@ 16-25 (lines=10) @@
13
	 * @param bool $load  Should the value be loaded from the database or use the value from the current instance.
14
	 * @return array
15
	 */
16
	public function to_json( $load ) {
17
		$field_data = parent::to_json( $load );
18
		$this->load_options();
19
20
		$field_data = array_merge( $field_data, array(
21
			'options' => $this->parse_options( $this->options ),
22
		) );
23
24
		return $field_data;
25
	}
26
27
	/**
28
	 * The main Underscore template of this field.

core/Field/Set_Field.php 1 location

@@ 54-65 (lines=12) @@
51
	 * @param bool $load  Should the value be loaded from the database or use the value from the current instance.
52
	 * @return array
53
	 */
54
	public function to_json( $load ) {
55
		$field_data = parent::to_json( $load );
56
57
		$this->load_options();
58
59
		$field_data = array_merge( $field_data, array(
60
			'limit_options' => $this->limit_options,
61
			'options' => $this->parse_options( $this->options ),
62
		) );
63
64
		return $field_data;
65
	}
66
67
	/**
68
	 * The Underscore template of this field.