@@ -51,19 +51,19 @@ public function __construct($config = 'sns:')
5151
5252 if (empty ($ config )) {
5353 $ config = [];
54- } elseif (is_string ($ config )) {
54+ } elseif (\ is_string ($ config )) {
5555 $ config = $ this ->parseDsn ($ config );
56- } elseif (is_array ($ config )) {
57- if (array_key_exists ('dsn ' , $ config )) {
58- $ config = array_replace_recursive ($ config , $ this ->parseDsn ($ config ['dsn ' ]));
56+ } elseif (\ is_array ($ config )) {
57+ if (\ array_key_exists ('dsn ' , $ config )) {
58+ $ config = \ array_replace_recursive ($ config , $ this ->parseDsn ($ config ['dsn ' ]));
5959
6060 unset($ config ['dsn ' ]);
6161 }
6262 } else {
63- throw new \LogicException (sprintf ('The config must be either an array of options, a DSN string, null or instance of %s ' , AwsSnsClient::class));
63+ throw new \LogicException (\ sprintf ('The config must be either an array of options, a DSN string, null or instance of %s ' , AwsSnsClient::class));
6464 }
6565
66- $ this ->config = array_replace ($ this ->defaultConfig (), $ config );
66+ $ this ->config = \ array_replace ($ this ->defaultConfig (), $ config );
6767 }
6868
6969 /**
@@ -89,6 +89,10 @@ private function establishConnection(): SnsClient
8989 $ config ['endpoint ' ] = $ this ->config ['endpoint ' ];
9090 }
9191
92+ if (isset ($ this ->config ['profile ' ])) {
93+ $ config ['profile ' ] = $ this ->config ['profile ' ];
94+ }
95+
9296 if ($ this ->config ['key ' ] && $ this ->config ['secret ' ]) {
9397 $ config ['credentials ' ] = [
9498 'key ' => $ this ->config ['key ' ],
@@ -117,13 +121,10 @@ private function parseDsn(string $dsn): array
117121 $ dsn = Dsn::parseFirst ($ dsn );
118122
119123 if ('sns ' !== $ dsn ->getSchemeProtocol ()) {
120- throw new \LogicException (sprintf (
121- 'The given scheme protocol "%s" is not supported. It must be "sns" ' ,
122- $ dsn ->getSchemeProtocol ()
123- ));
124+ throw new \LogicException (\sprintf ('The given scheme protocol "%s" is not supported. It must be "sns" ' , $ dsn ->getSchemeProtocol ()));
124125 }
125126
126- return array_filter (array_replace ($ dsn ->getQuery (), [
127+ return \ array_filter (\ array_replace ($ dsn ->getQuery (), [
127128 'key ' => $ dsn ->getString ('key ' ),
128129 'secret ' => $ dsn ->getString ('secret ' ),
129130 'token ' => $ dsn ->getString ('token ' ),
0 commit comments