summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-10-09 14:33:17 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-10-12 11:10:09 +0200
commit2664c7f75fb0008356c6ab03aba991db4c445860 (patch)
tree2199e401fc70ff5dcc2e2e50a4da158c0670374c
parenta1b351036c62e5557ff4f718a919188d23db7332 (diff)
downloadnextcloud-server-2664c7f75fb0008356c6ab03aba991db4c445860.tar.gz
nextcloud-server-2664c7f75fb0008356c6ab03aba991db4c445860.zip
Type some of the core mappers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r--apps/contactsinteraction/lib/Db/RecentContactMapper.php3
-rw-r--r--apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php3
-rw-r--r--lib/private/Authentication/Token/DefaultTokenMapper.php3
-rw-r--r--lib/private/Authentication/Token/PublicKeyTokenMapper.php3
-rw-r--r--lib/private/Authentication/Token/PublicKeyTokenProvider.php2
-rw-r--r--lib/private/Authentication/WebAuthn/Db/PublicKeyCredentialMapper.php3
6 files changed, 16 insertions, 1 deletions
diff --git a/apps/contactsinteraction/lib/Db/RecentContactMapper.php b/apps/contactsinteraction/lib/Db/RecentContactMapper.php
index 19cd30ea701..40605d130ff 100644
--- a/apps/contactsinteraction/lib/Db/RecentContactMapper.php
+++ b/apps/contactsinteraction/lib/Db/RecentContactMapper.php
@@ -30,6 +30,9 @@ use OCP\AppFramework\Db\QBMapper;
use OCP\IDBConnection;
use OCP\IUser;
+/**
+ * @template-extends QBMapper<RecentContact>
+ */
class RecentContactMapper extends QBMapper {
public const TABLE_NAME = 'recent_contact';
diff --git a/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php b/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php
index 48c3fd6a84d..84972a5171a 100644
--- a/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php
+++ b/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php
@@ -30,6 +30,9 @@ use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\IUser;
+/**
+ * @template-extends QBMapper<BackupCode>
+ */
class BackupCodeMapper extends QBMapper {
public function __construct(IDBConnection $db) {
parent::__construct($db, 'twofactor_backupcodes');
diff --git a/lib/private/Authentication/Token/DefaultTokenMapper.php b/lib/private/Authentication/Token/DefaultTokenMapper.php
index e51033ed1df..40d503772b0 100644
--- a/lib/private/Authentication/Token/DefaultTokenMapper.php
+++ b/lib/private/Authentication/Token/DefaultTokenMapper.php
@@ -35,6 +35,9 @@ use OCP\AppFramework\Db\QBMapper;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
+/**
+ * @template-extends QBMapper<DefaultToken>
+ */
class DefaultTokenMapper extends QBMapper {
public function __construct(IDBConnection $db) {
parent::__construct($db, 'authtoken');
diff --git a/lib/private/Authentication/Token/PublicKeyTokenMapper.php b/lib/private/Authentication/Token/PublicKeyTokenMapper.php
index e05325fec30..11d610bc283 100644
--- a/lib/private/Authentication/Token/PublicKeyTokenMapper.php
+++ b/lib/private/Authentication/Token/PublicKeyTokenMapper.php
@@ -32,6 +32,9 @@ use OCP\AppFramework\Db\QBMapper;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
+/**
+ * @template-extends QBMapper<PublicKeyToken>
+ */
class PublicKeyTokenMapper extends QBMapper {
public function __construct(IDBConnection $db) {
parent::__construct($db, 'authtoken');
diff --git a/lib/private/Authentication/Token/PublicKeyTokenProvider.php b/lib/private/Authentication/Token/PublicKeyTokenProvider.php
index a6498ca9923..df50da2f03a 100644
--- a/lib/private/Authentication/Token/PublicKeyTokenProvider.php
+++ b/lib/private/Authentication/Token/PublicKeyTokenProvider.php
@@ -219,7 +219,7 @@ class PublicKeyTokenProvider implements IProvider {
$activityInterval = $this->config->getSystemValueInt('token_auth_activity_update', 60);
$activityInterval = min(max($activityInterval, 0), 300);
- /** @var DefaultToken $token */
+ /** @var PublicKeyToken $token */
$now = $this->time->getTime();
if ($token->getLastActivity() < ($now - $activityInterval)) {
// Update token only once per minute
diff --git a/lib/private/Authentication/WebAuthn/Db/PublicKeyCredentialMapper.php b/lib/private/Authentication/WebAuthn/Db/PublicKeyCredentialMapper.php
index 9c436b38b5d..e0f06db565d 100644
--- a/lib/private/Authentication/WebAuthn/Db/PublicKeyCredentialMapper.php
+++ b/lib/private/Authentication/WebAuthn/Db/PublicKeyCredentialMapper.php
@@ -30,6 +30,9 @@ use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\QBMapper;
use OCP\IDBConnection;
+/**
+ * @template-extends QBMapper<PublicKeyCredentialEntity>
+ */
class PublicKeyCredentialMapper extends QBMapper {
public function __construct(IDBConnection $db) {
parent::__construct($db, 'webauthn', PublicKeyCredentialEntity::class);