From b2345aa557a1f4e36c60ca41b8f15cbd2b126731 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Sat, 14 Jul 2012 15:36:30 +0200 Subject: [PATCH] Removed the equals method as it is not used anymore in 2.1 --- Model/User.php | 50 +++----------------------------------------------- 1 file changed, 3 insertions(+), 47 deletions(-) diff --git a/Model/User.php b/Model/User.php index 05d3026671..8fb0f3746e 100644 --- a/Model/User.php +++ b/Model/User.php @@ -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 @@ -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)) { @@ -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. * @@ -242,8 +205,6 @@ public function unserialize($serialized) /** * Removes sensitive data from the user. - * - * Implements SecurityUserInterface */ public function eraseCredentials() { @@ -279,8 +240,6 @@ public function getUsernameCanonical() } /** - * Implementation of SecurityUserInterface - * * @return string */ public function getSalt() @@ -311,7 +270,6 @@ public function getEmailCanonical() /** * Gets the encrypted password. * - * Implements SecurityUserInterface * @return string */ public function getPassword() @@ -352,8 +310,6 @@ public function getConfirmationToken() /** * Returns the user roles * - * Implements SecurityUserInterface - * * @return array The roles */ public function getRoles()