/** * Checks to make sure all required attributes are present. * * @param array $attributes */ protected function validateAttributesToLdap(array $attributes) { if (!$this->schema) { return; } $missing = []; foreach ($this->schema->getRequiredAttributes() as $attribute) { if (!array_key_exists(MBString::strtolower($attribute), MBString::array_change_key_case($attributes))) { $missing[] = $attribute; } } if (!empty($missing)) { throw new LogicException(sprintf('The following required attributes are missing: %s', implode(', ', $missing))); } }