summaryrefslogtreecommitdiffstats
path: root/Core/User/ComparableInterface.php
diff options
context:
space:
mode:
Diffstat (limited to 'Core/User/ComparableInterface.php')
-rw-r--r--Core/User/ComparableInterface.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/Core/User/ComparableInterface.php b/Core/User/ComparableInterface.php
new file mode 100644
index 0000000..2d1fe8f
--- /dev/null
+++ b/Core/User/ComparableInterface.php
@@ -0,0 +1,32 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Security\Core\User;
+
+/**
+ * ComparatorInterface used to test if two object are equal in security
+ * and re-authentication context.
+ *
+ * @author Dariusz Górecki <darek.krk@gmail.com>
+ */
+interface ComparableInterface
+{
+ /**
+ * The equality comparison should neither be done by referential equality
+ * nor by comparing identities (i.e. getId() === getId()).
+ *
+ * However, you do not need to compare every attribute, but only those that
+ * are relevant for assessing whether re-authentication is required.
+ *
+ * @return boolean
+ */
+ public function compareTo($object);
+}