Skip to content

Commit f013c24

Browse files
authored
Merge pull request #56 from Codexshaper/analysis-jL9y6J
Apply fixes from StyleCI
2 parents 6eb92fe + 4ba4c2a commit f013c24

File tree

8 files changed

+51
-53
lines changed

8 files changed

+51
-53
lines changed

src/Models/Customer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ class Customer extends BaseModel
1414
/**
1515
* Download.
1616
*
17-
* @param int $id
17+
* @param int $id
1818
*
1919
* @return object
2020
*/
2121
protected function downloads($id)
2222
{
23-
return Query::init()
23+
return Query::init()
2424
->setEndpoint("customers/{$id}/downloads")
2525
->all($options);
2626
}

src/Models/Note.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ protected function delete($order_id, $note_id, $options = [])
7777
* Paginate results.
7878
*
7979
*
80-
* @param int $order_id
81-
* @param int $per_page
82-
* @param int $current_page
80+
* @param int $order_id
81+
* @param int $per_page
82+
* @param int $current_page
8383
* @param array $options
8484
*
8585
* @return array

src/Models/Order.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function notes($order_id, $options = [])
3333
* @param int $note_id
3434
* @param array $options
3535
*
36-
* @return Object
36+
* @return object
3737
*/
3838
protected function note($order_id, $note_id, $options = [])
3939
{
@@ -48,7 +48,7 @@ protected function note($order_id, $note_id, $options = [])
4848
* @param int $order_id
4949
* @param array $data
5050
*
51-
* @return Object
51+
* @return object
5252
*/
5353
protected function createNote($order_id, $data = [])
5454
{
@@ -64,7 +64,7 @@ protected function createNote($order_id, $data = [])
6464
* @param int $note_id
6565
* @param array $options
6666
*
67-
* @return Object
67+
* @return object
6868
*/
6969
protected function deleteNote($order_id, $note_id, $options = [])
7070
{
@@ -95,7 +95,7 @@ protected function refunds($order_id, $options = [])
9595
* @param int $refund_id
9696
* @param array $options
9797
*
98-
* @return Object
98+
* @return object
9999
*/
100100
protected function refund($order_id, $refund_id, $options = [])
101101
{
@@ -110,7 +110,7 @@ protected function refund($order_id, $refund_id, $options = [])
110110
* @param int $order_id
111111
* @param array $data
112112
*
113-
* @return Object
113+
* @return object
114114
*/
115115
protected function createRefund($order_id, $data = [])
116116
{
@@ -126,7 +126,7 @@ protected function createRefund($order_id, $data = [])
126126
* @param int $refund_id
127127
* @param array $options
128128
*
129-
* @return Object
129+
* @return object
130130
*/
131131
protected function deleteRefund($order_id, $refund_id, $options = [])
132132
{

src/Models/Refund.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ protected function delete($order_id, $refund_id, $options = [])
7676
/**
7777
* Paginate results.
7878
*
79-
* @param int $order_id
80-
* @param int $per_page
81-
* @param int $current_page
79+
* @param int $order_id
80+
* @param int $per_page
81+
* @param int $current_page
8282
* @param array $options
8383
*
8484
* @return array

src/Models/Term.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class Term extends BaseModel
99
{
1010
use QueryBuilderTrait;
11-
11+
1212
protected $endpoint;
1313

1414
/**
@@ -107,9 +107,9 @@ protected function batch($attribute_id, $data)
107107
/**
108108
* Paginate results.
109109
*
110-
* @param int $attribute_id
111-
* @param int $per_page
112-
* @param int $current_page
110+
* @param int $attribute_id
111+
* @param int $per_page
112+
* @param int $current_page
113113
* @param array $options
114114
*
115115
* @return array

src/Models/Variation.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Codexshaper\WooCommerce\Models;
44

5-
use Codexshaper\WooCommerce\Traits\QueryBuilderTrait;
65
use Codexshaper\WooCommerce\Facades\Query;
6+
use Codexshaper\WooCommerce\Traits\QueryBuilderTrait;
77

88
class Variation extends BaseModel
99
{
@@ -70,7 +70,7 @@ protected function update($product_id, $id, $data)
7070
{
7171
return Query::init()
7272
->setEndpoint("products/{$product_id}/variations")
73-
->update($id, $data);;
73+
->update($id, $data);
7474
}
7575

7676
/**
@@ -107,9 +107,9 @@ protected function batch($product_id, $data)
107107
/**
108108
* Paginate results.
109109
*
110-
* @param int $product_id
111-
* @param int $per_page
112-
* @param int $current_page
110+
* @param int $product_id
111+
* @param int $per_page
112+
* @param int $current_page
113113
* @param array $options
114114
*
115115
* @return array

src/Query.php

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,29 @@
77

88
class Query extends BaseMOdel
99
{
10-
use QueryBuilderTrait;
11-
12-
protected $endpoint;
13-
protected static $instance = null;
14-
15-
public function __construct($endpoint = '')
16-
{
17-
$this->endpoint = $endpoint;
18-
}
19-
20-
public function setEndpoint($endpoint)
21-
{
22-
$this->endpoint = $endpoint;
23-
return $this;
24-
}
25-
26-
public function init()
27-
{
28-
if (!static::$instance) {
29-
static::$instance = new static();
30-
}
31-
32-
return static::$instance;
33-
}
34-
}
10+
use QueryBuilderTrait;
11+
12+
protected $endpoint;
13+
protected static $instance = null;
14+
15+
public function __construct($endpoint = '')
16+
{
17+
$this->endpoint = $endpoint;
18+
}
19+
20+
public function setEndpoint($endpoint)
21+
{
22+
$this->endpoint = $endpoint;
23+
24+
return $this;
25+
}
26+
27+
public function init()
28+
{
29+
if (!static::$instance) {
30+
static::$instance = new static();
31+
}
32+
33+
return static::$instance;
34+
}
35+
}

src/Traits/QueryBuilderTrait.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ protected function all($options = [])
5555
}
5656

5757
return WooCommerce::all($this->endpoint, $options);
58-
5958
}
6059

6160
/**
@@ -186,7 +185,6 @@ protected function get()
186185
*/
187186
protected function first()
188187
{
189-
190188
if ($this->isLazyCollection) {
191189
return LazyCollection::make($this->get()[0] ?? new \stdClass());
192190
}
@@ -310,8 +308,8 @@ protected function orderBy($name, $direction = 'desc')
310308
/**
311309
* Paginate results.
312310
*
313-
* @param int $per_page
314-
* @param int $current_page
311+
* @param int $per_page
312+
* @param int $current_page
315313
* @param array $options
316314
*
317315
* @return array
@@ -357,7 +355,6 @@ protected function paginate($per_page = 10, $current_page = 1, $options = [])
357355
}
358356

359357
return $results;
360-
361358
} catch (\Exception $ex) {
362359
throw new \Exception($ex->getMessage(), 1);
363360
}

0 commit comments

Comments
 (0)