File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -40,3 +40,31 @@ UPGRADE FROM 2.0 to 2.1
40
40
41
41
Before: $session->getLocale()
42
42
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
+ }
You can’t perform that action at this time.
0 commit comments