Passed
Pull Request — master (#168)
by
unknown
02:19
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_APP_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
      */
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             } catch (\Algolia\AlgoliaSearch\Exceptions\UnreachableException $error) {
72 72
                 add_action(
73 73
                     'admin_notices',
74
-                    function () {
74
+                    function() {
75 75
                         echo '<div class="error notice">
76 76
 							  <p>' . esc_html__('An error has been encountered. Please check your application ID and API key. ', 'algolia-woo-indexer') . '</p>
77 77
 							</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,
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         {
134 134
             $rawAttributes = $product->get_attributes();
135 135
             $numericRangeAttributes = ["pa_height", "pa_flowermonth"];
136
-            if (!$rawAttributes) {
136
+            if ( ! $rawAttributes) {
137 137
                 return false;
138 138
             }
139 139
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
             $algolia_api_key        = is_string($algolia_api_key) ? $algolia_api_key : CHANGE_ME;
196 196
 
197 197
             $algolia_index_name     = get_option(ALGOWOO_DB_OPTION . INDEX_NAME);
198
-            $algolia_index_name        = is_string($algolia_index_name) ? $algolia_index_name : CHANGE_ME;
198
+            $algolia_index_name = is_string($algolia_index_name) ? $algolia_index_name : CHANGE_ME;
199 199
 
200 200
             /**
201 201
              * Display admin notice and return if not all values have been set
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
                  * Add stock information if stock management is on
286 286
                  */
287 287
                 $stock_data = self::get_product_stock_data($product);
288
-                if($stock_data) {
288
+                if ($stock_data) {
289 289
                     $record = array_merge($record, $stock_data);
290 290
                 }
291 291
 
Please login to merge, or discard this patch.