Code Duplication    Length = 10-12 lines in 4 locations

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.

core/Field/Gravity_Form_Field.php 1 location

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

core/Field/Radio_Image_Field.php 1 location

@@ 62-71 (lines=10) @@
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
		$this->load_options();
65
66
		$field_data = array_merge( $field_data, array(
67
			'options' => $this->parse_options( $this->options ),
68
		) );
69
70
		return $field_data;
71
	}
72
73
	/**
74
     * The main Underscore template of this field.