mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 14:23:17 -04:00
Merge pull request #34554 from nextcloud/fix/psalm-twofactor-registry
Fix wrong types in phpdoc for twofactor registry
This commit is contained in:
commit
00c2c620ac
4 changed files with 7 additions and 26 deletions
|
|
@ -1627,16 +1627,6 @@
|
|||
<code>$event->getObjectId()</code>
|
||||
</InvalidScalarArgument>
|
||||
</file>
|
||||
<file src="apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>bool</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>bool</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/updatenotification/lib/Controller/AdminController.php">
|
||||
<InvalidScalarArgument occurrences="2">
|
||||
<code>$this->timeFactory->getTime()</code>
|
||||
|
|
@ -2332,12 +2322,9 @@
|
|||
</UndefinedMethod>
|
||||
</file>
|
||||
<file src="lib/private/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDao.php">
|
||||
<InvalidReturnStatement occurrences="2">
|
||||
<code>$providers</code>
|
||||
</InvalidReturnStatement>
|
||||
<InvalidReturnType occurrences="2">
|
||||
<InvalidReturnStatement occurrences="1"/>
|
||||
<InvalidReturnType occurrences="1">
|
||||
<code>int[]</code>
|
||||
<code>string[]</code>
|
||||
</InvalidReturnType>
|
||||
</file>
|
||||
<file src="lib/private/Authentication/TwoFactorAuth/Manager.php">
|
||||
|
|
@ -2345,12 +2332,6 @@
|
|||
<code>IProvider::EVENT_FAILED</code>
|
||||
<code>IProvider::EVENT_SUCCESS</code>
|
||||
</InvalidArgument>
|
||||
<InvalidReturnStatement occurrences="1">
|
||||
<code>$providerStates</code>
|
||||
</InvalidReturnStatement>
|
||||
<InvalidReturnType occurrences="1">
|
||||
<code>string[]</code>
|
||||
</InvalidReturnType>
|
||||
<InvalidScalarArgument occurrences="2">
|
||||
<code>$this->timeFactory->getTime()</code>
|
||||
<code>$tokenId</code>
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class ProviderUserAssignmentDao {
|
|||
/**
|
||||
* Get all assigned provider IDs for the given user ID
|
||||
*
|
||||
* @return string[] where the array key is the provider ID (string) and the
|
||||
* @return array<string, bool> where the array key is the provider ID (string) and the
|
||||
* value is the enabled state (bool)
|
||||
*/
|
||||
public function getState(string $uid): array {
|
||||
|
|
@ -59,7 +59,7 @@ class ProviderUserAssignmentDao {
|
|||
$result = $query->execute();
|
||||
$providers = [];
|
||||
foreach ($result->fetchAll() as $row) {
|
||||
$providers[$row['provider_id']] = 1 === (int)$row['enabled'];
|
||||
$providers[(string)$row['provider_id']] = 1 === (int)$row['enabled'];
|
||||
}
|
||||
$result->closeCursor();
|
||||
|
||||
|
|
|
|||
|
|
@ -170,10 +170,10 @@ class Manager {
|
|||
*
|
||||
* @todo remove in Nextcloud 17 as by then all providers should have been updated
|
||||
*
|
||||
* @param string[] $providerStates
|
||||
* @param array<string, bool> $providerStates
|
||||
* @param IProvider[] $providers
|
||||
* @param IUser $user
|
||||
* @return string[] the updated $providerStates variable
|
||||
* @return array<string, bool> the updated $providerStates variable
|
||||
*/
|
||||
private function fixMissingProviderStates(array $providerStates,
|
||||
array $providers, IUser $user): array {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ interface IRegistry {
|
|||
* the given user.
|
||||
*
|
||||
* @since 14.0.0
|
||||
* @return string[] where the array key is the provider ID (string) and the
|
||||
* @return array<string, bool> where the array key is the provider ID (string) and the
|
||||
* value is the enabled state (bool)
|
||||
*/
|
||||
public function getProviderStates(IUser $user): array;
|
||||
|
|
|
|||
Loading…
Reference in a new issue