PHP Class TheIconic\Tracking\GoogleAnalytics\Network\HttpClient

Afficher le fichier Open project: theiconic/php-ga-measurement-protocol Class Usage Examples

Méthodes publiques

Méthode 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.

Méthodes protégées

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

Private Methods

Méthode Description
getClient ( ) : Client Gets HTTP client for internal class use.

Method Details

__destruct() public méthode

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

getAnalyticsResponse() protected méthode

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
Résultat TheIconic\Tracking\GoogleAnalytics\AnalyticsResponse

post() public méthode

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

setClient() public méthode

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