Skip to content

Commit

Permalink
Add info about BC Break to CHANGELOG-2.1 and UPGRADE-2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
canni authored and fabpot committed Jan 13, 2012
1 parent 741859d commit 2a74ac3
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions UPGRADE-2.1.md
Expand Up @@ -40,3 +40,31 @@ UPGRADE FROM 2.0 to 2.1

Before: $session->getLocale()
After: $request->getLocale()

* Method `equals` of `Symfony\Component\Security\Core\User\UserInterface` has
moved to `Symfony\Component\Security\Core\User\EquatableInterface`.

You have to change the name of the `equals` function in your implementation
of the `User` class to `isEqualTo` and implement `EquatableInterface`.
Apart from that, no other changes are required to make it behave as before.
Alternatively, you can use the default implementation provided
by `AbstractToken:hasUserChanged` if you do not need any custom comparison logic.
In this case do not implement the interface and remove your comparison function.

Before:

class User implements UserInterface
{
// ...
public function equals(UserInterface $user) { /* ... */ }
// ...
}

After:

class User implements UserInterface, EquatableInterface
{
// ...
public function isEqualTo(UserInterface $user) { /* ... */ }
// ...
}

0 comments on commit 2a74ac3

Please sign in to comment.