Completed
Push — master ( 42bf17...fdb7de )
by Sergey
04:25
created

ConfirmSelect::decode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 6
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/*
3
 * This file is automatically generated.
4
 */
5
6
namespace ButterAMQP\Framing\Method;
7
8
use ButterAMQP\Framing\Frame;
9
use ButterAMQP\Value;
10
11
/**
12
 * @codeCoverageIgnore
13
 */
14 View Code Duplication
class ConfirmSelect extends Frame
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...
15
{
16
    /**
17
     * @var bool
18
     */
19
    private $nowait;
20
21
    /**
22
     * @param int  $channel
23
     * @param bool $nowait
24
     */
25
    public function __construct($channel, $nowait)
26
    {
27
        $this->nowait = $nowait;
28
29
        parent::__construct($channel);
30
    }
31
32
    /**
33
     * Nowait.
34
     *
35
     * @return bool
36
     */
37
    public function isNowait()
38
    {
39
        return $this->nowait;
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function encode()
46
    {
47
        $data = "\x00\x55\x00\x0A".
48
            Value\BooleanValue::encode($this->nowait);
49
50
        return "\x01".pack('nN', $this->channel, strlen($data)).$data."\xCE";
51
    }
52
}
53