AMQPLazyConnection::connectOnConstruct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
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