Skip to content

Commit

Permalink
snsqs fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ASKozienko committed Feb 20, 2019
1 parent 6c11421 commit 42edb58
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions SnsQsConnectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public function __construct($config = 'snsqs:')
*/
public function createContext(): Context
{
return new SnsQsContext(function() {
return new SnsQsContext(function () {
return (new SnsConnectionFactory($this->snsConfig))->createContext();
}, function() {
}, function () {
return (new SqsConnectionFactory($this->sqsConfig))->createContext();
});
}
Expand All @@ -96,7 +96,7 @@ private function parseOptions(array $options): void
{
// set default options
foreach ($options as $key => $value) {
if (false === in_array(substr($key, 0, 4), ['sns_', 'sqs_'])) {
if (false === in_array(substr($key, 0, 4), ['sns_', 'sqs_'], true)) {
$this->snsConfig[$key] = $value;
$this->sqsConfig[$key] = $value;
}
Expand Down
4 changes: 2 additions & 2 deletions SnsQsConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ private function convertMessage(SqsMessage $sqsMessage): SnsQsMessage

$body = $sqsMessage->getBody();

if (isset($body[0]) && $body[0] === '{') {
if (isset($body[0]) && '{' === $body[0]) {
$data = json_decode($sqsMessage->getBody(), true);

if (isset($data['TopicArn']) && isset($data['Type']) && $data['Type'] === 'Notification') {
if (isset($data['TopicArn']) && isset($data['Type']) && 'Notification' === $data['Type']) {
// SNS message conversion
if (isset($data['Message'])) {
$message->setBody((string) $data['Message']);
Expand Down
2 changes: 1 addition & 1 deletion SnsQsProducer.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct(SnsContext $snsContext, SqsContext $sqsContext)
}

/**
* @param SnsQsTopic $destination
* @param SnsQsTopic $destination
* @param SnsQsMessage $message
*/
public function send(Destination $destination, Message $message): void
Expand Down
2 changes: 1 addition & 1 deletion Tests/Spec/SnsQsSendToAndReceiveNoWaitFromQueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @group functional
* @retry 5
*/
class SqsQsSendToAndReceiveNoWaitFromQueueTest extends SendToAndReceiveNoWaitFromQueueSpec
class SnsQsSendToAndReceiveNoWaitFromQueueTest extends SendToAndReceiveNoWaitFromQueueSpec
{
use RetryTrait;
use SnsQsFactoryTrait;
Expand Down

0 comments on commit 42edb58

Please sign in to comment.