{"id":20980617,"url":"https://github.com/php-api-clients/travis","last_synced_at":"2025-07-19T20:03:28.121Z","repository":{"id":52422273,"uuid":"71830701","full_name":"php-api-clients/travis","owner":"php-api-clients","description":":construction_worker: Async first TravisCI PHP API Client","archived":false,"fork":false,"pushed_at":"2023-12-15T17:45:06.000Z","size":655,"stargazers_count":6,"open_issues_count":3,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-26T02:10:37.906Z","etag":null,"topics":["api","api-client","async","async-php","hacktoberfest","php","php-api-clients","php7","reactphp","travis","travis-ci"],"latest_commit_sha":null,"homepage":"https://php-api-clients.org/clients/travis/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/php-api-clients.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-24T20:45:29.000Z","updated_at":"2023-09-19T01:44:30.000Z","dependencies_parsed_at":"2023-12-15T18:52:23.326Z","dependency_job_id":null,"html_url":"https://github.com/php-api-clients/travis","commit_stats":{"total_commits":543,"total_committers":6,"mean_commits":90.5,"dds":0.07366482504604055,"last_synced_commit":"21005f6027aa299e3a0131391a1ab76386901bc0"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/php-api-clients/travis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-api-clients%2Ftravis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-api-clients%2Ftravis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-api-clients%2Ftravis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-api-clients%2Ftravis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-api-clients","download_url":"https://codeload.github.com/php-api-clients/travis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-api-clients%2Ftravis/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266002164,"owners_count":23862484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-client","async","async-php","hacktoberfest","php","php-api-clients","php7","reactphp","travis","travis-ci"],"created_at":"2024-11-19T05:29:23.412Z","updated_at":"2025-07-19T20:03:28.081Z","avatar_url":"https://github.com/php-api-clients.png","language":"PHP","readme":"# Async first TravisCI API Client for PHP 7\n\n[![Build Status](https://travis-ci.org/php-api-clients/travis.svg?branch=master)](https://travis-ci.org/php-api-clients/travis)\n[![Latest Stable Version](https://poser.pugx.org/api-clients/travis/v/stable.png)](https://packagist.org/packages/api-clients/travis)\n[![Total Downloads](https://poser.pugx.org/api-clients/travis/downloads.png)](https://packagist.org/packages/api-clients/travis)\n[![Code Coverage](https://scrutinizer-ci.com/g/php-api-clients/travis/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/php-api-clients/travis/?branch=master)\n[![License](https://poser.pugx.org/api-clients/travis/license.png)](https://packagist.org/packages/api-clients/travis)\n[![PHP 7 ready](http://php7ready.timesplinter.ch/php-api-clients/travis/badge.svg)](https://travis-ci.org/php-api-clients/travis)\n\n# Install\n\nTo install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.\n\n```\ncomposer require api-clients/travis\n```\n\n# Usage\n\nThe 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.\n\n```php\nuse React\\EventLoop\\Factory;\nuse ApiClients\\Client\\Travis\\AsyncClient;\nuse ApiClients\\Client\\Travis\\Resource\\UserInterface;\nuse function ApiClients\\Foundation\\resource_pretty_print;\n\n$loop = Factory::create();\n$client = AsyncClient::create(\n    $loop, \n    'your travis key from https://blog.travis-ci.com/2013-01-28-token-token-token/'\n);\n\n$client-\u003euser()-\u003ethen(function (UserInterface $user) {\n    resource_pretty_print($user);\n});\n\n$loop-\u003erun();\n```\n\n## Results stream\n\nThe 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\n\n```php\n\nuse React\\EventLoop\\Factory;\nuse ApiClients\\Client\\Travis\\AsyncClient;\nuse ApiClients\\Client\\Travis\\Resource\\BroadcastInterface;\nuse function ApiClients\\Foundation\\resource_pretty_print;\n\n$loop = Factory::create();\n$client = AsyncClient::create($loop, 'your key');\n\n$client-\u003ebroadcasts()-\u003esubscribe(function (BroadcastInterface $broadcast) {\n    resource_pretty_print($broadcast);\n});\n\n$loop-\u003erun();\n```\n\n# Synchronous usage\n\nThe 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.\n\n```php\nuse ApiClients\\Client\\Travis\\Client;\nuse function ApiClients\\Foundation\\resource_pretty_print;\n\n$client = Client::create('your travis key');\n\nresource_pretty_print($client-\u003euser());\n```\n\n## Synchronous results stream\n\nSynchronous results streams are returned as an array.\n\n```php\nuse ApiClients\\Client\\Travis\\Client;\nuse function ApiClients\\Foundation\\resource_pretty_print;\n\n$client = Client::create('your travis key');\n\nforeach ($client-\u003ebroadcasts() as $broadcast) {\n    resource_pretty_print($broadcast);\n};\n```\n\n# Examples\n\nThe [`examples`](https://github.com/php-api-clients/travis/tree/master/examples) directory is filled with all kinds of examples for this package.\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 Cees-Jan Kiewiet\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-api-clients%2Ftravis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-api-clients%2Ftravis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-api-clients%2Ftravis/lists"}