From f017c29c8b5b023edb3f4d19790ded29287c6312 Mon Sep 17 00:00:00 2001 From: Frugan Date: Mon, 12 Feb 2024 15:26:35 +0100 Subject: [PATCH] Fixed typecast of populate argument --- src/LaravelStrapi.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/LaravelStrapi.php b/src/LaravelStrapi.php index 4f9c91b..e55ba30 100644 --- a/src/LaravelStrapi.php +++ b/src/LaravelStrapi.php @@ -39,7 +39,7 @@ public function __construct() } } - public function collection(string $type, $sortKey = 'id', $sortOrder = 'DESC', $limit = 20, $start = 0, $fullUrls = true, array $populate = [], array $queryData = []): array + public function collection(string $type, $sortKey = 'id', $sortOrder = 'DESC', $limit = 20, $start = 0, $fullUrls = true, array|string $populate = [], array $queryData = []): array { $endpoint = $this->strapiUrl.'/'.$type; @@ -99,7 +99,7 @@ public function collectionCount(string $type): int }); } - public function entry(string $type, int $id, $fullUrls = true, array $populate = [], array $queryData = []): array + public function entry(string $type, int $id, $fullUrls = true, array|string $populate = [], array $queryData = []): array { $endpoint = $this->strapiUrl.'/'.$type.'/'.$id; @@ -140,7 +140,7 @@ public function entry(string $type, int $id, $fullUrls = true, array $populate = return $return; } - public function entriesByField(string $type, string $fieldName, $fieldValue, $fullUrls = true, array $populate = [], array $queryData = []): array + public function entriesByField(string $type, string $fieldName, $fieldValue, $fullUrls = true, array|string $populate = [], array $queryData = []): array { $endpoint = $this->strapiUrl.'/'.$type; @@ -183,7 +183,7 @@ public function entriesByField(string $type, string $fieldName, $fieldValue, $fu return $entries; } - public function single(string $type, string $pluck = null, $fullUrls = true, array $populate = [], array $queryData = []): array + public function single(string $type, string $pluck = null, $fullUrls = true, array|string $populate = [], array $queryData = []): array { $endpoint = $this->strapiUrl.'/'.$type;