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