Passed
Pull Request — master (#168)
by
unknown
02:08
created
classes/class-send-products.php 1 patch
Spacing   +10 added lines, -10 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,
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         {
115 115
             $rawAttributes = $product->get_attributes();
116 116
             $numericRangeAttributes = ["pa_height", "pa_flowermonth"];
117
-            if (!$rawAttributes) {
117
+            if ( ! $rawAttributes) {
118 118
                 return false;
119 119
             }
120 120
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
             $algolia_api_key        = is_string($algolia_api_key) ? $algolia_api_key : CHANGE_ME;
177 177
 
178 178
             $algolia_index_name     = get_option(ALGOWOO_DB_OPTION . INDEX_NAME);
179
-            $algolia_index_name        = is_string($algolia_index_name) ? $algolia_index_name : CHANGE_ME;
179
+            $algolia_index_name = is_string($algolia_index_name) ? $algolia_index_name : CHANGE_ME;
180 180
 
181 181
             /**
182 182
              * Display admin notice and return if not all values have been set
Please login to merge, or discard this patch.