Completed
Push — master ( e9dbc8...c9d103 )
by Ramūnas
23:40
created

AMQPLazySSLConnection   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 34
loc 34
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A channel() 6 6 1
A getIO() 8 8 2
A connectOnConstruct() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace PhpAmqpLib\Connection;
4
5 View Code Duplication
class AMQPLazySSLConnection extends AMQPSSLConnection
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...
6
{
7
    /**
8
     * {@inheritdoc}
9
     */
10
    public function channel($channel_id = null)
11
    {
12
        $this->connect();
13
14
        return parent::channel($channel_id);
15
    }
16
17
    /**
18
     * @return null|\PhpAmqpLib\Wire\IO\AbstractIO
19
     */
20
    public function getIO()
21
    {
22
        if (empty($this->io)) {
23
            $this->connect();
24
        }
25
26
        return $this->io;
27
    }
28
29
    /**
30
     * Should the connection be attempted during construction?
31
     *
32
     * @return bool
33
     */
34
    public function connectOnConstruct()
35
    {
36
        return false;
37
    }
38
}
39