| 1441 |
ariadna |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
namespace Aws\S3\Parser;
|
|
|
4 |
|
|
|
5 |
use Aws\CommandInterface;
|
|
|
6 |
use Aws\ResultInterface;
|
|
|
7 |
use Psr\Http\Message\ResponseInterface;
|
|
|
8 |
|
|
|
9 |
/**
|
|
|
10 |
* Interface for S3 result mutator implementations.
|
|
|
11 |
* A S3 result mutator is meant for modifying a request
|
|
|
12 |
* result before returning it to the user.
|
|
|
13 |
* One example is if a custom field is needed to be injected
|
|
|
14 |
* into the result or if an existent field needs to be modified.
|
|
|
15 |
* Since the command and the response itself are parameters when
|
|
|
16 |
* invoking the mutators then, this facilitates to make better
|
|
|
17 |
* decisions that may involve validations using the command parameters
|
|
|
18 |
* or response fields, etc.
|
|
|
19 |
*
|
|
|
20 |
* @internal
|
|
|
21 |
*/
|
|
|
22 |
interface S3ResultMutator
|
|
|
23 |
{
|
|
|
24 |
/**
|
|
|
25 |
* @param ResultInterface $result the result object to be modified.
|
|
|
26 |
* @param CommandInterface $command the command that originated the request.
|
|
|
27 |
* @param ResponseInterface $response the response resulting from the request.
|
|
|
28 |
*
|
|
|
29 |
* @return ResultInterface
|
|
|
30 |
*/
|
|
|
31 |
public function __invoke(
|
|
|
32 |
ResultInterface $result,
|
|
|
33 |
CommandInterface $command,
|
|
|
34 |
ResponseInterface $response
|
|
|
35 |
): ResultInterface;
|
|
|
36 |
}
|