Code Duplication    Length = 4-5 lines in 2 locations

core/Helper/Helper.php 1 location

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

core/Field/Field.php 1 location

@@ 892-896 (lines=5) @@
889
			if ( empty( $rule['compare'] ) ) {
890
				$rule['compare'] = '=';
891
			}
892
			if ( ! in_array( $rule['compare'], $allowed_operators ) ) {
893
				Incorrect_Syntax_Exception::raise( 'Invalid conditional logic compare operator: <code>' .
894
					$rule['compare'] . '</code><br>Allowed operators are: <code>' .
895
				implode( ', ', $allowed_operators ) . '</code>' );
896
			}
897
			if ( $rule['compare'] === 'IN' || $rule['compare'] === 'NOT IN' ) {
898
				if ( ! is_array( $rule['value'] ) ) {
899
					Incorrect_Syntax_Exception::raise( 'Invalid conditional logic value format. ' .