Skip to content
Snippets Groups Projects
Commit 9bfe26ed authored by Tobias Gross-Vogt's avatar Tobias Gross-Vogt
Browse files

added assertion; non-null return type for method never returning null

parent 7572894a
No related branches found
No related tags found
No related merge requests found
Pipeline #171105 passed
......@@ -238,7 +238,7 @@ class LDAPApi implements LoggerAwareInterface, ServiceSubscriberInterface
return $persons;
}
private function getPersonUserItem(string $identifier): ?User
private function getPersonUserItem(string $identifier): User
{
$preEvent = new PersonUserItemPreEvent($identifier);
$this->dispatcher->dispatch($preEvent, PersonUserItemPreEvent::NAME);
......@@ -258,6 +258,8 @@ class LDAPApi implements LoggerAwareInterface, ServiceSubscriberInterface
throw new NotFoundHttpException(sprintf("Person with id '%s' could not be found!", $identifier));
}
assert($identifier === $user->getFirstAttribute($this->identifierAttributeName));
/* @var User $user */
return $user;
} catch (\Adldap\Auth\BindException $e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment