Created
March 18, 2016 10:17
-
-
Save kamaulynder/f538f653b03cf15a9d7a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace RollCall\Services; | |
use RollCall\Contracts\Repositories\UsersRepository; | |
class PasswordGrantVerifier | |
{ | |
/** | |
* @var UsersRepository | |
*/ | |
protected $users; | |
/** | |
* @param UsersRepository $users | |
*/ | |
public function __construct(UsersRepository $users) | |
{ | |
$this->users = $users; | |
} | |
/** | |
* @param $email | |
* @param $id | |
* | |
* @return bool|mixed | |
*/ | |
public function verify($email, $id) | |
{ | |
if ($user = $this->users->find($id)) { | |
return $user->id; | |
} | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment