Skip to content

Commit a353db2

Browse files
authored
Merge pull request #30997 from nextcloud/fix/noid/ldap-occ-test-config-accessor
fix overwriting of SUCCESS and INVALID consts
2 parents cd7a217 + 2bf57cb commit a353db2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

apps/user_ldap/lib/Command/TestConfig.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
use Symfony\Component\Console\Output\OutputInterface;
3636

3737
class TestConfig extends Command {
38-
protected const SUCCESS = 0;
39-
protected const INVALID = 1;
38+
protected const ESTABLISHED = 0;
39+
protected const CONF_INVALID = 1;
4040
protected const BINDFAILURE = 2;
4141
protected const SEARCHFAILURE = 3;
4242

@@ -71,10 +71,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7171

7272
$result = $this->testConfig($configID);
7373
switch ($result) {
74-
case static::SUCCESS:
74+
case static::ESTABLISHED:
7575
$output->writeln('The configuration is valid and the connection could be established!');
7676
return 0;
77-
case static::INVALID:
77+
case static::CONF_INVALID:
7878
$output->writeln('The configuration is invalid. Please have a look at the logs for further details.');
7979
break;
8080
case static::BINDFAILURE:
@@ -103,7 +103,7 @@ protected function testConfig(string $configID): int {
103103
if (!$connection->setConfiguration([
104104
'ldap_configuration_active' => 1,
105105
])) {
106-
return static::INVALID;
106+
return static::CONF_INVALID;
107107
}
108108
if (!$connection->bind()) {
109109
return static::BINDFAILURE;
@@ -113,6 +113,6 @@ protected function testConfig(string $configID): int {
113113
if (!is_int($result) || ($result <= 0)) {
114114
return static::SEARCHFAILURE;
115115
}
116-
return static::SUCCESS;
116+
return static::ESTABLISHED;
117117
}
118118
}

0 commit comments

Comments
 (0)