PHP Class LeagueWrap\Client

Inheritance: implements leaguewrap\ClientInterface
显示文件 Open project: paquettg/leaguewrap

Protected Properties

Property Type Description
$guzzle
$timeout

Public Methods

Method Description
addMock ( GuzzleHttp\HandlerStack $mock ) : void Attempt to add a mocked handler stack to guzzle, primary usage is to be able to test this code.
baseUrl ( string $url ) : void Sets the base url to be used for future requests.
request ( string $path, array $params = [] ) : Response Attempts to do a request of the given path.
setTimeout ( integer $seconds ) : void Set a timeout in seconds for how long we will wait for the server to respond. If the server does not respond within the set number of seconds we throw an exception.

Private Methods

Method Description
buildGuzzle ( $url, $handler = null )

Method Details

addMock() public method

Attempt to add a mocked handler stack to guzzle, primary usage is to be able to test this code.
public addMock ( GuzzleHttp\HandlerStack $mock ) : void
$mock GuzzleHttp\HandlerStack
return void

baseUrl() public method

Sets the base url to be used for future requests.
public baseUrl ( string $url ) : void
$url string
return void

request() public method

Attempts to do a request of the given path.
public request ( string $path, array $params = [] ) : Response
$path string
$params array
return Response

setTimeout() public method

Set a timeout in seconds for how long we will wait for the server to respond. If the server does not respond within the set number of seconds we throw an exception.
public setTimeout ( integer $seconds ) : void
$seconds integer
return void

Property Details

$guzzle protected_oe property

protected $guzzle

$timeout protected_oe property

protected $timeout