Skip to content

Commit

Permalink
Merge pull request #11 from jomweb/master
Browse files Browse the repository at this point in the history
Backport PR #10 to 0.6 releases.
  • Loading branch information
crynobone authored Feb 24, 2017
2 parents 629822d + 90bf40c commit 62d0027
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ before_script:
- if [[ $setup = 'coveralls' ]]; then travis_retry composer require "satooshi/php-coveralls=~0.7" --prefer-dist --no-interaction --dev; fi

script:
- if [[ $coverage = 'yes' ]]; then phpunit -c phpunit.xml --coverage-clover build/logs/clover.xml; fi
- if [[ $coverage = 'no' ]]; then phpunit -c phpunit.xml; fi
- if [[ $coverage = 'yes' ]]; then vendor/bin/phpunit -c phpunit.xml --coverage-clover build/logs/clover.xml; fi
- if [[ $coverage = 'no' ]]; then vendor/bin/phpunit -c phpunit.xml; fi

after_script:
- if [[ $setup = 'coveralls' ]]; then php vendor/bin/coveralls -v; fi
Expand Down
46 changes: 46 additions & 0 deletions src/Three/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,28 @@ public function create($title, array $optional = [])
return $this->send('POST', 'collections', $headers, $stream);
}

/**
* Get collection.
*
* @param string $id
*
* @return \Laravie\Codex\Response
*/
public function get($id)
{
return $this->send('GET', "collections/{$id}", [], []);
}

/**
* Get collection index.
*
* @return \Laravie\Codex\Response
*/
public function index(array $optional = [])
{
return $this->send('GET', "collections", [], $optional);
}

/**
* Create a new open collection.
*
Expand All @@ -48,6 +70,30 @@ public function createOpen($title, $description, $amount, array $optional = [])
return $this->send('POST', 'open_collections', [], $body);
}

/**
* Get open collection.
*
* @param string $id
*
* @return \Laravie\Codex\Response
*/
public function getOpen($id)
{
return $this->send('GET', "open_collections/{$id}", [], []);
}

/**
* Get open collection index.
*
* @param array $optional
*
* @return \Laravie\Codex\Response
*/
public function indexOpen(array $optional = [])
{
return $this->send('GET', "open_collections", [], $optional);
}

/**
* Activate a collection.
*
Expand Down

0 comments on commit 62d0027

Please sign in to comment.