Skip to content

MaartenStaa/gameanalytics-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GameAnalytics

PHP wrapper for the GameAnalytics REST API.

Build Status Scrutinizer Code Quality Code Coverage

Installation

Using Composer, add the package to your require section.

{
	"require": {
		"maartenstaa/gameanalytics-php": "~2"
	}
}

This package requires you to select an HTTP client to be used. For more information, read the documentation.

Usage

First, create a client using the game key and associated secret key. The third parameter is the HTTP client you want to use. If you do not provide it, the package will try to auto-detect which one is available. The fourth and final parameter is the HTTP message factory you wish to use. Again, if you do not provide it, the package will try to auto-detect which is available.

use MaartenStaa\GameAnalytics\Client;

$client = new Client($gameKey, $secretKey);

Next, you can use the "init" and "event" functions on the client to get a message instance. Use the set() function to configure the required parameters (refer to the official documentation) and use send() to send the message. You will receive a PSR-7 response object.

$client->init()->set(array(...))->send();

$message = $client->event('user');
$message->set('foo', 'bar')
	->set('baz', 'bax')
	->send();

Contributing

Coding standard

All code is to follow the PSR-2 coding standard.

Unit tests

If you find a bug, feel free to send a pull request to fix it, but make sure to always include a regression test.

About

PHP wrapper for the GameAnalytics REST API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages