protected function fetchExecutionToken()
    {
        try {
            $response = $this->client->get(static::LOGIN_URL, [
                'headers' => [
                    'User-Agent' => 'niantic'
                ]
            ]);
        } catch(ServerException $e) {
            sleep(1);
            return $this->fetchExecutionToken();
        }

        if ($response->getStatusCode() !== 200) {
            throw new AuthenticationException("Could not retrieve execution token. Got status code " . $response->getStatusCode());
        }

        $jsonData = json_decode($response->getBody()->getContents());

        if (!$jsonData || !isset($jsonData->execution)) {
            throw new AuthenticationException("Could not retrieve execution token. Invalid JSON. TrainersClub could be offline or unstable.");
        }

        return $jsonData;
    }
protected function fetchExecutionToken()
    {
        try {
            $response = $this->client->get(static::LOGIN_URL, [
                'headers' => [
                    'User-Agent' => 'niantic'
                ]
            ]);
        } catch(ServerException $e) {
            sleep(1);
            return $this->fetchExecutionToken();
        }

        if ($response->getStatusCode() !== 200) {
            throw new AuthenticationException("Could not retrieve execution token. Got status code " . $response->getStatusCode());
        }

        $jsonData = json_decode($response->getBody()->getContents());

        if (!$jsonData || !isset($jsonData->execution)) {
            throw new AuthenticationException("Could not retrieve execution token. Invalid JSON. TrainersClub could be offline or unstable.");
        }

        return $jsonData;
    }
protected function fetchExecutionToken ( ) { try { $ response = $ this -> client -> get ( static :: LOGIN_URL , [ 'headers' => [ 'User-Agent' => 'niantic' ] ] ) ; } catch ( ServerException $ e ) { sleep ( 1 ) ; return $ this -> fetchExecutionToken ( ) ; } if ( $ response -> getStatusCode ( ) !== 200 ) { throw new AuthenticationException ( "Could not retrieve execution token. Got status code " . $ response -> getStatusCode ( ) ) ; } $ jsonData = json_decode ( $ response -> getBody ( ) -> getContents ( ) ) ; if ( ! $ jsonData || ! isset ( $ jsonData -> execution ) ) { throw new AuthenticationException ( "Could not retrieve execution token. Invalid JSON. TrainersClub could be offline or unstable." ) ; } return $ jsonData ; }
Get data we need

@return mixed
@throws \Exception
Get data we need