LazyConnectionFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
dl 0
loc 26
ccs 0
cts 19
cp 0
rs 10

1 Method

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