| @@ 373-376 (lines=4) @@ | ||
| 370 | $relation = strtoupper( $array[ $relation_key ] ); |
|
| 371 | } |
|
| 372 | ||
| 373 | if ( ! in_array( $relation, $allowed_relations ) ) { |
|
| 374 | Incorrect_Syntax_Exception::raise( 'Invalid relation type ' . $relation . '. ' . |
|
| 375 | 'The rule should be one of the following: "' . implode( '", "', $allowed_relations ) . '"' ); |
|
| 376 | } |
|
| 377 | ||
| 378 | return $relation; |
|
| 379 | } |
|
| @@ 945-949 (lines=5) @@ | ||
| 942 | 'value' => '', |
|
| 943 | ), $rule ); |
|
| 944 | ||
| 945 | if ( ! in_array( $rule['compare'], $allowed_operators ) ) { |
|
| 946 | Incorrect_Syntax_Exception::raise( 'Invalid conditional logic compare operator: <code>' . $rule['compare'] . '</code><br>Allowed operators are: <code>' . |
|
| 947 | implode( ', ', $allowed_operators ) . '</code>' ); |
|
| 948 | return null; |
|
| 949 | } |
|
| 950 | ||
| 951 | if ( in_array( $rule['compare'], $array_operators ) && ! is_array( $rule['value'] ) ) { |
|
| 952 | Incorrect_Syntax_Exception::raise( 'Invalid conditional logic value format. An array is expected, when using the "' . $rule['compare'] . '" operator.' ); |
|
| @@ 951-954 (lines=4) @@ | ||
| 948 | return null; |
|
| 949 | } |
|
| 950 | ||
| 951 | if ( in_array( $rule['compare'], $array_operators ) && ! is_array( $rule['value'] ) ) { |
|
| 952 | Incorrect_Syntax_Exception::raise( 'Invalid conditional logic value format. An array is expected, when using the "' . $rule['compare'] . '" operator.' ); |
|
| 953 | return null; |
|
| 954 | } |
|
| 955 | ||
| 956 | return $rule; |
|
| 957 | } |
|