protected function valid($token)
    {
        try {
            (new HttpClient)->get(
                $this->sparkUrl.'/api/token/'.$token.'/validate',
                ['verify' => __DIR__.'/cacert.pem']
            );

            return true;
        } catch (Exception $e) {
            var_dump($e->getMessage());

            return false;
        }
    }
protected function valid($token)
    {
        try {
            (new HttpClient)->get(
                $this->sparkUrl.'/api/token/'.$token.'/validate',
                ['verify' => __DIR__.'/cacert.pem']
            );

            return true;
        } catch (Exception $e) {
            var_dump($e->getMessage());

            return false;
        }
    }
protected function valid ( $ token ) { try { ( new HttpClient ) -> get ( $ this -> sparkUrl . '/api/token/' . $ token . '/validate' , [ 'verify' => __DIR__ . '/cacert.pem' ] ) ; return true ; } catch ( Exception $ e ) { var_dump ( $ e -> getMessage ( ) ) ; return false ; } }
Determine if the given token is valid.

@param  string  $token
@return bool
Determine if the given token is valid .