Completed
Push — master ( df67a8...54c667 )
by CodexShaper
05:37 queued 04:23
created

WooCommerceApi   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 30
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 15 1
1
<?php
2
3
namespace Codexshaper\WooCommerce;
4
5
use Automattic\WooCommerce\Client;
6
use Codexshaper\WooCommerce\Traits\WoocommerceTrait;
7
8
class WooCommerceApi
9
{
10
    use WooCommerceTrait;
11
12
    /**
13
     *@var \Automattic\WooCommerce\Client
14
     */
15
    protected $client;
16
17
    /**
18
     * Build Woocommerce connection.
19
     *
20
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
21
     */
22
    public function __construct()
23
    {
24
        $this->client = new Client(
25
            config('woocommerce.store_url'),
26
            config('woocommerce.consumer_key'),
27
            config('woocommerce.consumer_secret'),
28
            [
29
                'version'           => 'wc/'.config('woocommerce.api_version'),
30
                'wp_api'            => config('woocommerce.wp_api_integration'),
31
                'verify_ssl'        => config('woocommerce.verify_ssl'),
32
                'query_string_auth' => config('woocommerce.query_string_auth'),
33
                'timeout'           => config('woocommerce.timeout'),
34
            ]
35
        );
36
    }
37
}
38