protected function validateAttributesToLdap(array $attributes)
    {
        if (!$this->schema) {
            return;
        }
        $missing = [];

        foreach ($this->schema->getRequiredAttributes() as $attribute) {
            if (!array_key_exists(strtolower($attribute), array_change_key_case($attributes))) {
                $missing[] = $attribute;
            }
        }

        if (!empty($missing)) {
            throw new LogicException(
                sprintf('The following required attributes are missing: %s', implode(', ', $missing))
            );
        }
    }