PHPackages                             api-clients/travis - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. api-clients/travis

ActiveLibrary[API Development](/categories/api)

api-clients/travis
==================

Async first TravisCI PHP API Client

1.0.1(8y ago)651.0k↓50%4[2 PRs](https://github.com/php-api-clients/travis/pulls)1MITPHPPHP ^7.0

Since Aug 19Pushed 2y ago3 watchersCompare

[ Source](https://github.com/php-api-clients/travis)[ Packagist](https://packagist.org/packages/api-clients/travis)[ Docs](https://php-api-clients.org/clients/travis/)[ RSS](/packages/api-clients-travis/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (13)Versions (5)Used By (1)

Async first TravisCI API Client for PHP 7
=========================================

[](#async-first-travisci-api-client-for-php-7)

[![Build Status](https://camo.githubusercontent.com/30d033238846ff6cd7d21e867e09541b5fbfed64706144b8cc600d430f12dcbf/68747470733a2f2f7472617669732d63692e6f72672f7068702d6170692d636c69656e74732f7472617669732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/php-api-clients/travis)[![Latest Stable Version](https://camo.githubusercontent.com/9266ab96fd9173c14694e2face1e5ebda869556600732df412bbe52ad30c7dc8/68747470733a2f2f706f7365722e707567782e6f72672f6170692d636c69656e74732f7472617669732f762f737461626c652e706e67)](https://packagist.org/packages/api-clients/travis)[![Total Downloads](https://camo.githubusercontent.com/b1145a0d6c889c0c795f7b5a4423d2332d845f6b9d10bae1060e8fa899b21986/68747470733a2f2f706f7365722e707567782e6f72672f6170692d636c69656e74732f7472617669732f646f776e6c6f6164732e706e67)](https://packagist.org/packages/api-clients/travis)[![Code Coverage](https://camo.githubusercontent.com/081bf5262c77d308cf6e19004d2f2359bff2d58417241aa6ed8bda4667a2e5d8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068702d6170692d636c69656e74732f7472617669732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/php-api-clients/travis/?branch=master)[![License](https://camo.githubusercontent.com/1a05079dd2760d6e492d3320f31b696afd378db1ba39e9c232dc20d4b9b066cd/68747470733a2f2f706f7365722e707567782e6f72672f6170692d636c69656e74732f7472617669732f6c6963656e73652e706e67)](https://packagist.org/packages/api-clients/travis)[![PHP 7 ready](https://camo.githubusercontent.com/14f9c7ee9b135a9691cde8857e3fe9a9c7e71bca6029c5e2367b19e84a34808c/687474703a2f2f7068703772656164792e74696d6573706c696e7465722e63682f7068702d6170692d636c69656e74732f7472617669732f62616467652e737667)](https://travis-ci.org/php-api-clients/travis)

Install
=======

[](#install)

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

```
composer require api-clients/travis

```

Usage
=====

[](#usage)

The client needs two things, the ReactPHP event loop, and optionally an authentication token. Once you created the client you can call the `user` method to show the currently authenticated user.

```
use React\EventLoop\Factory;
use ApiClients\Client\Travis\AsyncClient;
use ApiClients\Client\Travis\Resource\UserInterface;
use function ApiClients\Foundation\resource_pretty_print;

$loop = Factory::create();
$client = AsyncClient::create(
    $loop,
    'your travis key from https://blog.travis-ci.com/2013-01-28-token-token-token/'
);

$client->user()->then(function (UserInterface $user) {
    resource_pretty_print($user);
});

$loop->run();
```

Results stream
--------------

[](#results-stream)

The above example used a promise, when there is more then one result an observabe is returned instead. [`RxPHP`](https://github.com/reactivex/rxphp) is used for the observables. This means you can apply a huge list of methods to the stream of results

```
use React\EventLoop\Factory;
use ApiClients\Client\Travis\AsyncClient;
use ApiClients\Client\Travis\Resource\BroadcastInterface;
use function ApiClients\Foundation\resource_pretty_print;

$loop = Factory::create();
$client = AsyncClient::create($loop, 'your key');

$client->broadcasts()->subscribe(function (BroadcastInterface $broadcast) {
    resource_pretty_print($broadcast);
});

$loop->run();
```

Synchronous usage
=================

[](#synchronous-usage)

The synchronous client works nearly the same as the asynchronous, infact it wraps the asynchronous client to do all the work. This examples does the same as the asynchronous usage example.

```
use ApiClients\Client\Travis\Client;
use function ApiClients\Foundation\resource_pretty_print;

$client = Client::create('your travis key');

resource_pretty_print($client->user());
```

Synchronous results stream
--------------------------

[](#synchronous-results-stream)

Synchronous results streams are returned as an array.

```
use ApiClients\Client\Travis\Client;
use function ApiClients\Foundation\resource_pretty_print;

$client = Client::create('your travis key');

foreach ($client->broadcasts() as $broadcast) {
    resource_pretty_print($broadcast);
};
```

Examples
========

[](#examples)

The [`examples`](https://github.com/php-api-clients/travis/tree/master/examples) directory is filled with all kinds of examples for this package.

License
=======

[](#license)

The MIT License (MIT)

Copyright (c) 2017 Cees-Jan Kiewiet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 91.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~77 days

Total

2

Last Release

3116d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/147145?v=4)[Cees-Jan Kiewiet](/maintainers/WyriHaximus)[@WyriHaximus](https://github.com/WyriHaximus)

---

Top Contributors

[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (607 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (19 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (16 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 commits)")[![davidwdan](https://avatars.githubusercontent.com/u/4969183?v=4)](https://github.com/davidwdan "davidwdan (3 commits)")[![tarlepp](https://avatars.githubusercontent.com/u/595561?v=4)](https://github.com/tarlepp "tarlepp (2 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

apiapi-clientasyncasync-phphacktoberfestphpphp-api-clientsphp7reactphptravistravis-ci

### Embed Badge

![Health badge](/badges/api-clients-travis/health.svg)

```
[![Health](https://phpackages.com/badges/api-clients-travis/health.svg)](https://phpackages.com/packages/api-clients-travis)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[api-clients/github

Async first Github client

1679.6k](/packages/api-clients-github)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23914.2M16](/packages/hubspot-api-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
