From 66fdc61b6c992943397f2f64133db458046b62f7 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 29 Mar 2022 14:54:48 +0200 Subject: [PATCH] Fix some issues with the ldap data extractor Signed-off-by: Carl Schwan --- apps/user_ldap/lib/DataCollector/LdapDataCollector.php | 2 +- apps/user_ldap/lib/LDAP.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/user_ldap/lib/DataCollector/LdapDataCollector.php b/apps/user_ldap/lib/DataCollector/LdapDataCollector.php index d8ed416a6866c..b4ed78774bd83 100644 --- a/apps/user_ldap/lib/DataCollector/LdapDataCollector.php +++ b/apps/user_ldap/lib/DataCollector/LdapDataCollector.php @@ -33,7 +33,7 @@ public function startLdapRequest(string $query, array $args): void { 'start' => microtime(true), 'query' => $query, 'args' => $args, - 'end' => -1 + 'end' => microtime(true), ]; } diff --git a/apps/user_ldap/lib/LDAP.php b/apps/user_ldap/lib/LDAP.php index a2b2bbfba3066..5dc5b46892cd8 100644 --- a/apps/user_ldap/lib/LDAP.php +++ b/apps/user_ldap/lib/LDAP.php @@ -320,7 +320,7 @@ private function preFunctionCall(string $functionName, array $args): void { $this->curArgs = $args; if ($this->dataCollector !== null) { - $args = array_reduce($this->curArgs, static function (array $carry, $item): array { + $args = array_reduce($this->curArgs, function (array $carry, $item): array { $carry[] = !$this->isResource($item) ? $item : '(resource)'; return $carry; }, []); @@ -329,7 +329,7 @@ private function preFunctionCall(string $functionName, array $args): void { } if ($this->logFile !== '' && is_writable(dirname($this->logFile)) && (!file_exists($this->logFile) || is_writable($this->logFile))) { - $args = array_reduce($this->curArgs, static function (array $carry, $item): array { + $args = array_reduce($this->curArgs, function (array $carry, $item): array { $carry[] = !$this->isResource($item) ? $item : '(resource)'; return $carry; }, []);