diff --git a/src/UnicaenLdap/Service/AbstractService.php b/src/UnicaenLdap/Service/AbstractService.php index a604b5f886bdad313b8e5b75ea4e1be755e75bed..cf34c1018d033508dbbab2dae2e36dc05bace5f2 100644 --- a/src/UnicaenLdap/Service/AbstractService.php +++ b/src/UnicaenLdap/Service/AbstractService.php @@ -326,20 +326,19 @@ abstract class AbstractService implements /** * Retourne un tableau d'attributs * - * @param resource $resource + * @param resource|\Ldap\Connection $resource * @param resource $entry * @return null|array + * @desc depuis php 8.1 $resource est de type Ldap\Connection */ private function __getEntryAttributes($resource, $entry) { - if (!is_resource($resource)) { + if (!is_resource($resource) && !($resource instanceof \Ldap\Connection)) { return null; } - $berIdentifier = null; - $name = ldap_first_attribute( - $resource, $entry, $berIdentifier + $resource, $entry ); $attributes = array(); @@ -361,8 +360,7 @@ abstract class AbstractService implements $attributes[$attrName] = $data; $name = ldap_next_attribute( - $resource, $entry, - $berIdentifier + $resource, $entry ); } ksort($attributes, SORT_LOCALE_STRING);