diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-09-12 17:25:37 +0200 |
---|---|---|
committer | Côme Chilliet (Rebase PR Action) <come-nc@users.noreply.github.com> | 2022-09-19 10:01:49 +0000 |
commit | 652158a72c3f443c49cb8c4658ef69c05f811437 (patch) | |
tree | 6e79ff0e6ce1a470e6a9e3791108436d8af56b90 /lib | |
parent | 9b78699f0a94fb0d5c7dc340cee3644e9553d859 (diff) | |
download | nextcloud-server-652158a72c3f443c49cb8c4658ef69c05f811437.tar.gz nextcloud-server-652158a72c3f443c49cb8c4658ef69c05f811437.zip |
Improve typing
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Tagging/TagMapper.php | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/private/Tagging/TagMapper.php b/lib/private/Tagging/TagMapper.php index 7609347967a..808fce2eeae 100644 --- a/lib/private/Tagging/TagMapper.php +++ b/lib/private/Tagging/TagMapper.php @@ -46,15 +46,11 @@ class TagMapper extends QBMapper { /** * Load tags from the database. * - * @param array|string $owners The user(s) whose tags we are going to load. + * @param array $owners The user(s) whose tags we are going to load. * @param string $type The type of item for which we are loading tags. * @return array An array of Tag objects. */ - public function loadTags($owners, string $type): array { - if (!is_array($owners)) { - $owners = [$owners]; - } - + public function loadTags(array $owners, string $type): array { $qb = $this->db->getQueryBuilder(); $qb->select(['id', 'uid', 'type', 'category']) ->from($this->getTableName()) @@ -68,9 +64,8 @@ class TagMapper extends QBMapper { * Check if a given Tag object already exists in the database. * * @param Tag $tag The tag to look for in the database. - * @return bool */ - public function tagExists($tag) { + public function tagExists(Tag $tag): bool { $qb = $this->db->getQueryBuilder(); $qb->select(['id', 'uid', 'type', 'category']) ->from($this->getTableName()) |