SSLConnectionFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 29
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createConnection() 0 19 1
1
<?php
2
3
namespace RabbitMqModule\Service\Connection;
4
5
use RabbitMqModule\Options\Connection as ConnectionOptions;
6
use PhpAmqpLib\Connection\AMQPStreamConnection;
7
8
/**
9
 * Class SSLConnectionFactory.
10
 */
11
class SSLConnectionFactory implements ConnectionFactoryInterface
12
{
13
    /**
14
     * @codeCoverageIgnore
15
     *
16
     * @param ConnectionOptions $options
17
     *
18
     * @return AMQPStreamConnection
19
     */
20
    public function createConnection(ConnectionOptions $options)
21
    {
22
        return new AMQPStreamConnection(
23
            $options->getHost(),
24
            $options->getPort(),
25
            $options->getUsername(),
26
            $options->getPassword(),
27
            $options->getVhost(),
28
            $options->isInsist(),
29
            $options->getLoginMethod(),
30
            null,
31
            $options->getLocale(),
32
            $options->getConnectionTimeout(),
33
            $options->getReadWriteTimeout(),
34
            $options->getSslOptions(),
35
            $options->isKeepAlive(),
36
            $options->getHeartbeat()
37
        );
38
    }
39
}
40