parser = $parser; } public function __invoke(\DeliciousBrains\WP_Offload_Media\Aws3\Aws\CommandInterface $command, \DeliciousBrains\WP_Offload_Media\Aws3\Psr\Http\Message\ResponseInterface $response) { if ($expected = $response->getHeaderLine('x-amz-crc32')) { $hash = hexdec(\DeliciousBrains\WP_Offload_Media\Aws3\GuzzleHttp\Psr7\hash($response->getBody(), 'crc32b')); if ($expected != $hash) { throw new \DeliciousBrains\WP_Offload_Media\Aws3\Aws\Exception\AwsException("crc32 mismatch. Expected {$expected}, found {$hash}.", $command, ['code' => 'ClientChecksumMismatch', 'connection_error' => true, 'response' => $response]); } } $fn = $this->parser; return $fn($command, $response); } public function parseMemberFromStream(\DeliciousBrains\WP_Offload_Media\Aws3\Psr\Http\Message\StreamInterface $stream, \DeliciousBrains\WP_Offload_Media\Aws3\Aws\Api\StructureShape $member, $response) { return $this->parser->parseMemberFromStream($stream, $member, $response); } }