ResponseLocationInterface.php
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
namespace GuzzleHttp\Command\Guzzle\ResponseLocation;
use GuzzleHttp\Command\Guzzle\Parameter;
use GuzzleHttp\Command\ResultInterface;
use Psr\Http\Message\ResponseInterface;
/**
* Location visitor used to parse values out of a response into an associative
* array
*/
interface ResponseLocationInterface
{
/**
* Called before visiting all parameters. This can be used for seeding the
* result of a command with default data (e.g. populating with JSON data in
* the response then adding to the parsed data).
*
* @param ResultInterface $result Result being created
* @param ResponseInterface $response Response being visited
* @param Parameter $model Response model
*
* @return ResultInterface Modified result
*/
public function before(
ResultInterface $result,
ResponseInterface $response,
Parameter $model
);
/**
* Called after visiting all parameters
*
* @param ResultInterface $result Result being created
* @param ResponseInterface $response Response being visited
* @param Parameter $model Response model
*
* @return ResultInterface Modified result
*/
public function after(
ResultInterface $result,
ResponseInterface $response,
Parameter $model
);
/**
* Called once for each parameter being visited that matches the location
* type.
*
* @param ResultInterface $result Result being created
* @param ResponseInterface $response Response being visited
* @param Parameter $param Parameter being visited
*
* @return ResultInterface Modified result
*/
public function visit(
ResultInterface $result,
ResponseInterface $response,
Parameter $param
);
}