Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a74ac3

Browse files
cannifabpot
authored andcommitted
Add info about BC Break to CHANGELOG-2.1 and UPGRADE-2.1
1 parent 741859d commit 2a74ac3

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

UPGRADE-2.1.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,31 @@ UPGRADE FROM 2.0 to 2.1
4040

4141
Before: $session->getLocale()
4242
After: $request->getLocale()
43+
44+
* Method `equals` of `Symfony\Component\Security\Core\User\UserInterface` has
45+
moved to `Symfony\Component\Security\Core\User\EquatableInterface`.
46+
47+
You have to change the name of the `equals` function in your implementation
48+
of the `User` class to `isEqualTo` and implement `EquatableInterface`.
49+
Apart from that, no other changes are required to make it behave as before.
50+
Alternatively, you can use the default implementation provided
51+
by `AbstractToken:hasUserChanged` if you do not need any custom comparison logic.
52+
In this case do not implement the interface and remove your comparison function.
53+
54+
Before:
55+
56+
class User implements UserInterface
57+
{
58+
// ...
59+
public function equals(UserInterface $user) { /* ... */ }
60+
// ...
61+
}
62+
63+
After:
64+
65+
class User implements UserInterface, EquatableInterface
66+
{
67+
// ...
68+
public function isEqualTo(UserInterface $user) { /* ... */ }
69+
// ...
70+
}

0 commit comments

Comments
 (0)