PaymentACK   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 123
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 97.06%

Importance

Changes 0
Metric Value
wmc 10
lcom 1
cbo 0
dl 0
loc 123
ccs 33
cts 34
cp 0.9706
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A descriptor() 0 27 2
A hasPayment() 0 4 1
A clearPayment() 0 4 1
A getPayment() 0 4 1
A setPayment() 0 4 1
A hasMemo() 0 4 1
A clearMemo() 0 4 1
A getMemo() 0 4 1
A setMemo() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Bip70\Protobuf\Proto;
6
7
class PaymentACK extends \DrSlump\Protobuf\Message
8
{
9
10
    /**  @var \Bip70\Protobuf\Proto\Payment */
11
    public $payment;
12
13
    /**  @var string */
14
    public $memo;
15
16
17
    /** @var \Closure[] */
18
    protected static $__extensions = array();
19
20 1
    public static function descriptor()
21
    {
22 1
        $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'payments.PaymentACK');
23
24
        // REQUIRED MESSAGE payment = 1
25 1
        $f = new \DrSlump\Protobuf\Field();
26 1
        $f->number = 1;
27 1
        $f->name = 'payment';
28 1
        $f->type = \DrSlump\Protobuf::TYPE_MESSAGE;
29 1
        $f->rule = \DrSlump\Protobuf::RULE_REQUIRED;
30 1
        $f->reference = Payment::class;
31 1
        $descriptor->addField($f);
32
33
        // OPTIONAL STRING memo = 2
34 1
        $f = new \DrSlump\Protobuf\Field();
35 1
        $f->number = 2;
36 1
        $f->name = 'memo';
37 1
        $f->type = \DrSlump\Protobuf::TYPE_STRING;
38 1
        $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
39 1
        $descriptor->addField($f);
40
41 1
        foreach (self::$__extensions as $cb) {
42
            $descriptor->addField($cb(), true);
43
        }
44
45 1
        return $descriptor;
46
    }
47
48
    /**
49
     * Check if <payment> has a value
50
     *
51
     * @return boolean
52
     */
53 1
    public function hasPayment()
54
    {
55 1
        return $this->_has(1);
56
    }
57
58
    /**
59
     * Clear <payment> value
60
     *
61
     * @return \Bip70\Protobuf\Proto\PaymentACK
62
     */
63 1
    public function clearPayment()
64
    {
65 1
        return $this->_clear(1);
66
    }
67
68
    /**
69
     * Get <payment> value
70
     *
71
     * @return \Bip70\Protobuf\Proto\Payment
72
     */
73 1
    public function getPayment()
74
    {
75 1
        return $this->_get(1);
76
    }
77
78
    /**
79
     * Set <payment> value
80
     *
81
     * @param \Bip70\Protobuf\Proto\Payment $value
82
     * @return \Bip70\Protobuf\Proto\PaymentACK
83
     */
84 2
    public function setPayment(\Bip70\Protobuf\Proto\Payment $value)
85
    {
86 2
        return $this->_set(1, $value);
87
    }
88
89
    /**
90
     * Check if <memo> has a value
91
     *
92
     * @return boolean
93
     */
94 1
    public function hasMemo()
95
    {
96 1
        return $this->_has(2);
97
    }
98
99
    /**
100
     * Clear <memo> value
101
     *
102
     * @return \Bip70\Protobuf\Proto\PaymentACK
103
     */
104 1
    public function clearMemo()
105
    {
106 1
        return $this->_clear(2);
107
    }
108
109
    /**
110
     * Get <memo> value
111
     *
112
     * @return string
113
     */
114 1
    public function getMemo()
115
    {
116 1
        return $this->_get(2);
117
    }
118
119
    /**
120
     * Set <memo> value
121
     *
122
     * @param string $value
123
     * @return \Bip70\Protobuf\Proto\PaymentACK
124
     */
125 1
    public function setMemo($value)
126
    {
127 1
        return $this->_set(2, $value);
128
    }
129
}
130