LdapTools\Hydrator\OperationHydrator::filterAttributeValues PHP Method

filterAttributeValues() protected method

Remove empty strings and null values from attribute value arrays. This prevents errors when saving to LDAP and these are present for some reason.
protected filterAttributeValues ( array $attributes ) : array
$attributes array
return array
    protected function filterAttributeValues(array $attributes)
    {
        return array_filter($attributes, function ($value) {
            if (is_array($value) && empty($value)) {
                return false;
            }
            return !($value === '' || $value === null);
        });
    }