diff options
author | jld3103 <jld3103yt@gmail.com> | 2023-03-31 09:28:22 +0200 |
---|---|---|
committer | jld3103 <jld3103yt@gmail.com> | 2023-04-07 09:49:42 +0200 |
commit | b153340b6292c0790666e0542677bcf47f2e9b59 (patch) | |
tree | b13fb2b10cc38833a2a05ec44a410188a571c6a6 /lib/private/Metadata | |
parent | 012624743917cf9388f2abd33760a50d83d497e9 (diff) | |
download | nextcloud-server-b153340b6292c0790666e0542677bcf47f2e9b59.tar.gz nextcloud-server-b153340b6292c0790666e0542677bcf47f2e9b59.zip |
Add type hints for mappers
Signed-off-by: jld3103 <jld3103yt@gmail.com>
Diffstat (limited to 'lib/private/Metadata')
-rw-r--r-- | lib/private/Metadata/FileMetadataMapper.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/private/Metadata/FileMetadataMapper.php b/lib/private/Metadata/FileMetadataMapper.php index f3120e5e515..594ac5eafba 100644 --- a/lib/private/Metadata/FileMetadataMapper.php +++ b/lib/private/Metadata/FileMetadataMapper.php @@ -30,6 +30,9 @@ use OCP\DB\Exception; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; +/** + * @template-extends QBMapper<FileMetadata> + */ class FileMetadataMapper extends QBMapper { public function __construct(IDBConnection $db) { parent::__construct($db, 'file_metadata', FileMetadata::class); @@ -109,11 +112,11 @@ class FileMetadataMapper extends QBMapper { * Updates an entry in the db from an entity * * @param Entity $entity the entity that should be created - * @return Entity the saved entity with the set id + * @return FileMetadata the saved entity with the set id * @throws Exception * @throws \InvalidArgumentException if entity has no id */ - public function update(Entity $entity): Entity { + public function update(Entity $entity): FileMetadata { if (!($entity instanceof FileMetadata)) { throw new \Exception("Entity should be a FileMetadata entity"); } |