PHP Class Tebru\Retrofit\Adapter\Rest\RestAdapterBuilder

Builds a rest adapter
Author: Nate Brunette ([email protected])
Datei anzeigen Open project: tebru/retrofit-php

Public Methods

Method Description
__construct ( Tebru\Retrofit\HttpClient\ClientProvider $clientProvider ) Constructor
addSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber ) Add a subscriber
build ( ) : RestAdapter Build the rest adapter
ignoreLogSubscriber ( ) Do not use the default log subscriber;
setBaseUrl ( string $baseUrl ) Sets the base url for the rest client
setClientAdapter ( Tebru\Retrofit\Adapter\HttpClientAdapter $clientAdapter ) Set the http client adapter to make requests
setDeserializerAdapter ( Tebru\Retrofit\Adapter\DeserializerAdapter $deserializerAdapter ) Set the deserializer adapter
setEventDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher ) : RestAdapterBuilder Set the event dispatcher
setHttpClient ( mixed $httpClient ) Sets the http client used with rest client
setLogger ( Psr\Log\LoggerInterface $logger )
setSerializer ( JMS\Serializer\Serializer $serializer ) Set the serializer used with rest client
setSerializerAdapter ( Tebru\Retrofit\Adapter\SerializerAdapter $serializerAdapter ) Set the serializer adapter

Method Details

__construct() public method

Constructor
public __construct ( Tebru\Retrofit\HttpClient\ClientProvider $clientProvider )
$clientProvider Tebru\Retrofit\HttpClient\ClientProvider

addSubscriber() public method

Add a subscriber
public addSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber )
$subscriber Symfony\Component\EventDispatcher\EventSubscriberInterface

build() public method

Build the rest adapter
public build ( ) : RestAdapter
return RestAdapter

ignoreLogSubscriber() public method

Do not use the default log subscriber;
public ignoreLogSubscriber ( )

setBaseUrl() public method

Sets the base url for the rest client
public setBaseUrl ( string $baseUrl )
$baseUrl string

setClientAdapter() public method

Set the http client adapter to make requests
public setClientAdapter ( Tebru\Retrofit\Adapter\HttpClientAdapter $clientAdapter )
$clientAdapter Tebru\Retrofit\Adapter\HttpClientAdapter

setDeserializerAdapter() public method

Set the deserializer adapter
public setDeserializerAdapter ( Tebru\Retrofit\Adapter\DeserializerAdapter $deserializerAdapter )
$deserializerAdapter Tebru\Retrofit\Adapter\DeserializerAdapter

setEventDispatcher() public method

Set the event dispatcher
public setEventDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher ) : RestAdapterBuilder
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
return RestAdapterBuilder

setHttpClient() public method

Currently only supports guzzle clients
Deprecation: Will be removed in v3. Use setClientAdapter() instead.
public setHttpClient ( mixed $httpClient )
$httpClient mixed

setLogger() public method

public setLogger ( Psr\Log\LoggerInterface $logger )
$logger Psr\Log\LoggerInterface

setSerializer() public method

Set the serializer used with rest client
public setSerializer ( JMS\Serializer\Serializer $serializer )
$serializer JMS\Serializer\Serializer

setSerializerAdapter() public method

Set the serializer adapter
public setSerializerAdapter ( Tebru\Retrofit\Adapter\SerializerAdapter $serializerAdapter )
$serializerAdapter Tebru\Retrofit\Adapter\SerializerAdapter