Code Duplication    Length = 4-5 lines in 2 locations

core/Field/Field.php 2 locations

@@ 765-768 (lines=4) @@
762
			if ( $key === 'relation' ) {
763
				$relation = strtoupper( $rule );
764
765
				if ( ! in_array( $relation, $allowed_relations ) ) {
766
					Incorrect_Syntax_Exception::raise( 'Invalid relation type ' . $rule . '. ' .
767
						'The rule should be one of the following: "' . implode( '", "', $allowed_relations ) . '"' );
768
				}
769
770
				$parsed_rules['relation'] = $relation;
771
				continue;
@@ 784-788 (lines=5) @@
781
			if ( empty( $rule['compare'] ) ) {
782
				$rule['compare'] = '=';
783
			}
784
			if ( ! in_array( $rule['compare'], $allowed_operators ) ) {
785
				Incorrect_Syntax_Exception::raise( 'Invalid conditional logic compare operator: <code>' .
786
					$rule['compare'] . '</code><br>Allowed operators are: <code>' .
787
					implode( ', ', $allowed_operators ) . '</code>' );
788
			}
789
			if ( $rule['compare'] === 'IN' || $rule['compare'] === 'NOT IN' ) {
790
				if ( ! is_array( $rule['value'] ) ) {
791
					Incorrect_Syntax_Exception::raise( 'Invalid conditional logic value format. ' .