diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-05-04 23:58:45 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2017-05-18 20:49:04 +0200 |
commit | 0a2b57c93fb8231615dbbf2aebba369d78700541 (patch) | |
tree | b7f317d7cbeea5dd2d390feca8473460db3ad9db /apps/oauth2 | |
parent | a5ddd65c10ff8812f6b49bc9703a2858a6c323e6 (diff) | |
download | nextcloud-server-0a2b57c93fb8231615dbbf2aebba369d78700541.tar.gz nextcloud-server-0a2b57c93fb8231615dbbf2aebba369d78700541.zip |
Get a single row
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'apps/oauth2')
-rw-r--r-- | apps/oauth2/lib/Db/AccessTokenMapper.php | 6 | ||||
-rw-r--r-- | apps/oauth2/lib/Db/ClientMapper.php | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/apps/oauth2/lib/Db/AccessTokenMapper.php b/apps/oauth2/lib/Db/AccessTokenMapper.php index 0b54d5c3da4..9702e2c58fd 100644 --- a/apps/oauth2/lib/Db/AccessTokenMapper.php +++ b/apps/oauth2/lib/Db/AccessTokenMapper.php @@ -44,10 +44,8 @@ class AccessTokenMapper extends Mapper { ->from($this->tableName) ->where($qb->expr()->eq('hashed_code', $qb->createNamedParameter(hash('sha512', $code)))); $result = $qb->execute(); - $rows = $result->fetchAll(); + $row = $result->fetchAll(); $result->closeCursor(); - return array_map(function ($row) { - return AccessToken::fromRow($row); - }, $rows); + return AccessToken::fromRow($row); } } diff --git a/apps/oauth2/lib/Db/ClientMapper.php b/apps/oauth2/lib/Db/ClientMapper.php index 8d1f26ce471..8531f6d007c 100644 --- a/apps/oauth2/lib/Db/ClientMapper.php +++ b/apps/oauth2/lib/Db/ClientMapper.php @@ -44,11 +44,9 @@ class ClientMapper extends Mapper { ->from($this->tableName) ->where($qb->expr()->eq('client_identifier', $qb->createNamedParameter($clientIdentifier))); $result = $qb->execute(); - $rows = $result->fetchAll(); + $row = $result->fetch(); $result->closeCursor(); - return array_map(function ($row) { - return Client::fromRow($row); - }, $rows); + return Client::fromRow($row); } /** |