chore(06-02): download and include Action Scheduler library
- Downloaded Action Scheduler 3.9.3 from GitHub - Placed in vendor/action-scheduler/ directory - Included in main plugin file before other code for proper initialization - Library will auto-initialize itself when required
This commit is contained in:
47
vendor/action-scheduler/classes/ActionScheduler_InvalidActionException.php
vendored
Normal file
47
vendor/action-scheduler/classes/ActionScheduler_InvalidActionException.php
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* InvalidAction Exception.
|
||||
*
|
||||
* Used for identifying actions that are invalid in some way.
|
||||
*
|
||||
* @package ActionScheduler
|
||||
*/
|
||||
class ActionScheduler_InvalidActionException extends \InvalidArgumentException implements ActionScheduler_Exception {
|
||||
|
||||
/**
|
||||
* Create a new exception when the action's schedule cannot be fetched.
|
||||
*
|
||||
* @param string $action_id The action ID with bad args.
|
||||
* @param mixed $schedule Passed schedule.
|
||||
* @return static
|
||||
*/
|
||||
public static function from_schedule( $action_id, $schedule ) {
|
||||
$message = sprintf(
|
||||
/* translators: 1: action ID 2: schedule */
|
||||
__( 'Action [%1$s] has an invalid schedule: %2$s', 'action-scheduler' ),
|
||||
$action_id,
|
||||
var_export( $schedule, true ) // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
);
|
||||
|
||||
return new static( $message );
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new exception when the action's args cannot be decoded to an array.
|
||||
*
|
||||
* @param string $action_id The action ID with bad args.
|
||||
* @param mixed $args Passed arguments.
|
||||
* @return static
|
||||
*/
|
||||
public static function from_decoding_args( $action_id, $args = array() ) {
|
||||
$message = sprintf(
|
||||
/* translators: 1: action ID 2: arguments */
|
||||
__( 'Action [%1$s] has invalid arguments. It cannot be JSON decoded to an array. $args = %2$s', 'action-scheduler' ),
|
||||
$action_id,
|
||||
var_export( $args, true ) // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
);
|
||||
|
||||
return new static( $message );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user