| @@ 576-581 (lines=6) @@ | ||
| 573 | $layout = self::LAYOUT_TABBED_HORIZONTAL; |
|
| 574 | } |
|
| 575 | ||
| 576 | if ( ! in_array( $layout, $available_layouts ) ) { |
|
| 577 | $error_message = 'Incorrect layout ``' . $layout . '" specified. ' . |
|
| 578 | 'Available layouts: ' . implode( ', ', $available_layouts ); |
|
| 579 | ||
| 580 | Incorrect_Syntax_Exception::raise( $error_message ); |
|
| 581 | } |
|
| 582 | ||
| 583 | if ( $layout === self::LAYOUT_LIST ) { |
|
| 584 | _doing_it_wrong( __METHOD__, __( 'Complex field <code>' . self::LAYOUT_LIST . '</code> layout is deprecated, please use <code>set_width()</code> instead.', 'carbon_fields' ), null ); |
|
| @@ 817-820 (lines=4) @@ | ||
| 814 | if ( $key === 'relation' ) { |
|
| 815 | $relation = strtoupper( $rule ); |
|
| 816 | ||
| 817 | if ( ! in_array( $relation, $allowed_relations ) ) { |
|
| 818 | Incorrect_Syntax_Exception::raise( 'Invalid relation type ' . $rule . '. ' . |
|
| 819 | 'The rule should be one of the following: "' . implode( '", "', $allowed_relations ) . '"' ); |
|
| 820 | } |
|
| 821 | ||
| 822 | $parsed_rules['relation'] = $relation; |
|
| 823 | continue; |
|
| @@ 836-840 (lines=5) @@ | ||
| 833 | if ( empty( $rule['compare'] ) ) { |
|
| 834 | $rule['compare'] = '='; |
|
| 835 | } |
|
| 836 | if ( ! in_array( $rule['compare'], $allowed_operators ) ) { |
|
| 837 | Incorrect_Syntax_Exception::raise( 'Invalid conditional logic compare operator: <code>' . |
|
| 838 | $rule['compare'] . '</code><br>Allowed operators are: <code>' . |
|
| 839 | implode( ', ', $allowed_operators ) . '</code>' ); |
|
| 840 | } |
|
| 841 | if ( $rule['compare'] === 'IN' || $rule['compare'] === 'NOT IN' ) { |
|
| 842 | if ( ! is_array( $rule['value'] ) ) { |
|
| 843 | Incorrect_Syntax_Exception::raise( 'Invalid conditional logic value format. ' . |
|