Skip to content

Commit

Permalink
Added call method
Browse files Browse the repository at this point in the history
  • Loading branch information
lyrixx committed Sep 5, 2014
1 parent 655749f commit 0793564
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Sdk/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,24 @@ public function analyze($projectUuid, $reference = null)
);
}

/**
* Use this method to call a specific API resource.
*/
public function call($method = 'GET', $uri = null, $headers = null, $body = null, array $options = array(), $classToUnserialize = null)
{
$request = $this->client->createRequest($method, $uri, $headers, $body, $options);

if ($classToUnserialize) {
return $this->serializer->deserialize(
(string) $this->send($request)->getBody(),
$classToUnserialize,
'xml'
);
}

return $this->send($request);
}

public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
Expand Down

0 comments on commit 0793564

Please sign in to comment.