LazyConnectionFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 29
rs 10

1 Method

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