Code Duplication    Length = 28-28 lines in 2 locations

PHPDaemon/Clients/AMQP/Driver/Protocol/v091/Protocol/Connection/ConnectionTuneFrame.php 1 location

@@ 13-40 (lines=28) @@
10
 * @author Aleksey I. Kuleshov YOU GLOBAL LIMITED
11
 * @package PHPDaemon\Clients\AMQP\Driver\Protocol\v091\Protocol\Connection
12
 */
13
class ConnectionTuneFrame implements MethodFrame, IncomingFrame
14
{
15
    const METHOD_ID = 0x000a001e;
16
17
    public $frameChannelId = 0;
18
    public $channelMax = 0; // short
19
    public $frameMax = 0; // long
20
    public $heartbeat = 0; // short
21
22
    public static function create(
23
        $channelMax = null, $frameMax = null, $heartbeat = null
24
    )
25
    {
26
        $frame = new self();
27
28
        if (null !== $channelMax) {
29
            $frame->channelMax = $channelMax;
30
        }
31
        if (null !== $frameMax) {
32
            $frame->frameMax = $frameMax;
33
        }
34
        if (null !== $heartbeat) {
35
            $frame->heartbeat = $heartbeat;
36
        }
37
38
        return $frame;
39
    }
40
}
41

PHPDaemon/Clients/AMQP/Driver/Protocol/v091/Protocol/Connection/ConnectionTuneOkFrame.php 1 location

@@ 13-40 (lines=28) @@
10
 * @author Aleksey I. Kuleshov YOU GLOBAL LIMITED
11
 * @package PHPDaemon\Clients\AMQP\Driver\Protocol\v091\Protocol\Connection
12
 */
13
class ConnectionTuneOkFrame implements MethodFrame, OutgoingFrame
14
{
15
    const METHOD_ID = 0x000a001f;
16
17
    public $frameChannelId = 0;
18
    public $channelMax = 0; // short
19
    public $frameMax = 0; // long
20
    public $heartbeat = 0; // short
21
22
    public static function create(
23
        $channelMax = null, $frameMax = null, $heartbeat = null
24
    )
25
    {
26
        $frame = new self();
27
28
        if (null !== $channelMax) {
29
            $frame->channelMax = $channelMax;
30
        }
31
        if (null !== $frameMax) {
32
            $frame->frameMax = $frameMax;
33
        }
34
        if (null !== $heartbeat) {
35
            $frame->heartbeat = $heartbeat;
36
        }
37
38
        return $frame;
39
    }
40
}
41