Skip to content

Commit 0757fa1

Browse files
authored
Merge pull request #26 from Codexshaper/analysis-WNpVmy
Apply fixes from StyleCI
2 parents 149ed28 + 12a53a0 commit 0757fa1

File tree

2 files changed

+10
-30
lines changed

2 files changed

+10
-30
lines changed

src/Traits/WooCommerceTrait.php

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ public function all($endpoint = '', $options = [])
1919
self::__construct();
2020

2121
return $this->client->get($endpoint, $options);
22-
23-
} catch ( \Exception $e) {
22+
} catch (\Exception $e) {
2423
throw new \Exception($e->getMessages(), 1);
25-
2624
}
2725
}
2826

@@ -41,10 +39,8 @@ public function find($endpoint = '', $options = [])
4139
self::__construct();
4240

4341
return $this->client->get($endpoint, $options);
44-
45-
} catch ( \Exception $e) {
42+
} catch (\Exception $e) {
4643
throw new \Exception($e->getMessages(), 1);
47-
4844
}
4945
}
5046

@@ -63,10 +59,8 @@ public function create($endpoint, $data)
6359
self::__construct();
6460

6561
return $this->client->post($endpoint, $data);
66-
67-
} catch ( \Exception $e) {
62+
} catch (\Exception $e) {
6863
throw new \Exception($e->getMessages(), 1);
69-
7064
}
7165
}
7266

@@ -85,10 +79,8 @@ public function update($endpoint, $data)
8579
self::__construct();
8680

8781
return $this->client->put($endpoint, $data);
88-
89-
} catch ( \Exception $e) {
82+
} catch (\Exception $e) {
9083
throw new \Exception($e->getMessages(), 1);
91-
9284
}
9385
}
9486

@@ -107,10 +99,8 @@ public function delete($endpoint, $options = [])
10799
self::__construct();
108100

109101
return $this->client->delete($endpoint, $options);
110-
111-
} catch ( \Exception $e) {
102+
} catch (\Exception $e) {
112103
throw new \Exception($e->getMessages(), 1);
113-
114104
}
115105
}
116106

@@ -122,14 +112,10 @@ public function delete($endpoint, $options = [])
122112
public function getRequest()
123113
{
124114
try {
125-
126115
return $this->client->http->getRequest();
127-
128-
} catch ( \Exception $e) {
116+
} catch (\Exception $e) {
129117
throw new \Exception($e->getMessages(), 1);
130-
131118
}
132-
133119
}
134120

135121
/**
@@ -140,12 +126,9 @@ public function getRequest()
140126
public function getResponse()
141127
{
142128
try {
143-
144129
return $this->client->http->getResponse();
145-
146-
} catch ( \Exception $e) {
130+
} catch (\Exception $e) {
147131
throw new \Exception($e->getMessages(), 1);
148-
149132
}
150133
}
151134

src/WooCommerceApi.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ class WooCommerceApi
2727
public function __construct()
2828
{
2929
try {
30-
3130
$this->headers = [
32-
'header_total' => config('woocommerce.header_total') ?? 'X-WP-Total',
31+
'header_total' => config('woocommerce.header_total') ?? 'X-WP-Total',
3332
'header_total_pages' => config('woocommerce.header_total_pages') ?? 'X-WP-TotalPages',
3433
];
35-
34+
3635
$this->client = new Client(
3736
config('woocommerce.store_url'),
3837
config('woocommerce.consumer_key'),
@@ -45,10 +44,8 @@ public function __construct()
4544
'timeout' => config('woocommerce.timeout'),
4645
]
4746
);
48-
49-
} catch ( \Exception $e) {
47+
} catch (\Exception $e) {
5048
throw new \Exception($e->getMessages(), 1);
51-
5249
}
5350
}
5451
}

0 commit comments

Comments
 (0)