PluginProbe
WANotifier for Forms and Actions / 2.7.13
WANotifier for Forms and Actions v2.7.13
3.1.1 3.1.0 3.0.4 2.7.10 2.7.11 2.7.12 2.7.13 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 3.0.0 3.0.1 3.0.2 3.0.3 trunk 0.1.0 0.1.1 1.0.0 1.0.1 1.0.2 All 67 releases
notifier / libraries / action-scheduler / classes / ActionScheduler_InvalidActionException.php

ActionScheduler_InvalidActionException.php in WANotifier for Forms and Actions 2.7.13, at libraries/action-scheduler/classes/ActionScheduler_InvalidActionException.php

48 lines 1.2 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 * @return static
17 */
18 public static function from_schedule( $action_id, $schedule ) {
19 $message = sprintf(
20 /* translators: 1: action ID 2: schedule */
21 __( 'Action [%1$s] has an invalid schedule: %2$s', 'action-scheduler' ),
22 $action_id,
23 var_export( $schedule, true )
24 );
25
26 return new static( $message );
27 }
28
29 /**
30 * Create a new exception when the action's args cannot be decoded to an array.
31 *
32 * @author Jeremy Pry
33 *
34 * @param string $action_id The action ID with bad args.
35 * @return static
36 */
37 public static function from_decoding_args( $action_id, $args = array() ) {
38 $message = sprintf(
39 /* translators: 1: action ID 2: arguments */
40 __( 'Action [%1$s] has invalid arguments. It cannot be JSON decoded to an array. $args = %2$s', 'action-scheduler' ),
41 $action_id,
42 var_export( $args, true )
43 );
44
45 return new static( $message );
46 }
47 }
48