From d6e49cd2de200875f255a466b8891bd92ad1b777 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Thu, 1 Sep 2022 15:09:00 +0200 Subject: [PATCH] Remove useless getReadArgs/setReadArgs methods from PagedResults MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/user_ldap/lib/LDAP.php | 3 +-- apps/user_ldap/lib/PagedResults/IAdapter.php | 13 ------------- apps/user_ldap/lib/PagedResults/Php73.php | 16 ---------------- 3 files changed, 1 insertion(+), 31 deletions(-) diff --git a/apps/user_ldap/lib/LDAP.php b/apps/user_ldap/lib/LDAP.php index 28664b2dda6..028674e40cc 100644 --- a/apps/user_ldap/lib/LDAP.php +++ b/apps/user_ldap/lib/LDAP.php @@ -180,8 +180,7 @@ class LDAP implements ILDAPWrapper { * {@inheritDoc} */ public function read($link, $baseDN, $filter, $attr) { - $this->pagedResultsAdapter->setReadArgs($link, $baseDN, $filter, $attr); - return $this->invokeLDAPMethod('read', ...$this->pagedResultsAdapter->getReadArgs($link)); + return $this->invokeLDAPMethod('read', $link, $baseDN, $filter, $attr, 0, -1); } /** diff --git a/apps/user_ldap/lib/PagedResults/IAdapter.php b/apps/user_ldap/lib/PagedResults/IAdapter.php index 504dd7eaa9d..1627dcc1b29 100644 --- a/apps/user_ldap/lib/PagedResults/IAdapter.php +++ b/apps/user_ldap/lib/PagedResults/IAdapter.php @@ -81,19 +81,6 @@ interface IAdapter { */ public function getSearchArgs($link): array; - /** - * The adapter receives the parameters that were passed to a read - * operation. Typically it wants to save the them for the call proper later - * on. - */ - public function setReadArgs($link, string $baseDN, string $filter, array $attr): void; - - /** - * The adapter shall report which arguments shall be passed to the - * ldap_read function. - */ - public function getReadArgs($link): array; - /** * Returns the current paged results cookie * diff --git a/apps/user_ldap/lib/PagedResults/Php73.php b/apps/user_ldap/lib/PagedResults/Php73.php index c9d12279937..bde2d9bcd83 100644 --- a/apps/user_ldap/lib/PagedResults/Php73.php +++ b/apps/user_ldap/lib/PagedResults/Php73.php @@ -123,22 +123,6 @@ class Php73 implements IAdapter { return $this->linkData[$linkId]['searchArgs']; } - public function setReadArgs($link, string $baseDN, string $filter, array $attr): void { - $linkId = $this->getLinkId($link); - if (!isset($this->linkData[$linkId])) { - $this->linkData[$linkId] = []; - } - - $this->linkData[$linkId]['readArgs'] = func_get_args(); - $this->linkData[$linkId]['readArgs'][] = 0; // $attrsonly default - $this->linkData[$linkId]['readArgs'][] = -1; // $sizelimit default - } - - public function getReadArgs($link): array { - $linkId = $this->getLinkId($link); - return $this->linkData[$linkId]['readArgs']; - } - protected function preparePagesResultsArgs(int $linkId, string $methodKey): void { if (!isset($this->linkData[$linkId]['requestArgs'])) { return; -- 2.39.5