YamlResponseParser
in package
implements
ResponseParser
A response parser for commands that return a subset of YAML.
Expected response is 'OK', 'NOT_FOUND' response is also handled. Parser expects either a YAML list or dictionary, depending on mode.
Tags
Interfaces, Classes and Traits
- ResponseParser
- A parser for response data sent from the beanstalkd server.
Table of Contents
- MODE_DICT = 'dict'
- MODE_LIST = 'list'
- $_mode : mixed
- __construct() : mixed
- parseResponse() : object
- Parses raw response data into a Response object.
- _mapYamlList() : string
- Callback for array_map to process YAML lines.
Constants
MODE_DICT
public
mixed
MODE_DICT
= 'dict'
MODE_LIST
public
mixed
MODE_LIST
= 'list'
Properties
$_mode
private
mixed
$_mode
Methods
__construct()
public
__construct(string $mode) : mixed
Parameters
- $mode : string
-
self::MODE_*
Return values
mixed —parseResponse()
Parses raw response data into a Response object.
public
parseResponse(mixed $responseLine, mixed $responseData) : object
Parameters
- $responseLine : mixed
-
Without trailing CRLF
- $responseData : mixed
-
(null if no data)
Return values
object —Response
_mapYamlList()
Callback for array_map to process YAML lines.
private
_mapYamlList(string $line) : string
Parameters
- $line : string