- //Extract names and pseudonym from mail
- $names = explode(' ', $pseudonym = ucwords(trim(preg_replace('/[^a-zA-Z]+/', ' ', current(explode('@', $data->getMail()))))));
-
- //Set pseudonym
- $user->setPseudonym($user->getPseudonym()??$pseudonym);
-
- //Set forename
- $user->setForename($user->getForename()??$names[0]);
-
- //Set surname
- $user->setSurname($user->getSurname()??$names[1]??$names[0]);
-