Download the PHP package micronative/sns without Composer
On this page you can find all versions of the php package micronative/sns. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download micronative/sns
More information about micronative/sns
Files in micronative/sns
Download micronative/sns
More information about micronative/sns
Files in micronative/sns
Vendor micronative
Package sns
Short Description Message Queue Amazon SNS Transport (fork and improve from enqueue/sns)
License MIT
Homepage https://github.com/micronative/
Package sns
Short Description Message Queue Amazon SNS Transport (fork and improve from enqueue/sns)
License MIT
Homepage https://github.com/micronative/
Please rate this library. Is it a good library?
Informations about the package sns
Micronative/Sns
Configuration
"require": { "micronative/sns": "^2.0.0" }, "repositories": [ { "type": "vcs", "url": "https://github.com/micronative/sns" } ],
Run
composer require micronative/sns:2.0.0
Description
This project was forked from enqueue/sns and made the following improvements:
- Move all classes to src
- Rename Tests to tests
- Move examples to tests
- Change namespace to Micronative\Sns
SnsProducer->send():
public function send(Destination $destination, Message $message): void { InvalidDestinationException::assertDestinationInstanceOf($destination, SnsDestination::class); InvalidMessageException::assertMessageInstanceOf($message, SnsMessage::class); $body = $message->getBody(); if (empty($body)) { throw new InvalidMessageException('The message body must be a non-empty string.'); } $topicArn = $this->context->getTopicArn($destination); $arguments = [ 'Message' => $message->getBody(), 'TopicArn' => $topicArn, ]; if ($message->getProperties()) { foreach ($message->getProperties() as $name => $value) { $arguments['MessageAttributes'][$name] = ['DataType' => 'String', 'StringValue' => $value]; } } if ($message->getMessageAttributes()) { foreach ($message->getMessageAttributes() as $name => $value) { $arguments['MessageAttributes'][$name] = ['DataType' => 'String', 'StringValue' => $value['StringValue]]; } } if (null !== ($structure = $message->getMessageStructure())) { $arguments['MessageStructure'] = $structure; } if (null !== ($phone = $message->getPhoneNumber())) { $arguments['PhoneNumber'] = $phone; } if (null !== ($subject = $message->getSubject())) { $arguments['Subject'] = $subject; } if (null !== ($targetArn = $message->getTargetArn())) { $arguments['TargetArn'] = $targetArn; } $result = $this->context->getSnsClient()->publish($arguments); if (false == $result->hasKey('MessageId')) { throw new \RuntimeException('Message was not sent'); } $message->setSnsMessageId((string) $result->get('MessageId')); }
All versions of sns with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.1.3
queue-interop/queue-interop Version ^0.7|^0.8
enqueue/dsn Version ^0.9
aws/aws-sdk-php Version ~3.26
queue-interop/queue-interop Version ^0.7|^0.8
enqueue/dsn Version ^0.9
aws/aws-sdk-php Version ~3.26
The package micronative/sns contains the following files
Loading the files please wait ....