Class Guzzle\Service\Command\LocationVisitor\VisitorFlyweight

InheritanceGuzzle\Service\Command\LocationVisitor\VisitorFlyweight

Flyweight factory used to instantiate request and response visitors

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$cache array Cache of instantiated visitors Guzzle\Service\Command\LocationVisitor\VisitorFlyweight
$defaultMappings array Default array of mappings of location names to classes Guzzle\Service\Command\LocationVisitor\VisitorFlyweight
$instance self Singleton instance of self Guzzle\Service\Command\LocationVisitor\VisitorFlyweight
$mappings array Array of mappings of location names to classes Guzzle\Service\Command\LocationVisitor\VisitorFlyweight

Property Details

$cache protected property

Cache of instantiated visitors

protected array $cache = []
$defaultMappings protected static property

Default array of mappings of location names to classes

protected static array $defaultMappings = ['request.body' => 'Guzzle\Service\Command\LocationVisitor\Request\BodyVisitor''request.header' => 'Guzzle\Service\Command\LocationVisitor\Request\HeaderVisitor''request.json' => 'Guzzle\Service\Command\LocationVisitor\Request\JsonVisitor''request.postField' => 'Guzzle\Service\Command\LocationVisitor\Request\PostFieldVisitor''request.postFile' => 'Guzzle\Service\Command\LocationVisitor\Request\PostFileVisitor''request.query' => 'Guzzle\Service\Command\LocationVisitor\Request\QueryVisitor''request.response_body' => 'Guzzle\Service\Command\LocationVisitor\Request\ResponseBodyVisitor''request.responseBody' => 'Guzzle\Service\Command\LocationVisitor\Request\ResponseBodyVisitor''request.xml' => 'Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor''response.body' => 'Guzzle\Service\Command\LocationVisitor\Response\BodyVisitor''response.header' => 'Guzzle\Service\Command\LocationVisitor\Response\HeaderVisitor''response.json' => 'Guzzle\Service\Command\LocationVisitor\Response\JsonVisitor''response.reasonPhrase' => 'Guzzle\Service\Command\LocationVisitor\Response\ReasonPhraseVisitor''response.statusCode' => 'Guzzle\Service\Command\LocationVisitor\Response\StatusCodeVisitor''response.xml' => 'Guzzle\Service\Command\LocationVisitor\Response\XmlVisitor']
$instance protected static property

Singleton instance of self

protected static self $instance null
$mappings protected property

Array of mappings of location names to classes

protected array $mappings null

Method Details

__construct() public method

public void __construct ( array $mappings null )
$mappings array

Array mapping request.name and response.name to location visitor classes. Leave null to

                   use the default values.
addRequestVisitor() public method

Add a response visitor to the factory by name

public self addRequestVisitor ( $name, Guzzle\Service\Command\LocationVisitor\Request\RequestVisitorInterface $visitor )
$name string

Name of the visitor

$visitor Guzzle\Service\Command\LocationVisitor\Request\RequestVisitorInterface

Visitor to add

addResponseVisitor() public method

Add a response visitor to the factory by name

public self addResponseVisitor ( $name, Guzzle\Service\Command\LocationVisitor\Response\ResponseVisitorInterface $visitor )
$name string

Name of the visitor

$visitor Guzzle\Service\Command\LocationVisitor\Response\ResponseVisitorInterface

Visitor to add

getInstance() public static method

public static self getInstance ( )
getRequestVisitor() public method

Get an instance of a request visitor by location name

public Guzzle\Service\Command\LocationVisitor\Request\RequestVisitorInterface getRequestVisitor ( $visitor )
$visitor string

Visitor name

getResponseVisitor() public method

Get an instance of a response visitor by location name

public Guzzle\Service\Command\LocationVisitor\Response\ResponseVisitorInterface getResponseVisitor ( $visitor )
$visitor string

Visitor name