Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request zendframework/zendframework#5901 from danizord/fea…
Browse files Browse the repository at this point in the history
…ture/authentication-service-interface

Add AuthenticationServiceInterface
  • Loading branch information
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/AuthenticationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Zend\Authentication;

class AuthenticationService
class AuthenticationService implements AuthenticationServiceInterface
{
/**
* Persistent storage handler
Expand Down
44 changes: 44 additions & 0 deletions src/AuthenticationServiceInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Authentication;

/**
* Provides an API for authentication and identity management
*/
interface AuthenticationServiceInterface
{
/**
* Authenticates and provides an authentication result
*
* @return Result
*/
public function authenticate();

/**
* Returns true if and only if an identity is available
*
* @return bool
*/
public function hasIdentity();

/**
* Returns the authenticated identity or null if no identity is available
*
* @return mixed|null
*/
public function getIdentity();

/**
* Clears the identity
*
* @return void
*/
public function clearIdentity();
}

0 comments on commit 32f3538

Please sign in to comment.