<commit_before># Pusher API Client for PHP 7

[![Linux Build Status](https://travis-ci.org/php-api-clients/pusher.svg?branch=master)](https://travis-ci.org/php-api-clients/pusher)
[![Latest Stable Version](https://poser.pugx.org/api-clients/pusher/v/stable.png)](https://packagist.org/packages/api-clients/pusher)
[![Total Downloads](https://poser.pugx.org/api-clients/pusher/downloads.png)](https://packagist.org/packages/api-clients/pusher)
[![Code Coverage](https://scrutinizer-ci.com/g/php-api-clients/pusher/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/php-api-clients/pusher/?branch=master)
[![License](https://poser.pugx.org/api-clients/pusher/license.png)](https://packagist.org/packages/api-clients/pusher)
[![PHP 7 ready](http://php7ready.timesplinter.ch/php-api-clients/pusher/badge.svg)](https://appveyor-ci.org/php-api-clients/pusher)


# Goals

* 100% Pusher API support
* Both synchronous and asynchronous

# License<commit_msg>Updated readme adding Installation, usage, and features/roadmap<commit_after># Pusher API Client for PHP 7

[![Linux Build Status](https://travis-ci.org/php-api-clients/pusher.svg?branch=master)](https://travis-ci.org/php-api-clients/pusher)
[![Latest Stable Version](https://poser.pugx.org/api-clients/pusher/v/stable.png)](https://packagist.org/packages/api-clients/pusher)
[![Total Downloads](https://poser.pugx.org/api-clients/pusher/downloads.png)](https://packagist.org/packages/api-clients/pusher)
[![Code Coverage](https://scrutinizer-ci.com/g/php-api-clients/pusher/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/php-api-clients/pusher/?branch=master)
[![License](https://poser.pugx.org/api-clients/pusher/license.png)](https://packagist.org/packages/api-clients/pusher)
[![PHP 7 ready](http://php7ready.timesplinter.ch/php-api-clients/pusher/badge.svg)](https://appveyor-ci.org/php-api-clients/pusher)

# Installation

To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.

```bash
composer require api-clients/pusher 
```

# Usage

```php
$loop = Factory::create();
$client = AsyncClient::create($loop, 'Application ID here');

$client->channel($subReddit)->subscribe(
    function (Event $event) { // Gets called for each incoming event
        echo 'Channel: ', $event->getChannel(), PHP_EOL;
        echo 'Event: ', $event->getEvent(), PHP_EOL;
        echo 'Data: ', json_encode($event->getData()), PHP_EOL;
    },
    function ($e) { // Gets called on errors
        echo (string)$e;
    },
    function () { // Gets called when the end of the stream is reached
        echo 'Done!', PHP_EOL;
    }
);
```

For more examples see the [examples directory](examples).

# Features

This project aims to be 100% compatible with [Pusher's features](https://pusher.com/features) in `v1.2`.

- [X] Subscribe to channels
- [ ] Presence channels
- [ ] Authentication

# License
{'fraction_non_alphanumeric': 0.17962648556876062, 'fraction_numerical': 0.004753820033955857, 'mean_word_length': 4.676300578034682, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 23, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6283002', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1057, 'n_words': 162}