Skip to content

Commit

Permalink
refactor(auth): use @ method to implement proxy ide helper
Browse files Browse the repository at this point in the history
  • Loading branch information
doyouhaobaby committed Aug 5, 2020
1 parent 8933929 commit 1cfb217
Showing 1 changed file with 6 additions and 49 deletions.
55 changes: 6 additions & 49 deletions src/Leevel/Auth/Proxy/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
/**
* 代理 auth.
*
* @codeCoverageIgnore
* @method static bool isLogin() 用户是否已经登录.
* @method static array getLogin() 获取登录信息.
* @method static void login(array $data, ?int $loginTime = null) 登录写入数据.
* @method static void logout() 登出.
* @method static void setTokenName(string $tokenName) 设置认证名字.
* @method static string getTokenName() 取得认证名字.
*/
class Auth
{
Expand All @@ -40,54 +45,6 @@ public static function __callStatic(string $method, array $args)
return self::proxy()->{$method}(...$args);
}

/**
* 用户是否已经登录.
*/
public static function isLogin(): bool
{
return self::proxy()->isLogin();
}

/**
* 获取登录信息.
*/
public static function getLogin(): array
{
return self::proxy()->getLogin();
}

/**
* 登录写入数据.
*/
public static function login(array $data, ?int $loginTime = null): void
{
self::proxy()->login($data, $loginTime);
}

/**
* 登出.
*/
public static function logout(): void
{
self::proxy()->logout();
}

/**
* 设置认证名字.
*/
public static function setTokenName(string $tokenName): void
{
self::proxy()->setTokenName($tokenName);
}

/**
* 取得认证名字.
*/
public static function getTokenName(): string
{
return self::proxy()->getTokenName();
}

/**
* 代理服务.
*/
Expand Down

0 comments on commit 1cfb217

Please sign in to comment.