diff --git a/src/UnicaenLdap/Service/AbstractService.php b/src/UnicaenLdap/Service/AbstractService.php index 55eb49d88bbbdef2fe92c2041cb0a55ba54df652..d46c820027248da7cd251669d0100a8b9a48bb0a 100644 --- a/src/UnicaenLdap/Service/AbstractService.php +++ b/src/UnicaenLdap/Service/AbstractService.php @@ -323,21 +323,20 @@ 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)) { - return null; - } - $berIdentifier = null; + if (!is_resource($resource) && !$resource instanceof \Ldap\Connection) { + return null; + } $name = ldap_first_attribute( - $resource, $entry//, $berIdentifier + $resource, $entry ); $attributes = array(); @@ -359,7 +358,7 @@ abstract class AbstractService implements $attributes[$attrName] = $data; $name = ldap_next_attribute( - $resource, $entry//, $berIdentifier + $resource, $entry ); } ksort($attributes, SORT_LOCALE_STRING);