Skip to content

Commit

Permalink
Removed the equals method as it is not used anymore in 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Jul 14, 2012
1 parent dd32163 commit b2345aa
Showing 1 changed file with 3 additions and 47 deletions.
50 changes: 3 additions & 47 deletions Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Security\Core\User\UserInterface as SecurityUserInterface;

/**
* Storage agnostic user object
Expand Down Expand Up @@ -140,12 +139,14 @@ public function __construct()
* Adds a role to the user.
*
* @param string $role
*
* @return User
*/
public function addRole($role)
{
$role = strtoupper($role);
if ($role === static::ROLE_DEFAULT) {
return;
return $this;
}

if (!in_array($role, $this->roles, true)) {
Expand All @@ -155,44 +156,6 @@ public function addRole($role)
return $this;
}

/**
* Implementation of SecurityUserInterface.
*
* @param \Symfony\Component\Security\Core\User\UserInterface $user
*
* @return Boolean
*/
public function equals(SecurityUserInterface $user)
{
if (!$user instanceof User) {
return false;
}

if ($this->getPassword() !== $user->getPassword()) {
return false;
}
if ($this->getSalt() !== $user->getSalt()) {
return false;
}
if ($this->getUsernameCanonical() !== $user->getUsernameCanonical()) {
return false;
}
if ($this->isAccountNonExpired() !== $user->isAccountNonExpired()) {
return false;
}
if ($this->isAccountNonLocked() !== $user->isAccountNonLocked()) {
return false;
}
if ($this->isCredentialsNonExpired() !== $user->isCredentialsNonExpired()) {
return false;
}
if ($this->isEnabled() !== $user->isEnabled()) {
return false;
}

return true;
}

/**
* Serializes the user.
*
Expand Down Expand Up @@ -242,8 +205,6 @@ public function unserialize($serialized)

/**
* Removes sensitive data from the user.
*
* Implements SecurityUserInterface
*/
public function eraseCredentials()
{
Expand Down Expand Up @@ -279,8 +240,6 @@ public function getUsernameCanonical()
}

/**
* Implementation of SecurityUserInterface
*
* @return string
*/
public function getSalt()
Expand Down Expand Up @@ -311,7 +270,6 @@ public function getEmailCanonical()
/**
* Gets the encrypted password.
*
* Implements SecurityUserInterface
* @return string
*/
public function getPassword()
Expand Down Expand Up @@ -352,8 +310,6 @@ public function getConfirmationToken()
/**
* Returns the user roles
*
* Implements SecurityUserInterface
*
* @return array The roles
*/
public function getRoles()
Expand Down

0 comments on commit b2345aa

Please sign in to comment.