Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 32ca792

Browse filesBrowse files
committed
Migrate Snsqs to AsyncAws
1 parent e1ff948 commit 32ca792
Copy full SHA for 32ca792

File tree

Expand file treeCollapse file tree

5 files changed

+9
-8
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+9
-8
lines changed

‎pkg/sns/SnsContext.php

Copy file name to clipboardExpand all lines: pkg/sns/SnsContext.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function getSubscriptions(SnsDestination $destination): array
128128

129129
public function getTopicArn(SnsDestination $destination): string
130130
{
131-
if (false == array_key_exists($destination->getTopicName(), $this->topicArns)) {
131+
if (!array_key_exists($destination->getTopicName(), $this->topicArns)) {
132132
$this->declareTopic($destination);
133133
}
134134

‎pkg/snsqs/SnsQsConnectionFactory.php

Copy file name to clipboardExpand all lines: pkg/snsqs/SnsQsConnectionFactory.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ class SnsQsConnectionFactory implements ConnectionFactory
2828
* 'secret' => null, AWS credentials. If no credentials are provided, the SDK will attempt to load them from the environment.
2929
* 'token' => null, AWS credentials. If no credentials are provided, the SDK will attempt to load them from the environment.
3030
* 'region' => null, (string, required) Region to connect to. See http://docs.aws.amazon.com/general/latest/gr/rande.html for a list of available regions.
31-
* 'version' => '2012-11-05', (string, required) The version of the webservice to utilize
3231
* 'lazy' => true, Enable lazy connection (boolean)
3332
* 'endpoint' => null (string, default=null) The full URI of the webservice. This is only required when connecting to a custom endpoint e.g. localstack
33+
* 'profile' => null, (string, default=null) The name of an AWS profile to used, if provided the SDK will attempt to read associated credentials from the ~/.aws/credentials file.
3434
* ].
3535
*
3636
* or
@@ -96,7 +96,7 @@ private function parseOptions(array $options): void
9696
{
9797
// set default options
9898
foreach ($options as $key => $value) {
99-
if (false === in_array(substr($key, 0, 4), ['sns_', 'sqs_'], true)) {
99+
if (!in_array(substr($key, 0, 4), ['sns_', 'sqs_'], true)) {
100100
$this->snsConfig[$key] = $value;
101101
$this->sqsConfig[$key] = $value;
102102
}

‎pkg/snsqs/SnsQsContext.php

Copy file name to clipboardExpand all lines: pkg/snsqs/SnsQsContext.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ private function getSnsContext(): SnsContext
180180
{
181181
if (null === $this->snsContext) {
182182
$context = call_user_func($this->snsContextFactory);
183-
if (false == $context instanceof SnsContext) {
183+
if (!$context instanceof SnsContext) {
184184
throw new \LogicException(sprintf(
185185
'The factory must return instance of %s. It returned %s',
186186
SnsContext::class,
@@ -198,7 +198,7 @@ private function getSqsContext(): SqsContext
198198
{
199199
if (null === $this->sqsContext) {
200200
$context = call_user_func($this->sqsContextFactory);
201-
if (false == $context instanceof SqsContext) {
201+
if (!$context instanceof SqsContext) {
202202
throw new \LogicException(sprintf(
203203
'The factory must return instance of %s. It returned %s',
204204
SqsContext::class,

‎pkg/snsqs/SnsQsProducer.php

Copy file name to clipboardExpand all lines: pkg/snsqs/SnsQsProducer.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function send(Destination $destination, Message $message): void
5050
{
5151
InvalidMessageException::assertMessageInstanceOf($message, SnsQsMessage::class);
5252

53-
if (false == $destination instanceof SnsQsTopic && false == $destination instanceof SnsQsQueue) {
53+
if (!$destination instanceof SnsQsTopic && !$destination instanceof SnsQsQueue) {
5454
throw new InvalidDestinationException(sprintf(
5555
'The destination must be an instance of [%s|%s] but got %s.',
5656
SnsQsTopic::class, SnsQsQueue::class,

‎pkg/snsqs/Tests/SnsQsProducerTest.php

Copy file name to clipboardExpand all lines: pkg/snsqs/Tests/SnsQsProducerTest.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ public function testShouldImplementProducerInterface()
3030

3131
public function testCouldBeConstructedWithRequiredArguments()
3232
{
33-
new SnsQsProducer($this->createSnsContextMock(), $this->createSqsContextMock());
33+
$producer = new SnsQsProducer($this->createSnsContextMock(), $this->createSqsContextMock());
34+
$this->assertInstanceOf(SnsQsProducer::class, $producer);
3435
}
3536

3637
public function testShouldThrowIfMessageIsInvalidType()
3738
{
3839
$this->expectException(InvalidMessageException::class);
39-
$this->expectExceptionMessage('The message must be an instance of Enqueue\SnsQs\SnsQsMessage but it is Double\Message\P4');
40+
$this->expectExceptionMessage('The message must be an instance of Enqueue\SnsQs\SnsQsMessage but it is Double\Message\P1');
4041

4142
$producer = new SnsQsProducer($this->createSnsContextMock(), $this->createSqsContextMock());
4243

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.