src/Plugin.php
protected function getApiRequest(Event $event, Queue $queue, GoogleProviderInterface $provider)
    {
        $self = $this;

        return new HttpRequest([
            'url' => $provider->getApiRequestUrl($event),
            'resolveCallback' => function (Response $response) use ($self, $event, $queue, $provider) {
                $self->sendIrcResponse($event, $queue, $provider->getSuccessLines($event, $response->getBody()));
            },
            'rejectCallback' => function ($error) use ($self, $event, $queue, $provider) {
                $self->sendIrcResponse($event, $queue, $provider->getRejectLines($event, $error));
            }
        ]);
    }
protected function getApiRequest(Event $event, Queue $queue, GoogleProviderInterface $provider)
    {
        $self = $this;

        return new HttpRequest([
            'url' => $provider->getApiRequestUrl($event),
            'resolveCallback' => function (Response $response) use ($self, $event, $queue, $provider) {
                $self->sendIrcResponse($event, $queue, $provider->getSuccessLines($event, $response->getBody()));
            },
            'rejectCallback' => function ($error) use ($self, $event, $queue, $provider) {
                $self->sendIrcResponse($event, $queue, $provider->getRejectLines($event, $error));
            }
        ]);
    }
protected function getApiRequest ( Event $ event , Queue $ queue , GoogleProviderInterface $ provider ) { $ self = $ this ; return new HttpRequest ( [ 'url' => $ provider -> getApiRequestUrl ( $ event ) , 'resolveCallback' => function ( Response $ response ) use ( $ self , $ event , $ queue , $ provider ) { $ self -> sendIrcResponse ( $ event , $ queue , $ provider -> getSuccessLines ( $ event , $ response -> getBody ( ) ) ) ; } , 'rejectCallback' => function ( $ error ) use ( $ self , $ event , $ queue , $ provider ) { $ self -> sendIrcResponse ( $ event , $ queue , $ provider -> getRejectLines ( $ event , $ error ) ) ; } ] ) ; }
Set up the API request and set the callbacks

@param \Phergie\Irc\Plugin\React\Command\CommandEvent $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue
@param \Chrismou\Phergie\Plugin\Google\Provider\GoogleProviderInterface $provider
@return \Phergie\Plugin\Http\Request
Set up the API request and set the callbacks