@@ -62,19 +62,19 @@ |
||
62 | 62 | const POLICY_CONTINUE = 'continue'; |
63 | 63 | const POLICY_DENY = 'deny'; |
64 | 64 | |
65 | - final protected static function getMetafieldType (): string { |
|
65 | + final protected static function getMetafieldType(): string { |
|
66 | 66 | return 'product_variant'; |
67 | 67 | } |
68 | 68 | |
69 | - final protected static function getType (): string { |
|
69 | + final protected static function getType(): string { |
|
70 | 70 | return 'variant'; |
71 | 71 | } |
72 | 72 | |
73 | - final public function __toString (): string { |
|
73 | + final public function __toString(): string { |
|
74 | 74 | return "variants/{$this->getId()}"; |
75 | 75 | } |
76 | 76 | |
77 | - final protected function getDir (): string { |
|
77 | + final protected function getDir(): string { |
|
78 | 78 | return "products/{$this->getProductId()}/variants"; |
79 | 79 | } |
80 | 80 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | /** |
28 | 28 | * @return Traversable|string[] |
29 | 29 | */ |
30 | - public function getIterator () { |
|
30 | + public function getIterator() { |
|
31 | 31 | yield from $this->get('values', []); |
32 | 32 | } |
33 | 33 | } |
34 | 34 | \ No newline at end of file |
@@ -27,30 +27,30 @@ |
||
27 | 27 | 'rules' => [Rule::class, 'toDataSet'], |
28 | 28 | ]; |
29 | 29 | |
30 | - final protected static function getSearchPath (): string { |
|
30 | + final protected static function getSearchPath(): string { |
|
31 | 31 | return 'smart_collections'; |
32 | 32 | } |
33 | 33 | |
34 | - final protected static function getSearchType (): string { |
|
34 | + final protected static function getSearchType(): string { |
|
35 | 35 | return 'smart_collections'; |
36 | 36 | } |
37 | 37 | |
38 | - final protected static function getType (): string { |
|
38 | + final protected static function getType(): string { |
|
39 | 39 | return 'smart_collection'; |
40 | 40 | } |
41 | 41 | |
42 | - final public function __toString (): string { |
|
42 | + final public function __toString(): string { |
|
43 | 43 | return "smart_collections/{$this->getId()}"; |
44 | 44 | } |
45 | 45 | |
46 | - final protected function getDir (): string { |
|
46 | + final protected function getDir(): string { |
|
47 | 47 | return 'smart_collections'; |
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | 51 | * @return Rule |
52 | 52 | */ |
53 | - public function newRule () { |
|
53 | + public function newRule() { |
|
54 | 54 | return $this->data['rules']->add(Rule::toData($this, [])); |
55 | 55 | } |
56 | 56 | } |
57 | 57 | \ No newline at end of file |
@@ -55,23 +55,23 @@ discard block |
||
55 | 55 | 'tax_lines' => [Tax::class, 'toDataSet'] |
56 | 56 | ]; |
57 | 57 | |
58 | - final protected static function getMetafieldType (): string { |
|
58 | + final protected static function getMetafieldType(): string { |
|
59 | 59 | return 'draft_order'; |
60 | 60 | } |
61 | 61 | |
62 | - final protected static function getSearchPath (): string { |
|
62 | + final protected static function getSearchPath(): string { |
|
63 | 63 | return 'draft_orders'; |
64 | 64 | } |
65 | 65 | |
66 | - protected static function getSearchType (): string { |
|
66 | + protected static function getSearchType(): string { |
|
67 | 67 | return 'draft_orders'; |
68 | 68 | } |
69 | 69 | |
70 | - final protected static function getType (): string { |
|
70 | + final protected static function getType(): string { |
|
71 | 71 | return 'draft_order'; |
72 | 72 | } |
73 | 73 | |
74 | - final public function __toString (): string { |
|
74 | + final public function __toString(): string { |
|
75 | 75 | return "draft_orders/{$this->getId()}"; |
76 | 76 | } |
77 | 77 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @param bool $paymentPending |
80 | 80 | * @return $this |
81 | 81 | */ |
82 | - public function complete (bool $paymentPending = false) { |
|
82 | + public function complete(bool $paymentPending = false) { |
|
83 | 83 | assert($this->hasId()); |
84 | 84 | $remote = $this->api->put("{$this}/complete", [ |
85 | 85 | 'payment_pending' => ['false', 'true'][$paymentPending] |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | return $this->import($remote['draft_order']); |
88 | 88 | } |
89 | 89 | |
90 | - final protected function getDir (): string { |
|
90 | + final protected function getDir(): string { |
|
91 | 91 | return 'draft_orders'; |
92 | 92 | } |
93 | 93 | |
94 | - final protected function getMetafieldDir (): string { |
|
94 | + final protected function getMetafieldDir(): string { |
|
95 | 95 | return "{$this}/metafields"; |
96 | 96 | } |
97 | 97 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @param Invoice|null $invoice |
100 | 100 | * @return $this |
101 | 101 | */ |
102 | - public function sendInvoice (Invoice $invoice = null) { |
|
102 | + public function sendInvoice(Invoice $invoice = null) { |
|
103 | 103 | assert($this->hasId()); |
104 | 104 | $this->api->post("{$this}/send_invoice", [ |
105 | 105 | 'draft_order_invoice' => $invoice ? $invoice->getData() : (object)[] |
@@ -19,23 +19,23 @@ |
||
19 | 19 | |
20 | 20 | use SearchTrait; |
21 | 21 | |
22 | - final protected static function getSearchPath (): string { |
|
22 | + final protected static function getSearchPath(): string { |
|
23 | 23 | return 'redirects'; |
24 | 24 | } |
25 | 25 | |
26 | - final protected static function getSearchType (): string { |
|
26 | + final protected static function getSearchType(): string { |
|
27 | 27 | return 'redirects'; |
28 | 28 | } |
29 | 29 | |
30 | - final protected static function getType (): string { |
|
30 | + final protected static function getType(): string { |
|
31 | 31 | return 'redirect'; |
32 | 32 | } |
33 | 33 | |
34 | - final public function __toString (): string { |
|
34 | + final public function __toString(): string { |
|
35 | 35 | return "redirects/{$this->getId()}"; |
36 | 36 | } |
37 | 37 | |
38 | - final protected function getDir (): string { |
|
38 | + final protected function getDir(): string { |
|
39 | 39 | return 'redirects'; |
40 | 40 | } |
41 | 41 | } |
42 | 42 | \ No newline at end of file |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * @param string $id |
52 | 52 | * @return null|User |
53 | 53 | */ |
54 | - public static function load (Api $api, string $id) { |
|
54 | + public static function load(Api $api, string $id) { |
|
55 | 55 | if ($remote = $api->get("users/{$id}")) { |
56 | 56 | return new static($api, $remote['user']); |
57 | 57 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @param Api $api |
63 | 63 | * @return static[] |
64 | 64 | */ |
65 | - public static function loadAll (Api $api) { |
|
65 | + public static function loadAll(Api $api) { |
|
66 | 66 | return array_map(function(array $row) use ($api) { |
67 | 67 | return new static($api, $row); |
68 | 68 | }, $api->get('users')['users']); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @param Api $api |
73 | 73 | * @return User |
74 | 74 | */ |
75 | - public static function me (Api $api) { |
|
75 | + public static function me(Api $api) { |
|
76 | 76 | return new static($api, $api->get("users/current")['user']); |
77 | 77 | } |
78 | 78 |