Skip to content

Commit

Permalink
fix: return type doc block added as per psalm
Browse files Browse the repository at this point in the history
Signed-off-by: yemkareems <yemkareems@gmail.com>
  • Loading branch information
yemkareems committed Jul 4, 2024
1 parent 839b5d0 commit 070ba4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions lib/private/AllConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ public function getUsersForUserValue($appName, $key, $value) {
* @param int|null $limit how many users to fetch
* @param int $offset from which offset to fetch
* @param string $search search users based on search params
* @return array<string, string> list of user IDs
* @return list<string> list of user IDs
*/
public function getLastLoggedInUsers(?int $limit = null, int $offset = 0, string $search = ''): array {
// TODO - FIXME
Expand All @@ -513,22 +513,23 @@ public function getLastLoggedInUsers(?int $limit = null, int $offset = 0, string
);
if($search !== '') {
$query->leftJoin('u', 'preferences', 'p1', $query->expr()->andX(
$query->expr()->eq('p1.userid', 'uid'),
$query->expr()->eq('p1.appid', $query->expr()->literal('settings')),
$query->expr()->eq('p1.configkey', $query->expr()->literal('email')))
)
$query->expr()->eq('p1.userid', 'uid'),
$query->expr()->eq('p1.appid', $query->expr()->literal('settings')),
$query->expr()->eq('p1.configkey', $query->expr()->literal('email')))
)
// sqlite doesn't like re-using a single named parameter here
->where($query->expr()->iLike('uid', $query->createPositionalParameter('%' . $this->connection->escapeLikeParameter($search) . '%')))
->orWhere($query->expr()->iLike('displayname', $query->createPositionalParameter('%' . $this->connection->escapeLikeParameter($search) . '%')))
->orWhere($query->expr()->iLike('p1.configvalue', $query->createPositionalParameter('%' . $this->connection->escapeLikeParameter($search) . '%'))
);
);
}
$query->orderBy($query->func()->lower('p.configvalue'), 'DESC')
->addOrderBy('uid_lower', 'ASC')
->setFirstResult($offset)
->setMaxResults($limit);

$result = $query->executeQuery();
/** @var list<string> $uids */
$uids = $result->fetchAll(\PDO::FETCH_COLUMN);
$result->closeCursor();

Expand Down
2 changes: 1 addition & 1 deletion lib/public/IConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function getUsersForUserValue($appName, $key, $value);
* @param int|null $limit how many records to fetch
* @param int $offset from which offset to fetch
* @param string $search search users based on search params
* @return array<string, string> list of user IDs
* @return list<string> list of user IDs
* @since 30.0.0
*/
public function getLastLoggedInUsers(?int $limit = null, int $offset = 0, string $search = ''): array;
Expand Down

0 comments on commit 070ba4f

Please sign in to comment.