Skip to content

Commit

Permalink
Update method name for extracting colors
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriceclementz committed Feb 16, 2017
1 parent 595d254 commit 896c3a6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use Fab\Imagga\Client;
$client = new Client(new HttpClient(), 'IMAGGA_API_KEY', 'IMAGGA_API_SECRET');
$response = $client->extractColors('https://imagga.com/static/images/tagging/wind-farm-538576_640.jpg');
$response = $client->colors('https://imagga.com/static/images/tagging/wind-farm-538576_640.jpg');
```

## Testing
Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function tags($url, array $options = [])
* @param string $url The image url.
* @return array
*/
public function extractColors($url, array $options = [])
public function colors($url, array $options = [])
{
return $this->send('GET', 'colors', array_merge($options, [
'url' => $url,
Expand Down
4 changes: 2 additions & 2 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function can_get_colors_of_images()
->andReturn(json_encode(['foo' => 'bar']));

// Act
$response = (new Client($httpClient, 'api-key', 'api-secret'))->extractColors('image-url');
$response = (new Client($httpClient, 'api-key', 'api-secret'))->colors('image-url');

// Assert
$this->assertTrue(is_array($response));
Expand Down Expand Up @@ -147,7 +147,7 @@ function can_pass_options_when_get_colors_of_an_image()
->andReturn(json_encode(['foo' => 'bar']));

// Act
$response = (new Client($httpClient, 'api-key', 'api-secret'))->extractColors('image-url', [
$response = (new Client($httpClient, 'api-key', 'api-secret'))->colors('image-url', [
'extract_overall_colors' => '0',
]);

Expand Down

0 comments on commit 896c3a6

Please sign in to comment.