Completed
Pull Request — master (#33)
by Rénald
06:57
created

AMQPLazySSLConnection::getIO()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 6
1
<?php
2
3
namespace Burrow\Connection\PhpAmqpLib;
4
5
use PhpAmqpLib\Connection\AMQPSSLConnection;
6
7
class AMQPLazySSLConnection extends AMQPSSLConnection
8
{
9
    /**
10
     * Gets socket from current connection
11
     *
12
     * @deprecated
13
     */
14
    public function getSocket()
15
    {
16
        $this->connect();
17
18
        return parent::getSocket();
0 ignored issues
show
Deprecated Code introduced by
The method PhpAmqpLib\Connection\Ab...Connection::getSocket() has been deprecated with message: No direct access to communication socket should be available.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

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