Skip to content

Commit

Permalink
fixing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
YOUR1 committed Dec 13, 2023
1 parent 46f4ef6 commit 826e3d9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Endpoints/Collections/Points.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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(
Expand Down
10 changes: 10 additions & 0 deletions src/Models/Traits/ProtectedPropertyAccessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit 826e3d9

Please sign in to comment.