PHP Class TheIconic\Tracking\GoogleAnalytics\Network\HttpClient

Datei anzeigen Open project: theiconic/php-ga-measurement-protocol Class Usage Examples

Public Methods

Method Description
__destruct ( ) We have to unwrap and send all promises at the end before analytics objects is destroyed.
post ( string $url, boolean $nonBlocking = false ) : AnalyticsResponse Sends request to Google Analytics.
setClient ( Client $client ) Sets HTTP client.

Protected Methods

Method Description
getAnalyticsResponse ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface | GuzzleHttp\Promise\PromiseInterface $response ) : AnalyticsResponse Creates an analytics response object.

Private Methods

Method Description
getClient ( ) : Client Gets HTTP client for internal class use.

Method Details

__destruct() public method

We have to unwrap and send all promises at the end before analytics objects is destroyed.
public __destruct ( )

getAnalyticsResponse() protected method

Creates an analytics response object.
protected getAnalyticsResponse ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface | GuzzleHttp\Promise\PromiseInterface $response ) : AnalyticsResponse
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface | GuzzleHttp\Promise\PromiseInterface
return TheIconic\Tracking\GoogleAnalytics\AnalyticsResponse

post() public method

Sends request to Google Analytics.
public post ( string $url, boolean $nonBlocking = false ) : AnalyticsResponse
$url string
$nonBlocking boolean
return TheIconic\Tracking\GoogleAnalytics\AnalyticsResponse

setClient() public method

Sets HTTP client.
public setClient ( Client $client )
$client GuzzleHttp\Client