From 85cea1960b1c15874a03d6dbc7408ca2dedf40ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Mon, 29 Apr 2024 17:11:25 +0200 Subject: [PATCH] fix: Avoid useless reference usage in user_ldap MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/user_ldap/lib/Group_Proxy.php | 2 +- apps/user_ldap/lib/LDAP.php | 1 + apps/user_ldap/lib/User_Proxy.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/user_ldap/lib/Group_Proxy.php b/apps/user_ldap/lib/Group_Proxy.php index 1544d5f91e9..718e915372f 100644 --- a/apps/user_ldap/lib/Group_Proxy.php +++ b/apps/user_ldap/lib/Group_Proxy.php @@ -73,7 +73,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet $this->backends[$configPrefix] = new Group_LDAP($this->getAccess($configPrefix), $this->groupPluginManager, $this->config, $this->ncUserManager); if (is_null($this->refBackend)) { - $this->refBackend = &$this->backends[$configPrefix]; + $this->refBackend = $this->backends[$configPrefix]; } } diff --git a/apps/user_ldap/lib/LDAP.php b/apps/user_ldap/lib/LDAP.php index 01f4e16ab10..9322b6fbdaa 100644 --- a/apps/user_ldap/lib/LDAP.php +++ b/apps/user_ldap/lib/LDAP.php @@ -204,6 +204,7 @@ class LDAP implements ILDAPWrapper { $serverControls = []; } + /** @psalm-suppress UndefinedVariable $oldHandler is defined when the closure is called but psalm fails to get that */ $oldHandler = set_error_handler(function ($no, $message, $file, $line) use (&$oldHandler) { if (str_contains($message, 'Partial search results returned: Sizelimit exceeded')) { return true; diff --git a/apps/user_ldap/lib/User_Proxy.php b/apps/user_ldap/lib/User_Proxy.php index 96415491e41..3df1990359a 100644 --- a/apps/user_ldap/lib/User_Proxy.php +++ b/apps/user_ldap/lib/User_Proxy.php @@ -97,7 +97,7 @@ class User_Proxy extends Proxy implements IUserBackend, UserInterface, IUserLDAP ); if (is_null($this->refBackend)) { - $this->refBackend = &$this->backends[$configPrefix]; + $this->refBackend = $this->backends[$configPrefix]; } } -- 2.39.5