Completed
Pull Request — master (#673)
by Dwain
03:11
created
includes/class-wc-stripe-logger.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if ( ! defined('ABSPATH')) {
3 3
 	exit; // Exit if accessed directly
4 4
 }
5 5
 
@@ -20,28 +20,28 @@  discard block
 block discarded – undo
20 20
 	 * @since 4.0.0
21 21
 	 * @version 4.0.0
22 22
 	 */
23
-	public static function log( $message, $start_time = null, $end_time = null ) {
24
-		if ( ! class_exists( 'WC_Logger' ) ) {
23
+	public static function log($message, $start_time = null, $end_time = null) {
24
+		if ( ! class_exists('WC_Logger')) {
25 25
 			return;
26 26
 		}
27 27
 
28
-		if ( apply_filters( 'wc_stripe_logging', true, $message ) ) {
29
-			if ( empty( self::$logger ) ) {
28
+		if (apply_filters('wc_stripe_logging', true, $message)) {
29
+			if (empty(self::$logger)) {
30 30
 				self::$logger = wc_get_logger();
31 31
 			}
32 32
 
33
-			$settings = get_option( 'woocommerce_stripe_settings' );
33
+			$settings = get_option('woocommerce_stripe_settings');
34 34
 
35
-			if ( empty( $settings ) || isset( $settings['logging'] ) && 'yes' !== $settings['logging'] ) {
35
+			if (empty($settings) || isset($settings['logging']) && 'yes' !== $settings['logging']) {
36 36
 				return;
37 37
 			}
38 38
 
39
-			if ( ! is_null( $start_time ) ) {
39
+			if ( ! is_null($start_time)) {
40 40
 
41
-				$formatted_start_time = date_i18n( get_option( 'date_format' ) . ' g:ia', $start_time );
42
-				$end_time             = is_null( $end_time ) ? current_time( 'timestamp' ) : $end_time;
43
-				$formatted_end_time   = date_i18n( get_option( 'date_format' ) . ' g:ia', $end_time );
44
-				$elapsed_time         = round( abs( $end_time - $start_time ) / 60, 2 );
41
+				$formatted_start_time = date_i18n(get_option('date_format') . ' g:ia', $start_time);
42
+				$end_time             = is_null($end_time) ? current_time('timestamp') : $end_time;
43
+				$formatted_end_time   = date_i18n(get_option('date_format') . ' g:ia', $end_time);
44
+				$elapsed_time         = round(abs($end_time - $start_time) / 60, 2);
45 45
 
46 46
 				$log_entry = "\n" . '====Stripe Version: ' . WC_STRIPE_VERSION . '====' . "\n";
47 47
 				$log_entry .= '====Start Log ' . $formatted_start_time . '====' . "\n" . $message . "\n";
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
 			}
55 55
 
56
-			self::$logger->add( self::WC_LOG_FILENAME, $log_entry );
56
+			self::$logger->add(self::WC_LOG_FILENAME, $log_entry);
57 57
 		}
58 58
 	}
59 59
 }
Please login to merge, or discard this patch.