WooCommerce::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * m'Manager | Invoices Management System
5
 * 
6
 * This content is released under the Proprietary License (Proprietary)
7
 *
8
 * Copyright (c) 2017, Eric Claver AKAFFOU - All Rights Reserved
9
 * Unauthorized copying of this file, via any medium is strictly prohibited
10
 * Proprietary and confidential
11
 * 
12
 * @package m'Manager
13
 * @author  Eric Claver AKAFFOU
14
 * @copyright   Copyright (c) 2017, on'Eric Computing, Inc. (https://www.onericcomputing.com/)
15
 * @license https://www.mmanager.fr  Proprietary License
16
 * @link    https://codecanyon.net/item/mmanager-invoices-management-system/19866435?s_rank=1
17
 * @since   Version 1.0.0
18
 * @filesource
19
 */
20
21
namespace Mmanager\Extensions\Woocommerce;
22
23
use Mmanager\Extensions\Woocommerce\Functions;
24
/**
25
 * WooCommerce Entity
26
 */
27
class WooCommerce {
28
	protected $fn;
29
	public function __construct() {
30
		$this->fn = new Functions();
31
	}
32
	public function synched() {
33
		if ($this->wc_api_connect()) {
34
			return $this->fn->synched();
35
		}
36
	}
37
	public function wc_api_connect() {
38
		return $this->fn->wc_api_connect();
39
	}
40
	public function get($endpoint, $params = []) {
41
		return $this->fn->get($endpoint, $params);
42
	}
43
	public function post($endpoint, $data) {
44
		return $this->fn->post($endpoint, $data);
45
	}
46
	public function put($endpoint, $data) {
47
		return $this->fn->put($endpoint, $data);
48
	}
49
	public function delete($endpoint, $params = []) {
0 ignored issues
show
Unused Code introduced by
The parameter $params is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
50
		return $this->fn->delete($endpoint, $params = []);
51
	}
52
	public function options($endpoint) {
53
		return $this->fn->options($endpoint);
54
	}
55
	public function getOptions() {
56
		if ($this->synched()) {
57
			return $this->fn->getOptions();
58
		}
59
	}
60
	public function getOption($option_name) {
61
		if ($this->synched()) {
62
			return $this->fn->getOption($option_name);
63
		}
64
	}
65
	public function getUserKeys() {
66
		if ($this->synched()) {
67
			return $this->fn->getUserKeys();
68
		}
69
	}
70
	public function getOrderItems($order_number) {
71
		if ($this->synched()) {
72
			return $this->fn->getOrderItems($order_number);
0 ignored issues
show
Bug introduced by
The method getOrderItems() does not seem to exist on object<Mmanager\Extensions\Woocommerce\Functions>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
73
		}
74
	}
75
	public function getOrdersID() {
76
		if ($this->synched()) {
77
			return $this->fn->getOrdersID();
78
		}
79
	}
80
	public function getOrdersLogs() {
81
		if ($this->synched()) {
82
			return $this->fn->getOrdersLogs();
0 ignored issues
show
Bug introduced by
The method getOrdersLogs() does not seem to exist on object<Mmanager\Extensions\Woocommerce\Functions>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
83
		}
84
	}
85
}