diff --git a/src/Endpoints/Collections/Points.php b/src/Endpoints/Collections/Points.php index e1f9d97..af3bf50 100644 --- a/src/Endpoints/Collections/Points.php +++ b/src/Endpoints/Collections/Points.php @@ -43,9 +43,11 @@ public function search(SearchRequest $searchParams): Response } /** + * @param Filter|ScrollRequest|null $scrollParams + * @param array $queryParams * @throws InvalidArgumentException */ - public function scroll(Filter|ScrollRequest $scrollParams = null, array $queryParams = []): Response + public function scroll($scrollParams = null, array $queryParams = []): Response { $body = []; if ($scrollParams instanceof Filter) { @@ -113,9 +115,11 @@ public function ids(array $ids, $withPayload = false, $withVector = true, array } /** + * @param int|string $id + * @param array $queryParams * @throws InvalidArgumentException */ - public function id(int|string $id, array $queryParams = []): Response + public function id($id, array $queryParams = []): Response { return $this->client->execute( $this->createRequest( diff --git a/src/Models/Traits/ProtectedPropertyAccessor.php b/src/Models/Traits/ProtectedPropertyAccessor.php index 69d9225..5210254 100644 --- a/src/Models/Traits/ProtectedPropertyAccessor.php +++ b/src/Models/Traits/ProtectedPropertyAccessor.php @@ -5,6 +5,16 @@ use InvalidArgumentException; use ReflectionProperty; +/** + * @see https://www.php.net/manual/en/function.str-starts-with + */ +if (!function_exists('str_starts_with')) { + function str_starts_with(string $haystack, string $needle): bool + { + return strlen($needle) === 0 || strpos($haystack, $needle) === 0; + } +} + /** * Trait ProtectedPropertyAccessor *