Skip to content

Commit 6e40fe8

Browse files
committed
Fix phpstan errors
1 parent d6b8454 commit 6e40fe8

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

src/Database/Database.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3720,12 +3720,11 @@ public function deleteIndex(string $collection, string $id): bool
37203720
/**
37213721
* Get Document
37223722
*
3723-
* @template T of Document
37243723
* @param string $collection
37253724
* @param string $id
37263725
* @param Query[] $queries
37273726
* @param bool $forUpdate
3728-
* @return T|Document
3727+
* @return Document
37293728
* @throws NotFoundException
37303729
* @throws QueryException
37313730
* @throws Exception
@@ -4460,10 +4459,9 @@ private function applySelectFiltersToDocuments(array $documents, array $selectQu
44604459
/**
44614460
* Create Document
44624461
*
4463-
* @template T of Document
44644462
* @param string $collection
44654463
* @param Document $document
4466-
* @return T|Document
4464+
* @return Document
44674465
* @throws AuthorizationException
44684466
* @throws DatabaseException
44694467
* @throws StructureException
@@ -5020,11 +5018,10 @@ private function relateDocumentsById(
50205018
/**
50215019
* Update Document
50225020
*
5023-
* @template T of Document
50245021
* @param string $collection
50255022
* @param string $id
50265023
* @param Document $document
5027-
* @return T|Document
5024+
* @return Document
50285025
* @throws AuthorizationException
50295026
* @throws ConflictException
50305027
* @throws DatabaseException
@@ -7137,11 +7134,10 @@ public function purgeCachedDocument(string $collectionId, ?string $id): bool
71377134
/**
71387135
* Find Documents
71397136
*
7140-
* @template T of Document
71417137
* @param string $collection
71427138
* @param array<Query> $queries
71437139
* @param string $forPermission
7144-
* @return array<T|Document>
7140+
* @return array<Document>
71457141
* @throws DatabaseException
71467142
* @throws QueryException
71477143
* @throws TimeoutException

tests/e2e/Adapter/Scopes/CustomDocumentTypeTests.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,18 @@ public function testSetDocumentTypeWithInvalidClass(): void
7272

7373
$this->expectException(DatabaseException::class);
7474
$this->expectExceptionMessage('does not exist');
75-
75+
76+
// @phpstan-ignore-next-line - Testing with invalid class name
7677
$database->setDocumentType('users', 'NonExistentClass');
77-
}
78-
79-
public function testSetDocumentTypeWithNonDocumentClass(): void
78+
} public function testSetDocumentTypeWithNonDocumentClass(): void
8079
{
8180
/** @var Database $database */
8281
$database = static::getDatabase();
8382

8483
$this->expectException(DatabaseException::class);
8584
$this->expectExceptionMessage('must extend');
86-
85+
86+
// @phpstan-ignore-next-line - Testing with non-Document class
8787
$database->setDocumentType('users', \stdClass::class);
8888
}
8989

0 commit comments

Comments
 (0)