/** * @param mixed[] $message * @return string|bool * @throws ExceptionInterface */ private function decodeSqsMessage(array $message) { if (!array_key_exists('Body', $message)) { // Unknown message body. Skip processing. return $message; } try { $claimCheck = $this->configuration->getClaimCheckSerializer()->unserialize($message['Body']); } catch (ExceptionInterface $e) { // Unknown message body. Skip processing. return $message; } if (!$claimCheck instanceof ClaimCheck) { // Unknown message body. Skip processing. return $message; } try { $message['Body'] = $this->fetchClaimCheckFromS3($claimCheck); } catch (ExceptionInterface $e) { // Unknown message body. Skip processing. return $message; } if (array_key_exists('ReceiptHandle', $message) && $this->configuration->getDeleteFromS3()) { // Prepend S3 information to receipt handle. $message['ReceiptHandle'] = $this->embedS3PointerInReceiptHandle($message['ReceiptHandle'], $claimCheck->getS3BucketName(), $claimCheck->getS3Key()); } return $message; }
public function testGetClaimCheckSerializer() { self::assertInstanceOf(ClaimCheckSerializerInterface::class, $this->sut->getClaimCheckSerializer()); $this->sut->setClaimCheckSerializer($expected = new ClaimCheckSerializerChain()); self::assertSame($expected, $this->sut->getClaimCheckSerializer()); }