From b9b0b7bf118da34de4691c39cec15b430ab4d76e Mon Sep 17 00:00:00 2001 From: Christopher Hertel Date: Fri, 7 Mar 2025 15:15:20 +0100 Subject: [PATCH 1/2] Add PHP 8.4 to CI matrix --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 17b946c..750bd31 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: true matrix: - php: [ 8.1, 8.2, 8.3 ] + php: [ 8.1, 8.2, 8.3, 8.4 ] dependency-version: [ prefer-lowest, prefer-stable ] name: Tests on PHP ${{ matrix.php }} - ${{ matrix.dependency-version }} @@ -49,4 +49,4 @@ jobs: run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist - name: Run tests - run: composer test \ No newline at end of file + run: composer test From 9145103e9a7c1a288b0d9fc4fd8c391d1a888498 Mon Sep 17 00:00:00 2001 From: Christopher Hertel Date: Fri, 7 Mar 2025 15:15:39 +0100 Subject: [PATCH 2/2] Fix PHP 8.4 deprecations --- src/Generated/Exceptions/ValidationException.php | 4 ++-- src/Resources/CollectionResource.php | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Generated/Exceptions/ValidationException.php b/src/Generated/Exceptions/ValidationException.php index 3a4e41c..219c652 100644 --- a/src/Generated/Exceptions/ValidationException.php +++ b/src/Generated/Exceptions/ValidationException.php @@ -12,7 +12,7 @@ public function __construct( string $message, public readonly string $type, int $code = 422, - \Throwable $previous = null) + \Throwable|null $previous = null) { parent::__construct($message, $code, $previous); } @@ -40,4 +40,4 @@ public function toArray(): array ]; } -} \ No newline at end of file +} diff --git a/src/Resources/CollectionResource.php b/src/Resources/CollectionResource.php index 45c6354..638c0fc 100644 --- a/src/Resources/CollectionResource.php +++ b/src/Resources/CollectionResource.php @@ -205,7 +205,7 @@ public function count(): int */ public function peek( int $limit = 10, - array $include = null + ?array $include = null ): GetItemsResponse { $include ??= ['embeddings', 'metadatas', 'distances']; @@ -275,13 +275,13 @@ public function delete(?array $ids = null, ?array $where = null, ?array $whereDo * */ public function query( - array $queryEmbeddings = null, - array $queryTexts = null, - array $queryImages = null, + ?array $queryEmbeddings = null, + ?array $queryTexts = null, + ?array $queryImages = null, int $nResults = 10, - array $where = null, - array $whereDocument = null, - array $include = null + ?array $where = null, + ?array $whereDocument = null, + ?array $include = null ): QueryItemsResponse { $include ??= ['embeddings', 'metadatas', 'distances']; @@ -418,4 +418,4 @@ function validate( } -} \ No newline at end of file +}