Skip to content

Commit 4973d8a

Browse files
committed
Fine tuning return type for getLastCalledUrl() method
1 parent 87a8eea commit 4973d8a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/StoryblokResponse.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,14 @@ public function getResponseStatusCode(): int
8989
return $this->response->getStatusCode();
9090
}
9191

92-
public function getLastCalledUrl(): mixed
92+
public function getLastCalledUrl(): string
9393
{
94-
return $this->response->getInfo('url');
94+
if (is_scalar($this->response->getInfo('url'))) {
95+
return strval($this->response->getInfo('url'));
96+
}
97+
98+
return "";
99+
95100
}
96101

97102
public function isOk(): bool

src/StoryblokResponseInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function toArray(): array;
3636

3737
public function data(): StoryblokDataInterface;
3838

39-
public function getLastCalledUrl(): mixed;
39+
public function getLastCalledUrl(): string;
4040

4141
public function isOk(): bool;
4242

0 commit comments

Comments
 (0)