From d7ddf5cdcfecf374d585a7ca5f5a3b1c1d7e0d05 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Tue, 2 Jul 2024 11:48:32 -0700 Subject: [PATCH] chore(ldap): fix deprecation warnings about return types When using Ldap authentication, these deprecation warnings were being sent as part of the API response. This corrupted the expected JSON response. --- plugins/Authentication/Ldap/LDAP2/Search.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/Authentication/Ldap/LDAP2/Search.php b/plugins/Authentication/Ldap/LDAP2/Search.php index 9d7f81656..9cc2d0267 100644 --- a/plugins/Authentication/Ldap/LDAP2/Search.php +++ b/plugins/Authentication/Ldap/LDAP2/Search.php @@ -560,7 +560,7 @@ public function sizeLimitExceeded() * * @return Net_LDAP2_Entry|false */ - public function current() + public function current(): mixed { if (count($this->_iteratorCache) == 0) { $this->next(); @@ -576,7 +576,7 @@ public function current() * @see current() * @return string|false DN of the current entry; false in case no entry is returned by current() */ - public function key() + public function key(): mixed { $entry = $this->current(); return ($entry instanceof Net_LDAP2_Entry) ? $entry->dn() : false; @@ -591,7 +591,7 @@ public function key() * @see current() * @return void */ - public function next() + public function next(): void { // fetch next entry. // if we have no entrys anymore, we add false (which is @@ -614,7 +614,7 @@ public function next() * @see current() * @return boolean FALSE if there's nothing more to iterate over */ - public function valid() + public function valid(): bool { return ($this->current() instanceof Net_LDAP2_Entry); } @@ -627,7 +627,7 @@ public function valid() * @see current() * @return void */ - public function rewind() + public function rewind(): void { reset($this->_iteratorCache); }