Passed
Branch master (85c95f)
by Daniel
02:50
created
classes/class-send-products.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@  discard block
 block discarded – undo
14 14
 /**
15 15
  * Abort if this file is called directly
16 16
  */
17
-if (!defined('ABSPATH')) {
17
+if ( ! defined('ABSPATH')) {
18 18
     exit;
19 19
 }
20 20
 
21 21
 /**
22 22
  * Include plugin file if function is_plugin_active does not exist
23 23
  */
24
-if (!function_exists('is_plugin_active')) {
24
+if ( ! function_exists('is_plugin_active')) {
25 25
     require_once(ABSPATH . '/wp-admin/includes/plugin.php');
26 26
 }
27 27
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 define('ALGOLIA_APPLICATION_ID', '_application_id');
45 45
 define('ALGOLIA_API_KEY', '_admin_api_key');
46 46
 
47
-if (!class_exists('Algolia_Send_Products')) {
47
+if ( ! class_exists('Algolia_Send_Products')) {
48 48
     /**
49 49
      * Algolia WooIndexer main class
50 50
      */
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             } catch (\Algolia\AlgoliaSearch\Exceptions\UnreachableException $error) {
71 71
                 add_action(
72 72
                     'admin_notices',
73
-                    function () {
73
+                    function() {
74 74
                         echo '<div class="error notice">
75 75
 							  <p>' . esc_html__('An error has been encountered. Please check your application ID and API key. ', 'algolia-woo-indexer') . '</p>
76 76
 							</div>';
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
             $sale_price = 0;
93 93
             $regular_price = 0;
94 94
             if ($product->is_type('simple')) {
95
-                $sale_price     =  $product->get_sale_price();
96
-                $regular_price  =  $product->get_regular_price();
95
+                $sale_price     = $product->get_sale_price();
96
+                $regular_price  = $product->get_regular_price();
97 97
             } elseif ($product->is_type('variable')) {
98
-                $sale_price     =  $product->get_variation_sale_price('min', true);
99
-                $regular_price  =  $product->get_variation_regular_price('max', true);
98
+                $sale_price     = $product->get_variation_sale_price('min', true);
99
+                $regular_price  = $product->get_variation_regular_price('max', true);
100 100
             }
101 101
             return array(
102 102
                 'sale_price' => $sale_price,
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             $algolia_api_key        = is_string($algolia_api_key) ? $algolia_api_key : CHANGE_ME;
131 131
 
132 132
             $algolia_index_name     = get_option(ALGOWOO_DB_OPTION . INDEX_NAME);
133
-            $algolia_index_name        = is_string($algolia_index_name) ? $algolia_index_name : CHANGE_ME;
133
+            $algolia_index_name = is_string($algolia_index_name) ? $algolia_index_name : CHANGE_ME;
134 134
 
135 135
             /**
136 136
              * Display admin notice and return if not all values have been set
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
             }
190 190
             $records = array();
191 191
             $record  = array();
192
-            $sale_price     =  0;
193
-            $regular_price  =  0;
192
+            $sale_price     = 0;
193
+            $regular_price  = 0;
194 194
 
195 195
             foreach ($products as $product) {
196 196
                 /**
Please login to merge, or discard this patch.