aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/Connection.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-03-03 16:35:06 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-03-03 16:35:06 +0100
commitdab5ea958a58e79b7f40b49bbe3af8839dc9c9d1 (patch)
treeba32d3a96807f5f126ce7e2fcf82d1c0796ead43 /apps/user_ldap/lib/Connection.php
parent0c5bd588ed4528d46df244a686b6f91299766836 (diff)
downloadnextcloud-server-dab5ea958a58e79b7f40b49bbe3af8839dc9c9d1.tar.gz
nextcloud-server-dab5ea958a58e79b7f40b49bbe3af8839dc9c9d1.zip
Fix unit tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap/lib/Connection.php')
-rw-r--r--apps/user_ldap/lib/Connection.php38
1 files changed, 31 insertions, 7 deletions
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php
index fefa1f0e329..565fb415e58 100644
--- a/apps/user_ldap/lib/Connection.php
+++ b/apps/user_ldap/lib/Connection.php
@@ -78,10 +78,25 @@ class Connection extends LDAPUtility {
* @var resource|\LDAP\Connection|null
*/
private $ldapConnectionRes = null;
+
+ /**
+ * @var string
+ */
private $configPrefix;
+
+ /**
+ * @var ?string
+ */
private $configID;
+
+ /**
+ * @var bool
+ */
private $configured = false;
- //whether connection should be kept on __destruct
+
+ /**
+ * @var bool whether connection should be kept on __destruct
+ */
private $dontDestruct = false;
/**
@@ -94,16 +109,27 @@ class Connection extends LDAPUtility {
*/
public $hasGidNumber = true;
- //cache handler
- protected $cache;
+ /**
+ * @var \OCP\ICache|null
+ */
+ protected $cache = null;
/** @var Configuration settings handler **/
protected $configuration;
+ /**
+ * @var bool
+ */
protected $doNotValidate = false;
+ /**
+ * @var bool
+ */
protected $ignoreValidation = false;
+ /**
+ * @var array{dn?: mixed, hash?: string, result?: bool}
+ */
protected $bindResult = [];
/** @var LoggerInterface */
@@ -111,16 +137,14 @@ class Connection extends LDAPUtility {
/**
* Constructor
- * @param ILDAPWrapper $ldap
* @param string $configPrefix a string with the prefix for the configkey column (appconfig table)
* @param string|null $configID a string with the value for the appid column (appconfig table) or null for on-the-fly connections
*/
- public function __construct(ILDAPWrapper $ldap, $configPrefix = '', $configID = 'user_ldap') {
+ public function __construct(ILDAPWrapper $ldap, string $configPrefix = '', ?string $configID = 'user_ldap') {
parent::__construct($ldap);
$this->configPrefix = $configPrefix;
$this->configID = $configID;
- $this->configuration = new Configuration($configPrefix,
- !is_null($configID));
+ $this->configuration = new Configuration($configPrefix, !is_null($configID));
$memcache = \OC::$server->getMemCacheFactory();
if ($memcache->isAvailable()) {
$this->cache = $memcache->createDistributed();