Skip to content

Commit 1571172

Browse files
committed
fix: updated php-sdk
1 parent 5b30f30 commit 1571172

25 files changed

+49
-49
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hostinger/api-php-sdk",
3-
"version": "0.0.28",
3+
"version": "0.0.29",
44
"description": "Hostinger API PHP SDK",
55
"keywords": [
66
"hostinger",
@@ -19,7 +19,7 @@
1919
}
2020
],
2121
"require": {
22-
"php": "^8.1",
22+
"php": "^8.2",
2323
"ext-curl": "*",
2424
"ext-json": "*",
2525
"ext-mbstring": "*",

src/Api/BillingCatalogApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ public function getCatalogItemListV1(?string $category = null, ?string $name = n
8585

8686
private function buildResourcePath(string $path, mixed ...$values): string
8787
{
88-
foreach ($values as $value) {
88+
foreach ($values as $key => $value) {
8989
if (is_array($value)) {
9090
$value = implode(',', $value);
9191
}
9292

93-
$path = str_replace('{' . 'BillingCatalog' . '}', $value, $path);
93+
$path = str_replace('{' . $key . '}', $value, $path);
9494
}
9595

9696
return $path;

src/Api/BillingOrdersApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ public function createServiceOrderV1(\Hostinger\Model\BillingV1OrderStoreRequest
7979

8080
private function buildResourcePath(string $path, mixed ...$values): string
8181
{
82-
foreach ($values as $value) {
82+
foreach ($values as $key => $value) {
8383
if (is_array($value)) {
8484
$value = implode(',', $value);
8585
}
8686

87-
$path = str_replace('{' . 'BillingOrders' . '}', $value, $path);
87+
$path = str_replace('{' . $key . '}', $value, $path);
8888
}
8989

9090
return $path;

src/Api/BillingPaymentMethodsApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ public function setDefaultPaymentMethodV1(int $paymentMethodId)
130130

131131
private function buildResourcePath(string $path, mixed ...$values): string
132132
{
133-
foreach ($values as $value) {
133+
foreach ($values as $key => $value) {
134134
if (is_array($value)) {
135135
$value = implode(',', $value);
136136
}
137137

138-
$path = str_replace('{' . 'BillingPaymentMethods' . '}', $value, $path);
138+
$path = str_replace('{' . $key . '}', $value, $path);
139139
}
140140

141141
return $path;

src/Api/BillingSubscriptionsApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ public function getSubscriptionListV1()
105105

106106
private function buildResourcePath(string $path, mixed ...$values): string
107107
{
108-
foreach ($values as $value) {
108+
foreach ($values as $key => $value) {
109109
if (is_array($value)) {
110110
$value = implode(',', $value);
111111
}
112112

113-
$path = str_replace('{' . 'BillingSubscriptions' . '}', $value, $path);
113+
$path = str_replace('{' . $key . '}', $value, $path);
114114
}
115115

116116
return $path;

src/Api/DNSSnapshotApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ public function restoreDNSSnapshotV1(string $domain, int $snapshotId)
130130

131131
private function buildResourcePath(string $path, mixed ...$values): string
132132
{
133-
foreach ($values as $value) {
133+
foreach ($values as $key => $value) {
134134
if (is_array($value)) {
135135
$value = implode(',', $value);
136136
}
137137

138-
$path = str_replace('{' . 'DNSSnapshot' . '}', $value, $path);
138+
$path = str_replace('{' . $key . '}', $value, $path);
139139
}
140140

141141
return $path;

src/Api/DNSZoneApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@ public function validateDNSRecordsV1(string $domain, \Hostinger\Model\DNSV1ZoneU
186186

187187
private function buildResourcePath(string $path, mixed ...$values): string
188188
{
189-
foreach ($values as $value) {
189+
foreach ($values as $key => $value) {
190190
if (is_array($value)) {
191191
$value = implode(',', $value);
192192
}
193193

194-
$path = str_replace('{' . 'DNSZone' . '}', $value, $path);
194+
$path = str_replace('{' . $key . '}', $value, $path);
195195
}
196196

197197
return $path;

src/Api/DomainsAvailabilityApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ public function checkDomainAvailabilityV1(\Hostinger\Model\DomainsV1Availability
7979

8080
private function buildResourcePath(string $path, mixed ...$values): string
8181
{
82-
foreach ($values as $value) {
82+
foreach ($values as $key => $value) {
8383
if (is_array($value)) {
8484
$value = implode(',', $value);
8585
}
8686

87-
$path = str_replace('{' . 'DomainsAvailability' . '}', $value, $path);
87+
$path = str_replace('{' . $key . '}', $value, $path);
8888
}
8989

9090
return $path;

src/Api/DomainsForwardingApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ public function getDomainForwardingV1(string $domain)
131131

132132
private function buildResourcePath(string $path, mixed ...$values): string
133133
{
134-
foreach ($values as $value) {
134+
foreach ($values as $key => $value) {
135135
if (is_array($value)) {
136136
$value = implode(',', $value);
137137
}
138138

139-
$path = str_replace('{' . 'DomainsForwarding' . '}', $value, $path);
139+
$path = str_replace('{' . $key . '}', $value, $path);
140140
}
141141

142142
return $path;

src/Api/DomainsPortfolioApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,12 @@ public function updateDomainNameserversV1(string $domain, \Hostinger\Model\Domai
262262

263263
private function buildResourcePath(string $path, mixed ...$values): string
264264
{
265-
foreach ($values as $value) {
265+
foreach ($values as $key => $value) {
266266
if (is_array($value)) {
267267
$value = implode(',', $value);
268268
}
269269

270-
$path = str_replace('{' . 'DomainsPortfolio' . '}', $value, $path);
270+
$path = str_replace('{' . $key . '}', $value, $path);
271271
}
272272

273273
return $path;

0 commit comments

Comments
 (0)