public function getUserIdFromToken(string $token): string
    {
        if (!$this->isTokenValid($token)) {
            throw new \InvalidArgumentException('This token is invalid');
        }
        $tokenData = $this->decryptToken($token);

        return $tokenData['user_id'];
    }
public function getUserIdFromToken(string $token): string
    {
        if (!$this->isTokenValid($token)) {
            throw new \InvalidArgumentException('This token is invalid');
        }
        $tokenData = $this->decryptToken($token);

        return $tokenData['user_id'];
    }
public function getUserIdFromToken ( string $ token ) : string { if ( ! $ this -> isTokenValid ( $ token ) ) { throw new \ InvalidArgumentException ( 'This token is invalid' ) ; } $ tokenData = $ this -> decryptToken ( $ token ) ; return $ tokenData [ 'user_id' ] ; }
Returns the user id from the given token

@param string $token The string token
@return string
@throws \InvalidArgumentException
Returns the user id from the given token