Open Journal Systems  3.3.0
Guzzle\Plugin\ErrorResponse\ErrorResponsePlugin Class Reference
Inheritance diagram for Guzzle\Plugin\ErrorResponse\ErrorResponsePlugin:
Symfony\Component\EventDispatcher\EventSubscriberInterface

Public Member Functions

 onCommandBeforeSend (Event $event)
 

Static Public Member Functions

static getSubscribedEvents ()
 

Protected Member Functions

 getErrorClosure (RequestInterface $request, CommandInterface $command, Operation $operation)
 

Detailed Description

Converts generic Guzzle response exceptions into errorResponse exceptions

Definition at line 15 of file ErrorResponsePlugin.php.

Member Function Documentation

◆ getErrorClosure()

Guzzle\Plugin\ErrorResponse\ErrorResponsePlugin::getErrorClosure ( RequestInterface  $request,
CommandInterface  $command,
Operation  $operation 
)
protected
Parameters
RequestInterface$requestRequest that received an error
CommandInterface$commandCommand that created the request
Operation$operationOperation that defines the request and errors
Returns
\Closure Returns a closure
Exceptions
ErrorResponseException

Definition at line 47 of file ErrorResponsePlugin.php.

References Guzzle\Service\Description\Operation\getErrorResponses().

Referenced by Guzzle\Plugin\ErrorResponse\ErrorResponsePlugin\onCommandBeforeSend().

◆ getSubscribedEvents()

static Guzzle\Plugin\ErrorResponse\ErrorResponsePlugin::getSubscribedEvents ( )
static

Returns an array of event names this subscriber wants to listen to.

The array keys are event names and the value can be:

  • The method name to call (priority defaults to 0)
  • An array composed of the method name to call and the priority
  • An array of arrays composed of the method names to call and respective priorities, or 0 if unset

For instance:

  • array('eventName' => 'methodName')
  • array('eventName' => array('methodName', $priority))
  • array('eventName' => array(array('methodName1', $priority), array('methodName2')))
Returns
array The event names to listen to

Implements Symfony\Component\EventDispatcher\EventSubscriberInterface.

Definition at line 17 of file ErrorResponsePlugin.php.

◆ onCommandBeforeSend()

Guzzle\Plugin\ErrorResponse\ErrorResponsePlugin::onCommandBeforeSend ( Event  $event)

Adds a listener to requests before they sent from a command

Parameters
Event$eventEvent emitted

Definition at line 27 of file ErrorResponsePlugin.php.

References Guzzle\Plugin\ErrorResponse\ErrorResponsePlugin\getErrorClosure().


The documentation for this class was generated from the following file: