mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
refactor: improve reflection attribute typing
This allows tools to see the correct usage of PasswordConfirmationRequired::getStrict Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
1ef465f804
commit
8a581c230b
1 changed files with 2 additions and 0 deletions
|
|
@ -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<PasswordConfirmationRequired>[] $attributes */
|
||||
$attributes = $reflectionMethod->getAttributes(PasswordConfirmationRequired::class);
|
||||
return !empty($attributes) && ($attributes[0]->newInstance()->getStrict());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue