Skip to content

Instantly share code, notes, and snippets.

@koriym
Last active June 15, 2018 13:53
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 koriym/081a393b51162ffb65ca3fa85aa51431 to your computer and use it in GitHub Desktop.
Save koriym/081a393b51162ffb65ca3fa85aa51431 to your computer and use it in GitHub Desktop.
<?php
class AuthException extends \RuntimeException
{
}
final class UserToken
{
public $jwtToken;
// 他に必要なプロパティ
}
final class UserProfile
{
public $uid;
public $name;
// 他に必要なプロパティ
}
interface createUserTokenInterface
{
/**
* トークン生成
*
* @throws AuthException
*/
public function createUserToken(string $user, string $pass) : UserToken;
}
interface ProfileInterface
{
/**
* プロフィールを取得
*
* @throws AuthException
*/
public function getProfile(UserToken $token) : UserProfile;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment