Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/EdpGithub/Api/AbstractApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

namespace EdpGithub\Api;

use EdpGithub\Client;
use Zend\ServiceManager\ServiceManagerAwareInterface;
use Zend\ServiceManager\ServiceManager;

abstract class AbstractApi implements ServiceManagerAwareInterface
{
/**
* @var EdpGithub\Client
* @var Client
*/
protected $client;

Expand Down Expand Up @@ -36,7 +37,7 @@ protected function post($path, array $parameters = array(), $requestHeaders = ar

/**
* Get Client
* @return EdpGithub\Client
* @return Client
*/
public function getClient()
{
Expand Down
4 changes: 2 additions & 2 deletions src/EdpGithub/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function getServiceManager()
}

/**
* @return HttpClient
* @return Http\Client
*/
public function getHttpClient()
{
Expand All @@ -98,7 +98,7 @@ public function getHttpClient()

/**
* Set HttpClient
* @param HttpClientInterface $httpClient
* @param Http\ClientInterface $httpClient
*/
public function setHttpClient($httpClient)
{
Expand Down
1 change: 0 additions & 1 deletion src/EdpGithub/Collection/RepositoryCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace EdpGithub\Collection;

use EdpGithub\Http\Client;
use EdpGithub\Api\Model\Repo as RepoModel;
use Zend\Stdlib\Hydrator;

use Closure;
Expand Down
45 changes: 25 additions & 20 deletions src/EdpGithub/Http/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

namespace EdpGithub\Http;

use Zend\Http\Client as HttpClient;
use Zend\Http\Client\Adapter\Curl;

use Zend\EventManager\EventManagerInterface;
use Zend\EventManager\EventManager;
use Zend\EventManager\EventManagerAwareInterface;
use Zend\EventManager\EventManagerInterface;
use Zend\Http;
use Zend\ServiceManager\ServiceManager;

class Client implements EventManagerAwareInterface, ClientInterface
{
/*
/**
* EventManager
*/
protected $events;
Expand All @@ -22,22 +20,22 @@ class Client implements EventManagerAwareInterface, ClientInterface
protected $serviceManager;

/**
* @var HttpClient
* @var Http\Client
*/
protected $httpClient;

/**
* @var Curl
* @var Http\Client\Adapter\Curl
*/
protected $httpAdapter;

/**
* @var Response
* @var Http\Response
*/
protected $response;

/**
* @var Request
* @var Http\Request
*/
protected $request;

Expand All @@ -56,7 +54,7 @@ class Client implements EventManagerAwareInterface, ClientInterface
* @param string $path
* @param array $parameters
* @param array $headers
* @return Zend\Http\Response
* @return Http\Response
*/
public function get($path, array $parameters = array(), array $headers = array())
{
Expand All @@ -69,7 +67,7 @@ public function get($path, array $parameters = array(), array $headers = array()
* @param string $path
* @param array $parameters
* @param array $headers
* @return Zend\Http\Response
* @return Http\Response
*/
public function post($path, array $parameters = array(), array $headers = array())
{
Expand All @@ -82,7 +80,7 @@ public function post($path, array $parameters = array(), array $headers = array(
* @param string $path
* @param array $parameters
* @param array $headers
* @return Zend\Http\Response
* @return Http\Response
*/
public function delete($path, array $parameters = array(), array $headers = array())
{
Expand All @@ -94,7 +92,7 @@ public function delete($path, array $parameters = array(), array $headers = arra
*
* @param string $path
* @param array $headers
* @return Zend\Http\Response
* @return Http\Response
*/
public function put($path, array $headers = array())
{
Expand All @@ -108,7 +106,7 @@ public function put($path, array $headers = array())
* @param array $parameters
* @param string $httpMethod
* @param array $headers
* @return Zend\Http\Response
* @return Http\Response
*/
public function request($path, array $parameters = array(), $httpMethod = 'GET', array $headers = array())
{
Expand Down Expand Up @@ -146,12 +144,12 @@ public function request($path, array $parameters = array(), $httpMethod = 'GET',
* Get Http Client
*
* @param string $path
* @return HttpClient
* @return Http\Client
*/
public function getHttpClient($path)
{
if (null === $this->httpClient) {
$this->httpClient = new HttpClient();
$this->httpClient = new Http\Client();
$this->httpClient->setAdapter($this->getHttpAdapter());
}
$this->httpClient->setUri($this->options['base_url'] . $path);
Expand All @@ -160,12 +158,13 @@ public function getHttpClient($path)

/**
* Get Http Adapter
* @return
*
* @return Http\Client\Adapter\Curl
*/
public function getHttpAdapter()
{
if (null === $this->httpAdapter) {
$this->httpAdapter = new Curl();
$this->httpAdapter = new Http\Client\Adapter\Curl();
$this->httpAdapter->setOptions(array(
'sslverifypeer' =>false,
));
Expand All @@ -182,7 +181,7 @@ public function setHttpAdapter($adapter)
* Set Event Manager
*
* @param EventManagerInterface $events
* @return HybridAuth
* @return self
*/
public function setEventManager(EventManagerInterface $events)
{
Expand All @@ -206,11 +205,17 @@ public function getEventManager()
return $this->events;
}

/**
* @return Http\Response
*/
public function getResponse()
{
return $this->response;
}

/**
* @return Http\Request
*/
public function getRequest()
{
return $this->request;
Expand Down
4 changes: 2 additions & 2 deletions src/EdpGithub/Listener/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace EdpGithub\Listener;

use Zend\Cache\Storage\StorageInterface;
use Zend\EventManager\ListenerAggregateInterface;
use Zend\EventManager\EventManagerInterface;
use Zend\EventManager\Event;

use Zend\EventManager\EventManagerInterface;
use Zend\ServiceManager\ServiceManagerAwareInterface;
use Zend\ServiceManager\ServiceManager;

Expand Down