StreamConnectionFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 28
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 StreamConnectionFactory.
10
 */
11
class StreamConnectionFactory implements ConnectionFactoryInterface
12
{
13
    /**
14
     * @codeCoverageIgnore
15
     *
16
     * @param ConnectionOptions $options
17
     * @return AMQPStreamConnection
18
     */
19
    public function createConnection(ConnectionOptions $options)
20
    {
21
        return new AMQPStreamConnection(
22
            $options->getHost(),
23
            $options->getPort(),
24
            $options->getUsername(),
25
            $options->getPassword(),
26
            $options->getVhost(),
27
            $options->isInsist(),
28
            $options->getLoginMethod(),
29
            null,
30
            $options->getLocale(),
31
            $options->getConnectionTimeout(),
32
            $options->getReadWriteTimeout(),
33
            null,
34
            $options->isKeepAlive(),
35
            $options->getHeartbeat()
36
        );
37
    }
38
}
39