Commit be1e471b authored by Erick Hitter's avatar Erick Hitter
Browse files

PHPCS fixes

parent 55552325
<?php <?php
/**
* Enable and disable automatic event execution via WP-CLI
*
* @package a8c_Cron_Control
*/
namespace Automattic\WP\Cron_Control\CLI; namespace Automattic\WP\Cron_Control\CLI;
...@@ -10,6 +15,8 @@ class Orchestrate extends \WP_CLI_Command { ...@@ -10,6 +15,8 @@ class Orchestrate extends \WP_CLI_Command {
* Check the status of automatic event execution * Check the status of automatic event execution
* *
* @subcommand check-status * @subcommand check-status
* @param array $args Array of positional arguments.
* @param array $assoc_args Array of flags.
*/ */
public function get_automatic_execution_status( $args, $assoc_args ) { public function get_automatic_execution_status( $args, $assoc_args ) {
$status = \Automattic\WP\Cron_Control\Events::instance()->run_disabled(); $status = \Automattic\WP\Cron_Control\Events::instance()->run_disabled();
...@@ -38,9 +45,11 @@ class Orchestrate extends \WP_CLI_Command { ...@@ -38,9 +45,11 @@ class Orchestrate extends \WP_CLI_Command {
* *
* @subcommand manage-automatic-execution * @subcommand manage-automatic-execution
* @synopsis [--enable] [--disable] [--disable_until=<disable_until>] * @synopsis [--enable] [--disable] [--disable_until=<disable_until>]
* @param array $args Array of positional arguments.
* @param array $assoc_args Array of flags.
*/ */
public function manage_automatic_execution( $args, $assoc_args ) { public function manage_automatic_execution( $args, $assoc_args ) {
// Update execution status // Update execution status.
$disable_ts = \WP_CLI\Utils\get_flag_value( $assoc_args, 'disable_until', 0 ); $disable_ts = \WP_CLI\Utils\get_flag_value( $assoc_args, 'disable_until', 0 );
$disable_ts = absint( $disable_ts ); $disable_ts = absint( $disable_ts );
...@@ -62,7 +71,7 @@ class Orchestrate extends \WP_CLI_Command { ...@@ -62,7 +71,7 @@ class Orchestrate extends \WP_CLI_Command {
} }
\WP_CLI::error( __( 'Could not disable automatic execution. Please check the current status.', 'automattic-cron-control' ) ); \WP_CLI::error( __( 'Could not disable automatic execution. Please check the current status.', 'automattic-cron-control' ) );
} elseif( $disable_ts > 0 ) { } elseif ( $disable_ts > 0 ) {
if ( $disable_ts > time() ) { if ( $disable_ts > time() ) {
$updated = \Automattic\WP\Cron_Control\Events::instance()->update_run_status( $disable_ts ); $updated = \Automattic\WP\Cron_Control\Events::instance()->update_run_status( $disable_ts );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment