aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/PagedResults/TLinkId.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2021-10-26 16:43:39 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2021-12-16 09:43:30 +0100
commitf3dcbfe146782d2c7dec8760651e79605ddc96e7 (patch)
treea22984b0976ae1b7ac4ba3082217bc5dd8b34f61 /apps/user_ldap/lib/PagedResults/TLinkId.php
parent37f8f7a5a18e57507330036b747d4b12e58efae4 (diff)
downloadnextcloud-server-f3dcbfe146782d2c7dec8760651e79605ddc96e7.tar.gz
nextcloud-server-f3dcbfe146782d2c7dec8760651e79605ddc96e7.zip
Fix PHP 8.1 support for user_ldap application
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap/lib/PagedResults/TLinkId.php')
-rw-r--r--apps/user_ldap/lib/PagedResults/TLinkId.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/user_ldap/lib/PagedResults/TLinkId.php b/apps/user_ldap/lib/PagedResults/TLinkId.php
index 6f320705e67..02c36da97f9 100644
--- a/apps/user_ldap/lib/PagedResults/TLinkId.php
+++ b/apps/user_ldap/lib/PagedResults/TLinkId.php
@@ -28,10 +28,16 @@ namespace OCA\User_LDAP\PagedResults;
trait TLinkId {
public function getLinkId($link) {
- if (is_resource($link)) {
+ if (is_object($link)) {
+ return spl_object_id($link);
+ } elseif (is_resource($link)) {
return (int)$link;
- } elseif (is_array($link) && isset($link[0]) && is_resource($link[0])) {
- return (int)$link[0];
+ } elseif (is_array($link) && isset($link[0])) {
+ if (is_object($link[0])) {
+ return spl_object_id($link[0]);
+ } elseif (is_resource($link[0])) {
+ return (int)$link[0];
+ }
}
throw new \RuntimeException('No resource provided');
}