From 847d18c94a74e4f54ca5dc3e9237f7e19fe4712a Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Fri, 7 Sep 2018 11:46:39 +0530 Subject: [PATCH] Fix PHPCS errors Signed-off-by: Kirtan Gajjar --- src/Cron_Command.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Cron_Command.php b/src/Cron_Command.php index c1d0369..754420d 100644 --- a/src/Cron_Command.php +++ b/src/Cron_Command.php @@ -17,7 +17,7 @@ public function __construct() { if ( 'running' !== EE_DOCKER::container_status( 'ee-cron-scheduler' ) ) { $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_CONF_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro easyengine/cron:v' . EE_VERSION; if ( ! EE_DOCKER::boot_container( 'ee-cron-scheduler', $cron_scheduler_run_command ) ) { - EE::error( "There was some error in starting ee-cron-scheduler container. Please check logs." ); + EE::error( 'There was some error in starting ee-cron-scheduler container. Please check logs.' ); } } } @@ -257,13 +257,13 @@ private function generate_cron_config() { $crons = Cron::all(); foreach ( $crons as &$cron ) { - $job_type = $cron['site_url'] === 'host' ? 'job-local' : 'job-exec'; + $job_type = 'host' === $cron['site_url'] ? 'job-local' : 'job-exec'; $id = $cron['site_url'] . '-' . preg_replace( '/[^a-zA-Z0-9\@]/', '-', $cron['command'] ) . '-' . EE\Utils\random_password( 5 ); $id = preg_replace( '/--+/', '-', $id ); $cron['job_type'] = $job_type; $cron['id'] = $id; - if ( $cron['site_url'] !== 'host' ) { + if ( 'host' !== $cron['site_url'] ) { $cron['container'] = $this->site_php_container( $cron['site_url'] ); } } @@ -348,6 +348,8 @@ private function site_php_container( $site ) { * See https://github.com/EasyEngine/cron-command/issues/4. * * @param string $command Command whose syntax needs to be validated. + * + * @throws \EE\ExitException */ private function validate_command( $command ) {