PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.5.4
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.5.4
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
image-optimization / vendor / woocommerce / action-scheduler / classes / ActionScheduler_InvalidActionException.php

ActionScheduler_InvalidActionException.php in Image Optimizer – Compress Images and Convert to WebP or AVIF 1.5.4, at vendor/woocommerce/action-scheduler/classes/ActionScheduler_InvalidActionException.php

50 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * InvalidAction Exception.
5 *
6 * Used for identifying actions that are invalid in some way.
7 *
8 * @package ActionScheduler
9 */
10 class ActionScheduler_InvalidActionException extends \InvalidArgumentException implements ActionScheduler_Exception {
11
12 /**
13 * Create a new exception when the action's schedule cannot be fetched.
14 *
15 * @param string $action_id The action ID with bad args.
16 * @param mixed $schedule Passed schedule.
17 * @return static
18 */
19 public static function from_schedule( $action_id, $schedule ) {
20 $message = sprintf(
21 /* translators: 1: action ID 2: schedule */
22 __( 'Action [%1$s] has an invalid schedule: %2$s', 'action-scheduler' ),
23 $action_id,
24 var_export( $schedule, true )
25 );
26
27 return new static( $message );
28 }
29
30 /**
31 * Create a new exception when the action's args cannot be decoded to an array.
32 *
33 * @author Jeremy Pry
34 *
35 * @param string $action_id The action ID with bad args.
36 * @param mixed $args Passed arguments.
37 * @return static
38 */
39 public static function from_decoding_args( $action_id, $args = array() ) {
40 $message = sprintf(
41 /* translators: 1: action ID 2: arguments */
42 __( 'Action [%1$s] has invalid arguments. It cannot be JSON decoded to an array. $args = %2$s', 'action-scheduler' ),
43 $action_id,
44 var_export( $args, true )
45 );
46
47 return new static( $message );
48 }
49 }
50