| @@ 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 | } |
|