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

AMQPLazySSLConnection   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 46
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getSocket() 0 6 1
A channel() 0 6 1
A getIO() 0 8 2
A connectOnConstruct() 0 4 1
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