Skip to content

Commit a7137ca

Browse files
committed
fix: updated php-sdk
1 parent fb9e3db commit a7137ca

10 files changed

+53
-35
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hostinger/api-php-sdk",
3-
"version": "0.0.32",
3+
"version": "0.0.33",
44
"description": "Hostinger API PHP SDK",
55
"keywords": [
66
"hostinger",

src/Api/BillingCatalogApi.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ public function getConfig(): Configuration
6161
public function getCatalogItemListV1(?string $category = null, ?string $name = null)
6262
{
6363
$query = http_build_query(
64-
array_filter([
65-
'category' => $category,
66-
'name' => $name,
67-
])
64+
array_filter(
65+
$this->serializer->normalize([
66+
'category' => $category,
67+
'name' => $name,
68+
])
69+
)
6870
);
6971

7072
$request = new Request(

src/Api/DomainsWHOISApi.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,11 @@ public function deleteWHOISProfileV1(int $whoisId)
114114
public function getWHOISProfileListV1(?string $tld = null)
115115
{
116116
$query = http_build_query(
117-
array_filter([
118-
'tld' => $tld,
119-
])
117+
array_filter(
118+
$this->serializer->normalize([
119+
'tld' => $tld,
120+
])
121+
)
120122
);
121123

122124
$request = new Request(

src/Api/VPSActionsApi.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,18 @@ public function getActionDetailsV1(int $virtualMachineId, int $actionId)
8888
public function getActionsV1(int $virtualMachineId, ?int $page = null)
8989
{
9090
$query = http_build_query(
91-
array_filter([
92-
'page' => $page,
93-
])
91+
array_filter(
92+
$this->serializer->normalize([
93+
'page' => $page,
94+
])
95+
)
9496
);
9597

9698
$request = new Request(
9799
method: 'GET',
98100
uri: $this->buildResourcePath('/api/vps/v1/virtual-machines/{virtualMachineId}/actions', [
99101
'virtualMachineId' => $virtualMachineId
100-
]) . $query,
102+
]) . '?' . $query,
101103
headers: $this->getHeaders(),
102104
);
103105

src/Api/VPSBackupsApi.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,18 @@ public function getConfig(): Configuration
6161
public function getBackupsV1(int $virtualMachineId, ?int $page = null)
6262
{
6363
$query = http_build_query(
64-
array_filter([
65-
'page' => $page,
66-
])
64+
array_filter(
65+
$this->serializer->normalize([
66+
'page' => $page,
67+
])
68+
)
6769
);
6870

6971
$request = new Request(
7072
method: 'GET',
7173
uri: $this->buildResourcePath('/api/vps/v1/virtual-machines/{virtualMachineId}/backups', [
7274
'virtualMachineId' => $virtualMachineId
73-
]) . $query,
75+
]) . '?' . $query,
7476
headers: $this->getHeaders(),
7577
);
7678

src/Api/VPSFirewallApi.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,11 @@ public function getFirewallDetailsV1(int $firewallId)
250250
public function getFirewallListV1(?int $page = null)
251251
{
252252
$query = http_build_query(
253-
array_filter([
254-
'page' => $page,
255-
])
253+
array_filter(
254+
$this->serializer->normalize([
255+
'page' => $page,
256+
])
257+
)
256258
);
257259

258260
$request = new Request(

src/Api/VPSPostInstallScriptsApi.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,11 @@ public function getPostInstallScriptV1(int $postInstallScriptId)
141141
public function getPostInstallScriptsV1(?int $page = null)
142142
{
143143
$query = http_build_query(
144-
array_filter([
145-
'page' => $page,
146-
])
144+
array_filter(
145+
$this->serializer->normalize([
146+
'page' => $page,
147+
])
148+
)
147149
);
148150

149151
$request = new Request(

src/Api/VPSPublicKeysApi.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,11 @@ public function deletePublicKeyV1(int $publicKeyId)
142142
public function getPublicKeysV1(?int $page = null)
143143
{
144144
$query = http_build_query(
145-
array_filter([
146-
'page' => $page,
147-
])
145+
array_filter(
146+
$this->serializer->normalize([
147+
'page' => $page,
148+
])
149+
)
148150
);
149151

150152
$request = new Request(

src/Api/VPSVirtualMachineApi.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,18 @@ public function getConfig(): Configuration
6161
public function getAttachedPublicKeysV1(int $virtualMachineId, ?int $page = null)
6262
{
6363
$query = http_build_query(
64-
array_filter([
65-
'page' => $page,
66-
])
64+
array_filter(
65+
$this->serializer->normalize([
66+
'page' => $page,
67+
])
68+
)
6769
);
6870

6971
$request = new Request(
7072
method: 'GET',
7173
uri: $this->buildResourcePath('/api/vps/v1/virtual-machines/{virtualMachineId}/public-keys', [
7274
'virtualMachineId' => $virtualMachineId
73-
]) . $query,
75+
]) . '?' . $query,
7476
headers: $this->getHeaders(),
7577
);
7678

@@ -94,17 +96,19 @@ public function getAttachedPublicKeysV1(int $virtualMachineId, ?int $page = null
9496
public function getMetricsV1(int $virtualMachineId, \DateTime $dateFrom, \DateTime $dateTo)
9597
{
9698
$query = http_build_query(
97-
array_filter([
98-
'date_from' => $dateFrom,
99-
'date_to' => $dateTo,
100-
])
99+
array_filter(
100+
$this->serializer->normalize([
101+
'date_from' => $dateFrom,
102+
'date_to' => $dateTo,
103+
])
104+
)
101105
);
102106

103107
$request = new Request(
104108
method: 'GET',
105109
uri: $this->buildResourcePath('/api/vps/v1/virtual-machines/{virtualMachineId}/metrics', [
106110
'virtualMachineId' => $virtualMachineId
107-
]) . $query,
111+
]) . '?' . $query,
108112
headers: $this->getHeaders(),
109113
);
110114

src/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Configuration
2020

2121
protected string $host = 'https://developers.hostinger.com';
2222

23-
protected string $userAgent = 'hostinger-php-sdk/0.0.32';
23+
protected string $userAgent = 'hostinger-php-sdk/0.0.33';
2424

2525
protected bool $debug = false;
2626

0 commit comments

Comments
 (0)