From 36482b2a62fdc274c1f171b975cf05fb08670504 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 3 Nov 2025 08:28:15 +0100 Subject: [PATCH] Net_LDAP2_Search: add the compatible return types This avoids deprecation warnings with PHP 8.2. Tested on NetBSD/amd64, with PHP 8.2.29. --- Net/LDAP2/Search.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Net/LDAP2/Search.php b/Net/LDAP2/Search.php index 794307c..83d65ed 100644 --- a/Net/LDAP2/Search.php +++ b/Net/LDAP2/Search.php @@ -562,7 +562,7 @@ public function sizeLimitExceeded() * * @return Net_LDAP2_Entry|false */ - public function current() + public function current(): mixed { if (count($this->_iteratorCache) == 0) { $this->next(); @@ -578,7 +578,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; @@ -593,7 +593,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 @@ -616,7 +616,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); } @@ -629,7 +629,7 @@ public function valid() * @see current() * @return void */ - public function rewind() + public function rewind(): void { reset($this->_iteratorCache); }