Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
Merge 17305d5 into 64b2846
Browse files Browse the repository at this point in the history
  • Loading branch information
ousmanedev committed Nov 20, 2016
2 parents 64b2846 + 17305d5 commit 8913412
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 61 deletions.
2 changes: 1 addition & 1 deletion lib/Botamp/Api/ApiRequestor.php
Expand Up @@ -34,7 +34,7 @@ public function send($action, $params = [])
case 'all':
return $this->httpClient->get($this->serializeUrl($params));
case 'get':
return $this->httpClient->get($this->url."/{$params['id']}");
return $this->httpClient->get($this->url.( $params['id'] !== null ? '/'.$params['id'] : ''));
case 'create':
return $this->httpClient->post($this->url, [], $this->serializeBody($params));
case 'update':
Expand Down
2 changes: 1 addition & 1 deletion lib/Botamp/Api/ApiResource.php
Expand Up @@ -26,7 +26,7 @@ public function all(array $params = [])
return new BotampObject(ApiResponse::getContent($response), $this);
}

public function get($id)
public function get($id = null)
{
$response = $this->apiRequestor->send('get', ['id' => $id]);
return new BotampObject(ApiResponse::getContent($response), $this);
Expand Down
27 changes: 0 additions & 27 deletions lib/Botamp/Api/Me.php

This file was deleted.

6 changes: 4 additions & 2 deletions lib/Botamp/Client.php
Expand Up @@ -3,7 +3,6 @@
namespace Botamp;

use Botamp\Api\ApiResource;
use Botamp\Api\Me;
use Botamp\Api\ApiResponse;
use Botamp\Exceptions;
use Http\Client\Common;
Expand Down Expand Up @@ -35,6 +34,8 @@ class Client

public $me;

public $subscriptions;

public function __construct($apiKey, HttpClient $httpClient = null)
{
$this->apiKey = $apiKey;
Expand Down Expand Up @@ -95,6 +96,7 @@ private function setHttpClient(HttpClient $httpClient, MessageFactory $messageFa
private function bindResources()
{
$this->entities = new ApiResource('entities', $this);
$this->me = new Me($this);
$this->me = new ApiResource('me', $this);
$this->subscriptions = new ApiResource('subscriptions', $this);
}
}
30 changes: 0 additions & 30 deletions tests/Botamp/Api/MeTest.php

This file was deleted.

0 comments on commit 8913412

Please sign in to comment.