Code Duplication    Length = 8-8 lines in 2 locations

core/Field/Predefined_Options_Field.php 2 locations

@@ 25-32 (lines=8) @@
22
	 *
23
	 * @param array|callable $options
24
	 */
25
	public function set_options( $options ) {
26
		if ( !is_callable( $options ) && !is_array( $options ) ) {
27
			Incorrect_Syntax_Exception::raise( 'Only arrays and callbacks are allowed in the <code>set_options()</code> method.' );
28
		}
29
30
		$this->option_collections = array();
31
		return $this->add_options( $options );
32
	}
33
34
	/**
35
	 * Add new options to this field.
@@ 40-47 (lines=8) @@
37
	 *
38
	 * @param array|callable $options
39
	 */
40
	public function add_options( $options ) {
41
		if ( !is_callable( $options ) && !is_array( $options ) ) {
42
			Incorrect_Syntax_Exception::raise( 'Only arrays and callbacks are allowed in the <code>add_options()</code> method.' );
43
		}
44
45
		$this->option_collections[] = $options;
46
		return $this;
47
	}
48
49
	/**
50
	 * Check if there are callbacks and populate the options