Code Duplication    Length = 4-5 lines in 2 locations

core/Helper/Helper.php 1 location

@@ 322-325 (lines=4) @@
319
			$relation = strtoupper( $array[ $relation_key ] );
320
		}
321
322
		if ( ! in_array( $relation, $allowed_relations ) ) {
323
			Incorrect_Syntax_Exception::raise( 'Invalid relation type ' . $relation . '. ' .
324
			'The rule should be one of the following: "' . implode( '", "', $allowed_relations ) . '"' );
325
		}
326
327
		return $relation;
328
	}

core/Field/Field.php 1 location

@@ 972-976 (lines=5) @@
969
			'value' => '',
970
		), $rule );
971
972
		if ( ! in_array( $rule['compare'], $allowed_operators ) ) {
973
			Incorrect_Syntax_Exception::raise( 'Invalid conditional logic compare operator: <code>' . $rule['compare'] . '</code><br>Allowed operators are: <code>' .
974
			implode( ', ', $allowed_operators ) . '</code>' );
975
			return null;
976
		}
977
978
		if ( in_array( $rule['compare'], $array_operators ) && ! is_array( $rule['value'] ) ) {
979
			Incorrect_Syntax_Exception::raise( 'Invalid conditional logic value format. An array is expected, when using the "' . $rule['compare'] . '" operator.' );