Overview

Namespaces

  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
    • Tests
      • Batch
      • Cache
      • Common
        • Cache
        • Exception
      • Http
        • Curl
        • Exception
        • Message
          • Header
      • Inflection
      • Iterator
      • Log
      • Message
      • Mock
      • Parser
        • Cookie
        • Message
      • Parsers
        • UriTemplate
      • Plugin
        • Async
        • Backoff
        • Cache
        • Cookie
          • CookieJar
        • CurlAuth
        • ErrorResponse
        • History
        • Log
        • Md5
        • Mock
        • Oauth
        • Redirect
      • Service
        • Builder
        • Command
          • LocationVisitor
            • Request
            • Response
        • Description
        • Exception
        • Mock
          • Command
            • Sub
          • Model
        • Resource
      • Stream
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • VivaPayments
      • Message
  • PHP

Classes

  • ServiceBuilder
  • ServiceBuilderLoader

Interfaces

  • ServiceBuilderInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class ServiceBuilder

Class that holds an event dispatcher

Clients and data can be set, retrieved, and removed by accessing the service builder like an associative array.

Guzzle\Common\AbstractHasDispatcher implements Guzzle\Common\HasDispatcherInterface
Extended by Guzzle\Service\Builder\ServiceBuilder implements Guzzle\Service\Builder\ServiceBuilderInterface, ArrayAccess, Serializable
Namespace: Guzzle\Service\Builder
Located at src/Guzzle/Service/Builder/ServiceBuilder.php
Methods summary
public static Guzzle\Service\Builder\ServiceBuilderInterface
# factory( array|string $config = null, array $globalParameters = array() )

Create a new ServiceBuilder using configuration data sourced from an array, .js|.json or .php file.

Create a new ServiceBuilder using configuration data sourced from an array, .js|.json or .php file.

Parameters

$config
The full path to an .json|.js or .php file, or an associative array
$globalParameters
Array of global parameters to pass to every service as it is instantiated.

Returns

Guzzle\Service\Builder\ServiceBuilderInterface

Throws

Guzzle\Service\Exception\ServiceBuilderException
if a file cannot be opened
Guzzle\Service\Exception\ServiceNotFoundException
when trying to extend a missing client
public
# __construct( array $serviceBuilderConfig = array() )

Parameters

$serviceBuilderConfig

Service configuration settings: - name: Name of the service - class: Client class to instantiate using a factory method - params: array of key value pair configuration settings for the builder

public static array
# getAllEvents( )

Get a list of all of the events emitted from the class

Get a list of all of the events emitted from the class

Returns

array

Overrides

Guzzle\Common\AbstractHasDispatcher::getAllEvents()
public
# unserialize( $serialized )

Implementation of

Serializable::unserialize()
public
# serialize( )

Implementation of

Serializable::serialize()
public Guzzle\Service\Builder\ServiceBuilder
# addGlobalPlugin( Symfony\Component\EventDispatcher\EventSubscriberInterface $plugin )

Attach a plugin to every client created by the builder

Attach a plugin to every client created by the builder

Parameters

$plugin
Plugin to attach to each client

Returns

Guzzle\Service\Builder\ServiceBuilder
public array|null
# getData( string $name )

Get data from the service builder without triggering the building of a service

Get data from the service builder without triggering the building of a service

Parameters

$name
Name of the service to retrieve

Returns

array|null
public Guzzle\Service\ClientInterface|mixed
# get( string $name, boolean|array $throwAway = false )

Get a ClientInterface object or arbitrary data from the service builder

Get a ClientInterface object or arbitrary data from the service builder

Parameters

$name
Name of the registered service or data to retrieve
$throwAway

Only pertains to retrieving client objects built using a configuration array. Set to TRUE to not store the client for later retrieval from the ServiceBuilder. If an array is specified, that data will overwrite the configured params of the client if the client implements Guzzle\Common\FromConfigInterface and will not store the client for later retrieval.

Returns

Guzzle\Service\ClientInterface|mixed

Throws

Guzzle\Service\Exception\ServiceNotFoundException
when a client or data cannot be found by the given name

Implementation of

Guzzle\Service\Builder\ServiceBuilderInterface::get()
public Guzzle\Service\Builder\ServiceBuilderInterface
# set( string $key, mixed $service )

Register a service or arbitrary data by name with the service builder

Register a service or arbitrary data by name with the service builder

Parameters

$key
Name of the client or data to register
$service

Client configuration array or arbitrary data to register. The client configuration array must include a 'class' (string) and 'params' (array) key.

Returns

Guzzle\Service\Builder\ServiceBuilderInterface

Implementation of

Guzzle\Service\Builder\ServiceBuilderInterface::set()
public
# offsetSet( $offset, $value )

Implementation of

ArrayAccess::offsetSet()
public
# offsetUnset( $offset )

Implementation of

ArrayAccess::offsetUnset()
public
# offsetExists( $offset )

Implementation of

ArrayAccess::offsetExists()
public
# offsetGet( $offset )

Implementation of

ArrayAccess::offsetGet()
Methods inherited from Guzzle\Common\AbstractHasDispatcher
addSubscriber(), dispatch(), getEventDispatcher(), setEventDispatcher()
Properties summary
protected array $builderConfig

Service builder configuration data

Service builder configuration data

# array()
protected array $clients

Instantiated client objects

Instantiated client objects

# array()
protected static Guzzle\Service\Builder\ServiceBuilderLoader $cachedFactory

Cached instance of the service builder loader

Cached instance of the service builder loader

#
protected array $plugins

Plugins to attach to each client created by the service builder

Plugins to attach to each client created by the service builder

# array()
Properties inherited from Guzzle\Common\AbstractHasDispatcher
$eventDispatcher
Omnipay Viva Payments Gateway Module API Documentation API documentation generated by ApiGen