Completed
Push — master ( a2b649...a0b99e )
by John
38:51 queued 19:06
created

AMQPLazySocketConnection::getSocket()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 6
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace PhpAmqpLib\Connection;
4
5
/**
6
 * Yet another lazy connection. This time using sockets. Current architecture doesn't allow to wrap existing connections
7
 */
8 View Code Duplication
class AMQPLazySocketConnection extends AMQPSocketConnection
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    /**
11
     * Gets socket from current connection
12
     *
13
     * @deprecated
14
     */
15
    public function getSocket()
16
    {
17
        $this->connect();
18
19
        return parent::getSocket();
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function channel($channel_id = null)
26
    {
27
        $this->connect();
28
29
        return parent::channel($channel_id);
30
    }
31
32
    /**
33
     * @return null|\PhpAmqpLib\Wire\IO\AbstractIO
34
     */
35
    protected function getIO()
36
    {
37
        if (!$this->io) {
38
            $this->connect();
39
        }
40
41
        return $this->io;
42
    }
43
44
    /**
45
     * Should the connection be attempted during construction?
46
     *
47
     * @return bool
48
     */
49
    public function connectOnConstruct()
50
    {
51
        return false;
52
    }
53
}