Skip to content

Commit

Permalink
Merge pull request #91 from Codexshaper/analysis-a6ndOZ
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
Codexshaper authored Sep 25, 2022
2 parents 3eb797b + d7cd7b4 commit b54d809
Showing 1 changed file with 51 additions and 51 deletions.
102 changes: 51 additions & 51 deletions src/WooCommerceAnalyticsApi.php
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
<?php

namespace Codexshaper\WooCommerce;

use Automattic\WooCommerce\Client;
use Codexshaper\WooCommerce\Traits\WooCommerceTrait;

class WooCommerceAnalyticsApi
{
use WooCommerceTrait;

/**
*@var \Automattic\WooCommerce\Client
*/
protected $client;

/**
*@var array
*/
protected $headers = [];

/**
* Build Woocommerce connection.
*
* @return void
*/
public function __construct()
{
try {
$this->headers = [
'header_total' => config('woocommerce.header_total') ?? 'X-WP-Total',
'header_total_pages' => config('woocommerce.header_total_pages') ?? 'X-WP-TotalPages',
];

$this->client = new Client(
config('woocommerce.store_url'),
config('woocommerce.consumer_key'),
config('woocommerce.consumer_secret'),
[
'version' => 'wc-analytics',
'wp_api' => config('woocommerce.wp_api_integration'),
'verify_ssl' => config('woocommerce.verify_ssl'),
'query_string_auth' => config('woocommerce.query_string_auth'),
'timeout' => config('woocommerce.timeout'),
]
);
} catch (\Exception $e) {
throw new \Exception($e->getMessage(), 1);
}
}
}
<?php

namespace Codexshaper\WooCommerce;

use Automattic\WooCommerce\Client;
use Codexshaper\WooCommerce\Traits\WooCommerceTrait;

class WooCommerceAnalyticsApi
{
use WooCommerceTrait;

/**
*@var \Automattic\WooCommerce\Client
*/
protected $client;

/**
*@var array
*/
protected $headers = [];

/**
* Build Woocommerce connection.
*
* @return void
*/
public function __construct()
{
try {
$this->headers = [
'header_total' => config('woocommerce.header_total') ?? 'X-WP-Total',
'header_total_pages' => config('woocommerce.header_total_pages') ?? 'X-WP-TotalPages',
];

$this->client = new Client(
config('woocommerce.store_url'),
config('woocommerce.consumer_key'),
config('woocommerce.consumer_secret'),
[
'version' => 'wc-analytics',
'wp_api' => config('woocommerce.wp_api_integration'),
'verify_ssl' => config('woocommerce.verify_ssl'),
'query_string_auth' => config('woocommerce.query_string_auth'),
'timeout' => config('woocommerce.timeout'),
]
);
} catch (\Exception $e) {
throw new \Exception($e->getMessage(), 1);
}
}
}

0 comments on commit b54d809

Please sign in to comment.