Passed
Push — dependabot/composer/wpackagist... ( 757a89 )
by
unknown
05:33
created
lsx-currencies.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -13,17 +13,17 @@
 block discarded – undo
13 13
  */
14 14
 
15 15
 // If this file is called directly, abort.
16
-if ( ! defined( 'WPINC' ) ) {
16
+if (!defined('WPINC')) {
17 17
 	die;
18 18
 }
19 19
 
20
-define( 'LSX_CURRENCIES_PATH', plugin_dir_path( __FILE__ ) );
21
-define( 'LSX_CURRENCIES_CORE', __FILE__ );
22
-define( 'LSX_CURRENCIES_URL', plugin_dir_url( __FILE__ ) );
23
-define( 'LSX_CURRENCIES_VER', '1.2.5' );
20
+define('LSX_CURRENCIES_PATH', plugin_dir_path(__FILE__));
21
+define('LSX_CURRENCIES_CORE', __FILE__);
22
+define('LSX_CURRENCIES_URL', plugin_dir_url(__FILE__));
23
+define('LSX_CURRENCIES_VER', '1.2.5');
24 24
 
25
-require_once LSX_CURRENCIES_PATH . 'classes/deprecated/class-lsx-currencies.php';
26
-require_once LSX_CURRENCIES_PATH . 'classes/class-currencies.php';
25
+require_once LSX_CURRENCIES_PATH.'classes/deprecated/class-lsx-currencies.php';
26
+require_once LSX_CURRENCIES_PATH.'classes/class-currencies.php';
27 27
 
28 28
 /**
29 29
  * Returns the main instance of the class
Please login to merge, or discard this patch.
classes/class-facetwp.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 	 * Constructor
35 35
 	 */
36 36
 	public function __construct() {
37
-		add_filter( 'facetwp_indexer_row_data', array( $this, 'facetwp_index_row_data' ), 20, 2 );
38
-		add_action( 'lsx_currencies_rates_refreshed', array( $this, 'refresh_the_currencies' ), 20 );
37
+		add_filter('facetwp_indexer_row_data', array($this, 'facetwp_index_row_data'), 20, 2);
38
+		add_action('lsx_currencies_rates_refreshed', array($this, 'refresh_the_currencies'), 20);
39 39
 	}
40 40
 
41 41
 	/**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	public static function init() {
47 47
 		// If the single instance hasn't been set, set it now.
48
-		if ( ! isset( self::$instance ) ) {
48
+		if (!isset(self::$instance)) {
49 49
 			self::$instance = new self();
50 50
 		}
51 51
 		return self::$instance;
@@ -54,27 +54,27 @@  discard block
 block discarded – undo
54 54
 	/**
55 55
 	 *  Alter the rows and include extra facets rows for the continents.
56 56
 	 */
57
-	public function facetwp_index_row_data( $rows, $params ) {
58
-		switch ( $params['facet']['source'] ) {
57
+	public function facetwp_index_row_data($rows, $params) {
58
+		switch ($params['facet']['source']) {
59 59
 			case 'cf/price':
60 60
 				// only convert a price to the base currency if the setting is active.
61 61
 				// If $rows is empty then there is no base currency set.
62
-				if ( true === lsx_currencies()->convert_to_single && empty( $rows ) ) {
62
+				if (true === lsx_currencies()->convert_to_single && empty($rows)) {
63 63
 					lsx_currencies()->frontend->set_defaults();
64
-					$additional_prices = get_post_meta( $params['defaults']['post_id'], 'additional_prices', false );
64
+					$additional_prices = get_post_meta($params['defaults']['post_id'], 'additional_prices', false);
65 65
 
66
-					if ( ! empty( $additional_prices ) && isset( $additional_prices[0] ) && ! empty( $additional_prices[0] ) && ! empty( lsx_currencies()->frontend->rates ) ) {
66
+					if (!empty($additional_prices) && isset($additional_prices[0]) && !empty($additional_prices[0]) && !empty(lsx_currencies()->frontend->rates)) {
67 67
 						$row_currency     = $additional_prices[0]['currency'];
68 68
 						$row_value        = $additional_prices[0]['amount'];
69
-						if ( '' !== $row_value && null !== $row_value ) {
69
+						if ('' !== $row_value && null !== $row_value) {
70 70
 							$current_currency = lsx_currencies()->frontend->current_currency;
71 71
 							$usd_value        = $row_value / lsx_currencies()->frontend->rates->$row_currency;
72
-							if ( $row_currency !== $current_currency ) {
72
+							if ($row_currency !== $current_currency) {
73 73
 								$usd_value = $usd_value * lsx_currencies()->frontend->rates->$current_currency;
74 74
 							}
75 75
 							$new_row                        = $params['defaults'];
76
-							$new_row['facet_value']         = round( $usd_value, 0 );
77
-							$new_row['facet_display_value'] = round( $usd_value, 0 );
76
+							$new_row['facet_value']         = round($usd_value, 0);
77
+							$new_row['facet_display_value'] = round($usd_value, 0);
78 78
 							$rows[]                         = $new_row;
79 79
 						}
80 80
 					}
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
 	 * @return void
94 94
 	 */
95 95
 	public function refresh_the_currencies() {
96
-		if ( true === lsx_currencies()->convert_to_single ) {
97
-			add_action( 'wp_footer', array( $this, 'trigger_the_index' ) );
96
+		if (true === lsx_currencies()->convert_to_single) {
97
+			add_action('wp_footer', array($this, 'trigger_the_index'));
98 98
 		}
99 99
 	}
100 100
 
@@ -104,17 +104,17 @@  discard block
 block discarded – undo
104 104
 	 * @return void
105 105
 	 */
106 106
 	public function trigger_the_index() {
107
-		$tours_args  = array(
107
+		$tours_args = array(
108 108
 			'post_type'      => 'tour',
109 109
 			'post_status'    => 'publish',
110 110
 			'posts_per_page' => '-1',
111 111
 			'nopagin'        => true,
112 112
 			'fields'         => 'ids',
113 113
 		);
114
-		$tours_query = new \WP_Query( $tours_args );
115
-		if ( $tours_query->have_posts() ) {
116
-			foreach ( $tours_query->posts as $tour_id ) {
117
-				FWP()->indexer->index( $tour_id );
114
+		$tours_query = new \WP_Query($tours_args);
115
+		if ($tours_query->have_posts()) {
116
+			foreach ($tours_query->posts as $tour_id) {
117
+				FWP()->indexer->index($tour_id);
118 118
 			}
119 119
 		}
120 120
 	}
Please login to merge, or discard this patch.