| @@ 485-498 (lines=14) @@ | ||
| 482 | public function validate_context($context) |
|
| 483 | { |
|
| 484 | $contexts = $this->contexts_config(); |
|
| 485 | if (! isset($contexts[$context])) { |
|
| 486 | throw new InvalidIdentifierException( |
|
| 487 | '', |
|
| 488 | '', |
|
| 489 | sprintf( |
|
| 490 | esc_html__( |
|
| 491 | 'An invalid string identifying a context was provided. "%1$s" was received, and one of "%2$s" was expected.', |
|
| 492 | 'event_espresso' |
|
| 493 | ), |
|
| 494 | $context, |
|
| 495 | implode(',', array_keys($contexts)) |
|
| 496 | ) |
|
| 497 | ); |
|
| 498 | } |
|
| 499 | } |
|
| 500 | } |
|
| 501 | ||
| @@ 221-232 (lines=12) @@ | ||
| 218 | Version::RELEASE_TYPE_DECAF, |
|
| 219 | Version::RELEASE_TYPE_PROD, |
|
| 220 | ); |
|
| 221 | if (! in_array($release, $valid_release_types, true)) { |
|
| 222 | throw new InvalidArgumentException( |
|
| 223 | sprintf( |
|
| 224 | esc_html__( |
|
| 225 | '"%1$s" is not a valid release type. Please use one of the following values: %2$s', |
|
| 226 | 'event_espresso' |
|
| 227 | ), |
|
| 228 | $release, |
|
| 229 | implode(', ', $valid_release_types) |
|
| 230 | ) |
|
| 231 | ); |
|
| 232 | } |
|
| 233 | $this->release = $release; |
|
| 234 | } |
|
| 235 | ||
| @@ 611-619 (lines=9) @@ | ||
| 608 | return; |
|
| 609 | } |
|
| 610 | ||
| 611 | if (! isset($allowable_types[$type])) { |
|
| 612 | throw new InvalidArgumentException( |
|
| 613 | sprintf( |
|
| 614 | esc_html__('The incoming argument (%1$s) must be one of the allowable types: %2$s', 'event_espresso'), |
|
| 615 | $type, |
|
| 616 | implode(',', array_flip($allowable_types)) |
|
| 617 | ) |
|
| 618 | ); |
|
| 619 | } |
|
| 620 | } |
|
| 621 | ||
| 622 | ||
| @@ 653-661 (lines=9) @@ | ||
| 650 | ) |
|
| 651 | ); |
|
| 652 | ||
| 653 | if (! isset($allowable_formats[$format])) { |
|
| 654 | throw new InvalidArgumentException( |
|
| 655 | sprintf( |
|
| 656 | esc_html__('The incoming argument (%1$s) must be one of the allowable formats: %2$s', 'event_espresso'), |
|
| 657 | $format, |
|
| 658 | implode(',', array_flip($allowable_formats)) |
|
| 659 | ) |
|
| 660 | ); |
|
| 661 | } |
|
| 662 | } |
|
| 663 | } |
|
| @@ 205-218 (lines=14) @@ | ||
| 202 | $data_type = $this->type === self::TYPE_COMPLEX ? $select_parts[1] : ''; |
|
| 203 | $data_type = $this->type === self::TYPE_STRUCTURED ? $select_parts[2] : $data_type; |
|
| 204 | ||
| 205 | if (! in_array($data_type, $valid_data_types, true)) { |
|
| 206 | throw new InvalidArgumentException( |
|
| 207 | sprintf( |
|
| 208 | esc_html__( |
|
| 209 | 'Datatype %1$s (for selection "%2$s" and alias "%3$s") is not a valid wpdb datatype (eg %%s)', |
|
| 210 | 'event_espresso' |
|
| 211 | ), |
|
| 212 | $data_type, |
|
| 213 | $select_parts[0], |
|
| 214 | $alias, |
|
| 215 | implode(', ', $valid_data_types) |
|
| 216 | ) |
|
| 217 | ); |
|
| 218 | } |
|
| 219 | } |
|
| 220 | ||
| 221 | ||