Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-02-07 12:06:19 +0300
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-03-10 16:40:24 +0300
commit07458e62bd4f6d5e4057a19549e1ea3e77a4d4b8 (patch)
treed92e45c3717f422f7adbd0b63a4c9596b12890b8
parentbc6c11d79a722308ea0573ca3c23ecb5066a050b (diff)
Improve typing in apps/user_ldap/lib/Command/CheckUser.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r--apps/user_ldap/lib/Command/CheckUser.php16
1 files changed, 4 insertions, 12 deletions
diff --git a/apps/user_ldap/lib/Command/CheckUser.php b/apps/user_ldap/lib/Command/CheckUser.php
index c35557f67ed..7476afb1bfe 100644
--- a/apps/user_ldap/lib/Command/CheckUser.php
+++ b/apps/user_ldap/lib/Command/CheckUser.php
@@ -4,6 +4,7 @@
*
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
+ * @author Côme Chilliet <come.chilliet@nextcloud.com>
* @author Joas Schilling <coding@schilljs.com>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Roeland Jago Douma <roeland@famdouma.nl>
@@ -48,12 +49,6 @@ class CheckUser extends Command {
/** @var UserMapping */
protected $mapping;
- /**
- * @param User_Proxy $uBackend
- * @param Helper $helper
- * @param DeletedUsersIndex $dui
- * @param UserMapping $mapping
- */
public function __construct(User_Proxy $uBackend, Helper $helper, DeletedUsersIndex $dui, UserMapping $mapping) {
$this->backend = $uBackend;
$this->helper = $helper;
@@ -62,7 +57,7 @@ class CheckUser extends Command {
parent::__construct();
}
- protected function configure() {
+ protected function configure(): void {
$this
->setName('ldap:check-user')
->setDescription('checks whether a user exists on LDAP.')
@@ -89,7 +84,7 @@ class CheckUser extends Command {
protected function execute(InputInterface $input, OutputInterface $output): int {
try {
$uid = $input->getArgument('ocName');
- $this->isAllowed($input->getOption('force'));
+ $this->assertAllowed($input->getOption('force'));
$wasMapped = $this->userWasMapped($uid);
$exists = $this->backend->userExistsOnLDAP($uid, true);
if ($exists === true) {
@@ -125,9 +120,8 @@ class CheckUser extends Command {
/**
* checks whether the setup allows reliable checking of LDAP user existence
* @throws \Exception
- * @return true
*/
- protected function isAllowed($force) {
+ protected function assertAllowed(bool $force): void {
if ($this->helper->haveDisabledConfigurations() && !$force) {
throw new \Exception('Cannot check user existence, because '
. 'disabled LDAP configurations are present.');
@@ -136,8 +130,6 @@ class CheckUser extends Command {
// we don't check ldapUserCleanupInterval from config.php because this
// action is triggered manually, while the setting only controls the
// background job.
-
- return true;
}
private function updateUser(string $uid, OutputInterface $output): void {