AMQPLazyConnection   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 61.53%

Importance

Changes 4
Bugs 2 Features 1
Metric Value
wmc 5
c 4
b 2
f 1
lcom 1
cbo 1
dl 0
loc 46
ccs 8
cts 13
cp 0.6153
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A connectOnConstruct() 0 4 1
A getSocket() 0 6 1
A channel() 0 6 1
A getIO() 0 8 2
1
<?php
2
namespace PhpAmqpLib\Connection;
3
4
class AMQPLazyConnection extends AMQPStreamConnection
5
{
6
    /**
7
     * Gets socket from current connection
8
     *
9
     * @deprecated
10
     */
11
    public function getSocket()
12
    {
13
        $this->connect();
14
15
        return parent::getSocket();
16
    }
17
18
    /**
19
     * {@inheritdoc}
20
     */
21 10
    public function channel($channel_id = null)
22
    {
23 10
        $this->connect();
24
25 10
        return parent::channel($channel_id);
26
    }
27
28
    /**
29
     * @return null|\PhpAmqpLib\Wire\IO\AbstractIO
30
     */
31 10
    protected function getIO()
32
    {
33 10
        if (!$this->io) {
34
            $this->connect();
35
        }
36
37 10
        return $this->io;
38
    }
39
40
    /**
41
     * Should the connection be attempted during construction?
42
     *
43
     * @return bool
44
     */
45 10
    public function connectOnConstruct()
46
    {
47 10
        return false;
48
    }
49
}
50