Skip to content

Commit 5f0bd43

Browse files
author
Igor Paramonov
committed
[sns] handled comments
1 parent 9730b80 commit 5f0bd43

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

pkg/sns/SnsConnectionFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function __construct($config = 'sns:')
7575
*/
7676
public function createContext(): Context
7777
{
78-
return new SnsContext($this->establishConnection(), $this->config, $this->config['topic_arns']);
78+
return new SnsContext($this->establishConnection(), $this->config);
7979
}
8080

8181
private function establishConnection(): SnsClient
@@ -148,7 +148,7 @@ private function extractTopicArns(?string $topicArns): array
148148

149149
return array_column(
150150
array_map(function ($topic) {
151-
list ($name, $arn) = explode('|', $topic);
151+
list($name, $arn) = explode('|', $topic);
152152

153153
return [
154154
'name' => $name,

pkg/sns/SnsContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ class SnsContext implements Context
3131

3232
private $topicArns;
3333

34-
public function __construct(SnsClient $client, array $config, array $topicArns = [])
34+
public function __construct(SnsClient $client, array $config)
3535
{
3636
$this->client = $client;
3737
$this->config = $config;
38-
$this->topicArns = $topicArns;
38+
$this->topicArns = $config['topic_arns'];
3939
}
4040

4141
/**

pkg/sns/Tests/Spec/SnsContextTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ protected function createContext()
2020
{
2121
$client = $this->createMock(SnsClient::class);
2222

23-
return new SnsContext($client, []);
23+
return new SnsContext($client, ['topic_arns' => []]);
2424
}
2525
}

0 commit comments

Comments
 (0)