Skip to content

Commit

Permalink
Remove BC break for Symfony < 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
stloyd committed May 4, 2015
1 parent 9a5e381 commit 053a446
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Form/FOSUBRegistrationFormHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,10 @@ protected function setUserInformation(UserInterface $user, UserResponseInterface
$accessor = PropertyAccess::createPropertyAccessor();
$accessor->setValue($user, 'username', $this->getUniqueUserName($userInformation->getNickname()));

if ($accessor->isWritable($user, 'email')) {
if (method_exists($accessor, 'isWritable') && $accessor->isWritable($user, 'email')) {
$accessor->setValue($user, 'email', $userInformation->getEmail());
} elseif (method_exists($user, 'setEmail')) {
$user->setEmail($userInformation->getEmail());
}

return $user;
Expand Down

0 comments on commit 053a446

Please sign in to comment.