AMQPStreamConnection   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 8
Bugs 3 Features 1
Metric Value
wmc 1
c 8
b 3
f 1
lcom 0
cbo 2
dl 0
loc 60
ccs 21
cts 21
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 41 1
1
<?php
2
namespace PhpAmqpLib\Connection;
3
4
use PhpAmqpLib\Wire\IO\StreamIO;
5
6
class AMQPStreamConnection extends AbstractConnection
7
{
8
    /**
9
     * @param string $host
10
     * @param string $port
11
     * @param string $user
12
     * @param string $password
13
     * @param string $vhost
14
     * @param bool $insist
15
     * @param string $login_method
16
     * @param null $login_response
17
     * @param string $locale
18
     * @param int $connection_timeout
19
     * @param int $read_write_timeout
20
     * @param null $context
21
     * @param bool $keepalive
22
     * @param int $heartbeat
23
     */
24 40
    public function __construct(
25
        $host,
26
        $port,
27
        $user,
28
        $password,
29
        $vhost = '/',
30
        $insist = false,
31
        $login_method = 'AMQPLAIN',
32
        $login_response = null,
33
        $locale = 'en_US',
34
        $connection_timeout = 3,
35
        $read_write_timeout = 3,
36
        $context = null,
37
        $keepalive = false,
38
        $heartbeat = 0
39
    ) {
40 40
        $io = new StreamIO(
41 32
            $host,
42 32
            $port,
43 32
            $connection_timeout,
44 32
            $read_write_timeout,
45 32
            $context,
46 32
            $keepalive,
47
            $heartbeat
48 32
        );
49
50 40
        parent::__construct(
51 32
            $user,
52 32
            $password,
53 32
            $vhost,
54 32
            $insist,
55 32
            $login_method,
56 32
            $login_response,
57 32
            $locale,
58 32
            $io,
59
            $heartbeat
60 32
        );
61
62
        // save the params for the use of __clone, this will overwrite the parent
63 40
        $this->construct_params = func_get_args();
64 40
    }
65
}
66