Code Duplication    Length = 4-5 lines in 2 locations

core/Field/Field.php 1 location

@@ 861-865 (lines=5) @@
858
			if ( empty( $rule['compare'] ) ) {
859
				$rule['compare'] = '=';
860
			}
861
			if ( ! in_array( $rule['compare'], $allowed_operators ) ) {
862
				Incorrect_Syntax_Exception::raise( 'Invalid conditional logic compare operator: <code>' .
863
					$rule['compare'] . '</code><br>Allowed operators are: <code>' .
864
				implode( ', ', $allowed_operators ) . '</code>' );
865
			}
866
			if ( $rule['compare'] === 'IN' || $rule['compare'] === 'NOT IN' ) {
867
				if ( ! is_array( $rule['value'] ) ) {
868
					Incorrect_Syntax_Exception::raise( 'Invalid conditional logic value format. ' .

core/Helper/Helper.php 1 location

@@ 229-232 (lines=4) @@
226
			$relation = strtoupper( $array[ $relation_key ] );
227
		}
228
229
		if ( ! in_array( $relation, $allowed_relations ) ) {
230
			Incorrect_Syntax_Exception::raise( 'Invalid relation type ' . $relation . '. ' .
231
			'The rule should be one of the following: "' . implode( '", "', $allowed_relations ) . '"' );
232
		}
233
234
		return $relation;
235
	}