Skip to content

Instantly share code, notes, and snippets.

@coreymcmahon
Created May 19, 2012 06:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coreymcmahon/2729536 to your computer and use it in GitHub Desktop.
Save coreymcmahon/2729536 to your computer and use it in GitHub Desktop.
<?php
interface UserInterface
{
/**
* Returns an array of strings, where each string is a role that this user has.
*
* @return Role[] An array containing the roles this user has
*/
function getRoles();
/**
* Return the salted and hashed password for this user.
*
* @return string The password
*/
function getPassword();
/**
* Return the "salt" value used to save this user's password.
*
* @return bool|string The salt
*/
function getSalt();
/**
* Return the username of this user.
*
* @return string The username
*/
function getUsername();
/**
* Remove sensitive information from the user object.
*
* @return void
*/
function eraseCredentials();
/**
* Given another User object, return true if the provided $user is equivalent to this one.
*
* @param UserInterface $user
* @return Boolean
*/
function equals(UserInterface $user);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment