diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-02-08 14:21:16 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-02-08 14:21:16 +0100 |
commit | 2a0b2250d2038c4646de9098a890fa3f45a8c7dd (patch) | |
tree | 913f8ab69bd51629788fe1dc336e9ed1a440b549 /apps/user_ldap/lib/Helper.php | |
parent | c7978f48b50922a245a573141e2891f69b3de840 (diff) | |
download | nextcloud-server-2a0b2250d2038c4646de9098a890fa3f45a8c7dd.tar.gz nextcloud-server-2a0b2250d2038c4646de9098a890fa3f45a8c7dd.zip |
Improve typing in OCA\User_LDAP\Access and reduce psalm errors
This should avoid some PHP warning using PHP 8.1
and help detecting type trouble early in the future.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap/lib/Helper.php')
-rw-r--r-- | apps/user_ldap/lib/Helper.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/user_ldap/lib/Helper.php b/apps/user_ldap/lib/Helper.php index 650755842b6..045f67e4a7f 100644 --- a/apps/user_ldap/lib/Helper.php +++ b/apps/user_ldap/lib/Helper.php @@ -129,10 +129,10 @@ class Helper { sort($serverConnections); $lastKey = array_pop($serverConnections); $lastNumber = (int)str_replace('s', '', $lastKey); - return 's' . str_pad($lastNumber + 1, 2, '0', STR_PAD_LEFT); + return 's' . str_pad((string)($lastNumber + 1), 2, '0', STR_PAD_LEFT); } - private function getServersConfig($value) { + private function getServersConfig(string $value): array { $regex = '/' . $value . '$/S'; $keys = $this->config->getAppKeys('user_ldap'); @@ -211,7 +211,7 @@ class Helper { /** * sanitizes a DN received from the LDAP server * - * @param array $dn the DN in question + * @param array|string $dn the DN in question * @return array|string the sanitized DN */ public function sanitizeDN($dn) { |