code cleanup for phpstan level 4 (#1522)

This commit is contained in:
Kevin Papst
2020-03-05 02:15:16 +01:00
committed by GitHub
parent 25a74ffeee
commit 20b3c31cbd
19 changed files with 40 additions and 64 deletions

View File

@@ -63,11 +63,14 @@ class LdapUserHydrator
$this->hydrateUserWithAttributesMap($user, $ldapEntry, $attributeMap);
if (is_array($user->getEmail())) {
$user->setEmail($user->getEmail()[0]);
/** @var string|array|null $email */
$email = $user->getEmail();
if (is_array($email)) {
$user->setEmail($email[0]);
}
if (null === $user->getEmail()) {
if (null === $email) {
$user->setEmail($user->getUsername());
}