Code Duplication    Length = 4-4 lines in 2 locations

core/Field/Complex_Field.php 2 locations

@@ 222-225 (lines=4) @@
219
		}
220
221
		foreach ( $fields as $field ) {
222
			if ( $field->get_base_name() === Value_Set::VALUE_PROPERTY ) {
223
				Incorrect_Syntax_Exception::raise( '"' . Value_Set::VALUE_PROPERTY . '" is a reserved keyword for Complex fields and cannot be used for a field name.' );
224
				return $this;
225
			}
226
			if ( $field->get_base_name() === static::TYPE_PROPERTY ) {
227
				Incorrect_Syntax_Exception::raise( '"' . static::TYPE_PROPERTY . '" is a reserved keyword for Complex fields and cannot be used for a field name.' );
228
				return $this;
@@ 226-229 (lines=4) @@
223
				Incorrect_Syntax_Exception::raise( '"' . Value_Set::VALUE_PROPERTY . '" is a reserved keyword for Complex fields and cannot be used for a field name.' );
224
				return $this;
225
			}
226
			if ( $field->get_base_name() === static::TYPE_PROPERTY ) {
227
				Incorrect_Syntax_Exception::raise( '"' . static::TYPE_PROPERTY . '" is a reserved keyword for Complex fields and cannot be used for a field name.' );
228
				return $this;
229
			}
230
		}
231
232
		$group = new Group_Field( $name, $label, $fields );