Documentation

VisitorFlyweight
in package

Flyweight factory used to instantiate request and response visitors

Table of Contents

Properties

$cache  : array<string|int, mixed>
$defaultMappings  : array<string|int, mixed>
$instance  : self
$mappings  : array<string|int, mixed>

Methods

__construct()  : mixed
addRequestVisitor()  : self
Add a response visitor to the factory by name
addResponseVisitor()  : self
Add a response visitor to the factory by name
getInstance()  : self
getRequestVisitor()  : RequestVisitorInterface
Get an instance of a request visitor by location name
getResponseVisitor()  : ResponseVisitorInterface
Get an instance of a response visitor by location name
getKey()  : mixed
Get a visitor by key value name

Properties

$cache

protected array<string|int, mixed> $cache = array()

Cache of instantiated visitors

$defaultMappings

protected static array<string|int, mixed> $defaultMappings = array('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')

Default array of mappings of location names to classes

$mappings

protected array<string|int, mixed> $mappings

Array of mappings of location names to classes

Methods

__construct()

public __construct([array<string|int, mixed> $mappings = null ]) : mixed
Parameters
$mappings : array<string|int, mixed> = null

Array mapping request.name and response.name to location visitor classes. Leave null to use the default values.

getInstance()

public static getInstance() : self
Tags
codeCoverageIgnore
Return values
self

        
On this page

Search results