5
5
*/
6
6
namespace Magento \Framework \Amqp ;
7
7
8
+ use Magento \Framework \Amqp \Connection \Factory as ConnectionFactory ;
8
9
use Magento \Framework \Amqp \Connection \FactoryOptions ;
9
10
use Magento \Framework \App \DeploymentConfig ;
10
11
use Magento \Framework \App \ObjectManager ;
11
- use PhpAmqpLib \Connection \AbstractConnection ;
12
12
use PhpAmqpLib \Channel \AMQPChannel ;
13
- use Magento \ Framework \ Amqp \ Connection \Factory as ConnectionFactory ;
13
+ use PhpAmqpLib \ Connection \AbstractConnection ;
14
14
15
15
/**
16
16
* Reads the Amqp config in the deployed environment configuration
@@ -23,20 +23,26 @@ class Config
23
23
/**
24
24
* Queue config key
25
25
*/
26
- const QUEUE_CONFIG = 'queue ' ;
26
+ public const QUEUE_CONFIG = 'queue ' ;
27
27
28
28
/**
29
29
* Amqp config key
30
30
*/
31
- const AMQP_CONFIG = 'amqp ' ;
31
+ public const AMQP_CONFIG = 'amqp ' ;
32
+
33
+ public const HOST = 'host ' ;
34
+
35
+ public const PORT = 'port ' ;
36
+
37
+ public const USERNAME = 'user ' ;
38
+
39
+ public const PASSWORD = 'password ' ;
40
+
41
+ public const VIRTUALHOST = 'virtualhost ' ;
42
+
43
+ public const SSL = 'ssl ' ;
32
44
33
- const HOST = 'host ' ;
34
- const PORT = 'port ' ;
35
- const USERNAME = 'user ' ;
36
- const PASSWORD = 'password ' ;
37
- const VIRTUALHOST = 'virtualhost ' ;
38
- const SSL = 'ssl ' ;
39
- const SSL_OPTIONS = 'ssl_options ' ;
45
+ public const SSL_OPTIONS = 'ssl_options ' ;
40
46
41
47
/**
42
48
* Deployment configuration
@@ -140,7 +146,7 @@ public function getValue($key)
140
146
*/
141
147
private function createConnection (): AbstractConnection
142
148
{
143
- $ sslEnabled = trim ($ this ->getValue (self ::SSL )) === 'true ' ;
149
+ $ sslEnabled = trim ($ this ->getValue (self ::SSL ) ?? '' ) === 'true ' ;
144
150
$ options = new FactoryOptions ();
145
151
$ options ->setHost ($ this ->getValue (self ::HOST ));
146
152
$ options ->setPort ($ this ->getValue (self ::PORT ));
0 commit comments