From 8a581c230bd2cb3b81291e92b9d99ef4b91c3aac Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 2 Dec 2025 09:55:41 +0100 Subject: [PATCH] refactor: improve reflection attribute typing This allows tools to see the correct usage of PasswordConfirmationRequired::getStrict Signed-off-by: Christoph Wurst --- .../Middleware/Security/PasswordConfirmationMiddleware.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php b/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php index 0facbffe504..ce997d17016 100644 --- a/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php @@ -24,6 +24,7 @@ use OCP\IUserSession; use OCP\Session\Exceptions\SessionNotAvailableException; use OCP\User\Backend\IPasswordConfirmationBackend; use Psr\Log\LoggerInterface; +use ReflectionAttribute; use ReflectionMethod; class PasswordConfirmationMiddleware extends Middleware { @@ -115,6 +116,7 @@ class PasswordConfirmationMiddleware extends Middleware { } private function isPasswordConfirmationStrict(ReflectionMethod $reflectionMethod): bool { + /** @var ReflectionAttribute[] $attributes */ $attributes = $reflectionMethod->getAttributes(PasswordConfirmationRequired::class); return !empty($attributes) && ($attributes[0]->newInstance()->getStrict()); }