AMQPLazySocketConnection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 42.86%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 24
ccs 3
cts 7
cp 0.4286
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create_connection() 0 7 2
A connectOnConstruct() 0 3 1
1
<?php
2
3
namespace PhpAmqpLib\Connection;
4
5
/**
6
 * @deprecated AMQPSocketConnection can be lazy too. Use AMQPConnectionFactory with AMQPConnectionConfig::setIsLazy(true)
7
 */
8
class AMQPLazySocketConnection extends AMQPSocketConnection
9
{
10
    /**
11
     * @inheritDoc
12
     */
13 2
    public function connectOnConstruct(): bool
14
    {
15 2
        return false;
16
    }
17 2
18
    /**
19
     * @param string[][] $hosts
20
     * @param string[] $options
21
     * @return self
22
     * @throws \Exception
23
     * @deprecated Use ConnectionFactory
24
     */
25
    public static function create_connection($hosts, $options = array())
26
    {
27
        if (count($hosts) > 1) {
28
            throw new \RuntimeException('Lazy connection does not support multiple hosts');
29
        }
30
31
        return parent::create_connection($hosts, $options);
0 ignored issues
show
Deprecated Code introduced by
The function PhpAmqpLib\Connection\Ab...on::create_connection() has been deprecated: Use AMQPConnectionFactory. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

31
        return /** @scrutinizer ignore-deprecated */ parent::create_connection($hosts, $options);

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

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

Loading history...
32
    }
33
}
34