EquatableInterface.php 883 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Security\Core\User;
  11. /**
  12. * EquatableInterface used to test if two objects are equal in security
  13. * and re-authentication context.
  14. *
  15. * @author Dariusz Górecki <darek.krk@gmail.com>
  16. */
  17. interface EquatableInterface
  18. {
  19. /**
  20. * The equality comparison should neither be done by referential equality
  21. * nor by comparing identities (i.e. getId() === getId()).
  22. *
  23. * However, you do not need to compare every attribute, but only those that
  24. * are relevant for assessing whether re-authentication is required.
  25. *
  26. * @return bool
  27. */
  28. public function isEqualTo(UserInterface $user);
  29. }