thiagorb/codeship

Client for accessing Codeship API

0.5.0 2022-06-23 17:00 UTC

This package is auto-updated.

Last update: 2024-04-23 21:25:19 UTC


README

A PHP Client to use the Codeship API.

Requirements

  • PHP 7.1 or newer
  • Composer

Installing

This project follows the PSR-18 convention, which means you can use any HTTP client implementation with it.

If you don't know which one to choose, you can use the guzzle adapter.

To install the client with guzzle using composer run:

composer require thiagorb/codeship php-http/guzzle6-adapter

Usage

  1. Instantiate a factory

    • Using guzzle:
    $factory = new \Thiagorb\Codeship\Guzzle\Factory;
    
    • Using another client:
    $factory = new \Thiagorb\Codeship\Factory($client, $requestFactory);
    
  2. Instantiate the client

$codeship = $factory->build('user@example.com', 'password');
  1. Ready to use
$firstOrganization = $codeship->accountOrganizations()->read()[0];

$projects = $codeship->organizations()
    ->find($firstOrganization->getUuid())
    ->projects()
    ->read();

foreach ($projects->getProjects() as $project) {
    var_dump($project->getName());
}

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE file for details