From 3d4217143e557bccc420421980c12d3f0f8a43e3 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Thu, 15 Mar 2018 18:22:12 -0300 Subject: [PATCH] Fixed includes/class-wc-background-emailer.php PHPCS violations --- includes/class-wc-background-emailer.php | 14 ++++++-------- phpcs.xml | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/includes/class-wc-background-emailer.php b/includes/class-wc-background-emailer.php index dd6fb2907d1..ecd143647b9 100644 --- a/includes/class-wc-background-emailer.php +++ b/includes/class-wc-background-emailer.php @@ -2,13 +2,11 @@ /** * Background Emailer * - * @version 3.0.1 - * @package WooCommerce/Classes + * @version 3.0.1 + * @package WooCommerce/Classes */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; if ( ! class_exists( 'WC_Background_Process', false ) ) { include_once dirname( __FILE__ ) . '/abstracts/class-wc-background-process.php'; @@ -59,7 +57,7 @@ class WC_Background_Emailer extends WC_Background_Process { WC_Emails::send_queued_transactional_email( $callback['filter'], $callback['args'] ); } catch ( Exception $e ) { if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { - trigger_error( 'Transactional email triggered fatal error for callback ' . esc_html( $callback['filter'] ), E_USER_WARNING ); + trigger_error( 'Transactional email triggered fatal error for callback ' . esc_html( $callback['filter'] ), E_USER_WARNING ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error } } } @@ -89,7 +87,7 @@ class WC_Background_Emailer extends WC_Background_Process { if ( ! headers_sent() ) { header( 'Connection: close' ); } - @ob_end_flush(); + @ob_end_flush(); // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged flush(); } } @@ -117,7 +115,7 @@ class WC_Background_Emailer extends WC_Background_Process { // Pass cookies through with the request so nonces function. $cookies = array(); - foreach ( $_COOKIE as $name => $value ) { + foreach ( $_COOKIE as $name => $value ) { // WPCS: input var ok. if ( 'PHPSESSID' === $name ) { continue; } diff --git a/phpcs.xml b/phpcs.xml index b56657633e6..b3d3928ea8b 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -37,6 +37,7 @@ +