mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Improve typing
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
9b78699f0a
commit
652158a72c
1 changed files with 3 additions and 8 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Reference in a new issue