1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-04 10:24:07 +02:00

more type hints

This commit is contained in:
Robin Appelman 2017-07-30 16:08:25 +02:00
commit 807c8c9a26
7 changed files with 23 additions and 21 deletions

View file

@ -18,11 +18,11 @@ class AuthProvider extends BaseProvider {
$this->generator = $generator;
}
public function generateToken() {
public function generateToken(): string {
return $this->generator->generateString(32, Generator::CHAR_ALNUM);
}
public function setUser($token, \SteamId $steamid, $key) {
public function setUser(string $token, \SteamId $steamid, string $key) {
apcu_store($token, [
'name' => $steamid->getNickname(),
'steamid' => $steamid->getSteamId64(),
@ -30,7 +30,7 @@ class AuthProvider extends BaseProvider {
]);
}
public function getUser($token) {
public function getUser(string $token) {
$found = true;
$result = apcu_fetch($token, $found);