Code Duplication    Length = 4-5 lines in 2 locations

core/Helper/Helper.php 1 location

@@ 286-289 (lines=4) @@
283
			$relation = strtoupper( $array[ $relation_key ] );
284
		}
285
286
		if ( ! in_array( $relation, $allowed_relations ) ) {
287
			Incorrect_Syntax_Exception::raise( 'Invalid relation type ' . $relation . '. ' .
288
			'The rule should be one of the following: "' . implode( '", "', $allowed_relations ) . '"' );
289
		}
290
291
		return $relation;
292
	}

core/Field/Field.php 1 location

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