Completed
Push — master ( 4447aa...e37fbd )
by Vasily
09:14 queued 04:58
created

ConnectionBlockedFrame::create()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 1
dl 12
loc 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace PHPDaemon\Clients\AMQP\Driver\Protocol\v091\Protocol\Connection;
4
5
use PHPDaemon\Clients\AMQP\Driver\Protocol\v091\Protocol\IncomingFrame;
6
use PHPDaemon\Clients\AMQP\Driver\Protocol\v091\Protocol\MethodFrame;
7
8
/**
9
 * Class ConnectionBlockedFrame
10
 * @author Aleksey I. Kuleshov YOU GLOBAL LIMITED
11
 * @package PHPDaemon\Clients\AMQP\Driver\Protocol\v091\Protocol\Connection
12
 */
13 View Code Duplication
class ConnectionBlockedFrame implements MethodFrame, IncomingFrame
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...
14
{
15
    const METHOD_ID = 0x000a003c;
16
17
    public $frameChannelId = 0;
18
    public $reason = ''; // shortstr
19
20
    public static function create(
21
        $reason = null
22
    )
23
    {
24
        $frame = new self();
25
26
        if (null !== $reason) {
27
            $frame->reason = $reason;
28
        }
29
30
        return $frame;
31
    }
32
}
33