Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions lib/Db/UserMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,29 @@
public function find(string $search, $limit = null, $offset = null): array {
$qb = $this->db->getQueryBuilder();

$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
$stack = [];

foreach ($backtrace as $index => $trace) {
$class = $trace['class'] ?? '';
$type = $trace['type'] ?? '';
$function = $trace['function'] ?? '';
$file = $trace['file'] ?? 'unknown file';
$line = $trace['line'] ?? 'unknown line';

$stack[] = sprintf(
"#%d %s%s%s() called at [%s:%s]",
$index,
$class,
$type,
$function,
$file,
$line
);
}

$this->logger->debug("Find user by string: " . $search . " -- Call Stack:\n" . implode("\n", $stack));

Check failure on line 83 in lib/Db/UserMapper.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

UndefinedThisPropertyFetch

lib/Db/UserMapper.php:83:3: UndefinedThisPropertyFetch: Instance property OCA\UserOIDC\Db\UserMapper::$logger is not defined (see https://psalm.dev/041)

$oidcSystemConfig = $this->config->getSystemValue('user_oidc', []);
$matchEmails = !isset($oidcSystemConfig['user_search_match_emails']) || $oidcSystemConfig['user_search_match_emails'] === true;
if ($matchEmails) {
Expand Down Expand Up @@ -91,6 +114,29 @@
public function findDisplayNames(string $search, $limit = null, $offset = null): array {
$qb = $this->db->getQueryBuilder();

$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
$stack = [];

foreach ($backtrace as $index => $trace) {
$class = $trace['class'] ?? '';
$type = $trace['type'] ?? '';
$function = $trace['function'] ?? '';
$file = $trace['file'] ?? 'unknown file';
$line = $trace['line'] ?? 'unknown line';

$stack[] = sprintf(
"#%d %s%s%s() called at [%s:%s]",
$index,
$class,
$type,
$function,
$file,
$line
);
}

$this->logger->debug("Find user display names by string: " . $search . " -- Call Stack:\n" . implode("\n", $stack));

Check failure on line 138 in lib/Db/UserMapper.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

UndefinedThisPropertyFetch

lib/Db/UserMapper.php:138:3: UndefinedThisPropertyFetch: Instance property OCA\UserOIDC\Db\UserMapper::$logger is not defined (see https://psalm.dev/041)

$oidcSystemConfig = $this->config->getSystemValue('user_oidc', []);
$matchEmails = !isset($oidcSystemConfig['user_search_match_emails']) || $oidcSystemConfig['user_search_match_emails'] === true;
if ($matchEmails) {
Expand Down
Loading