Completed
Push — master ( b2abd4...891c12 )
by thomas
22:03
created

PaymentRequest::getSignature()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace BitWasp\Bitcoin\PaymentProtocol\Protobufs;
4
5
use \DrSlump\Protobuf;
6
use \DrSlump\Protobuf\Descriptor;
7
use \DrSlump\Protobuf\Field;
8
use \DrSlump\Protobuf\Message;
9
10
class PaymentRequest extends Message
11
{
12
13
    /**  @var int */
14
    public $payment_details_version = 1;
15
16
    /**  @var string */
17
    public $pki_type = 'none';
18
19
    /**  @var string */
20
    public $pki_data ;
21
22
    /**  @var string */
23
    public $serialized_payment_details ;
24
25
    /**  @var string */
26
    public $signature ;
27
28
    /** @var \Closure[] */
29
    protected static $__extensions = array();
30
31
    public static function descriptor()
32
    {
33
        $descriptor = new Descriptor(__CLASS__, 'payments.PaymentRequest');
34
35
        // OPTIONAL UINT32 payment_details_version = 1
36
        $f = new Field();
37
        $f->number = 1;
38
        $f->name = 'payment_details_version';
39
        $f->type = Protobuf::TYPE_UINT32;
40
        $f->rule = Protobuf::RULE_OPTIONAL;
41
        $f->default = 1;
42
        $descriptor->addField($f);
43
44
        // OPTIONAL STRING pki_type = 2
45
        $f = new Field();
46
        $f->number = 2;
47
        $f->name = 'pki_type';
48
        $f->type = Protobuf::TYPE_STRING;
49
        $f->rule = Protobuf::RULE_OPTIONAL;
50
        $f->default = 'none';
51
        $descriptor->addField($f);
52
53
        // OPTIONAL BYTES pki_data = 3
54
        $f = new Field();
55
        $f->number = 3;
56
        $f->name = 'pki_data';
57
        $f->type = Protobuf::TYPE_BYTES;
58
        $f->rule = Protobuf::RULE_OPTIONAL;
59
        $descriptor->addField($f);
60
61
        // REQUIRED BYTES serialized_payment_details = 4
62
        $f = new Field();
63
        $f->number = 4;
64
        $f->name = 'serialized_payment_details';
65
        $f->type = Protobuf::TYPE_BYTES;
66
        $f->rule = Protobuf::RULE_REQUIRED;
67
        $descriptor->addField($f);
68
69
        // OPTIONAL BYTES signature = 5
70
        $f = new Field();
71
        $f->number = 5;
72
        $f->name = 'signature';
73
        $f->type = Protobuf::TYPE_BYTES;
74
        $f->rule = Protobuf::RULE_OPTIONAL;
75
        $descriptor->addField($f);
76
77
        foreach (self::$__extensions as $cb) {
78
            $descriptor->addField($cb(), true);
79
        }
80
81
        return $descriptor;
82
    }
83
84
    /**
85
     * Check if <payment_details_version> has a value
86
     *
87
     * @return boolean
88
     */
89
    public function hasPaymentDetailsVersion()
90
    {
91
        return $this->_has(1);
92
    }
93
94
    /**
95
     * Clear <payment_details_version> value
96
     *
97
     * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentRequest
98
     */
99
    public function clearPaymentDetailsVersion()
100
    {
101
        return $this->_clear(1);
102
    }
103
104
    /**
105
     * Get <payment_details_version> value
106
     *
107
     * @return int
108
     */
109
    public function getPaymentDetailsVersion()
110
    {
111
        return $this->_get(1);
112
    }
113
114
    /**
115
     * Set <payment_details_version> value
116
     *
117
     * @param int $value
118
     * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentRequest
119
     */
120
    public function setPaymentDetailsVersion($value)
121
    {
122
        return $this->_set(1, $value);
123
    }
124
125
    /**
126
     * Check if <pki_type> has a value
127
     *
128
     * @return boolean
129
     */
130
    public function hasPkiType()
131
    {
132
        return $this->_has(2);
133
    }
134
135
    /**
136
     * Clear <pki_type> value
137
     *
138
     * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentRequest
139
     */
140
    public function clearPkiType()
141
    {
142
        return $this->_clear(2);
143
    }
144
145
    /**
146
     * Get <pki_type> value
147
     *
148
     * @return string
149
     */
150 24
    public function getPkiType()
151
    {
152 24
        return $this->_get(2);
153
    }
154
155
    /**
156
     * Set <pki_type> value
157
     *
158
     * @param string $value
159
     * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentRequest
160
     */
161 24
    public function setPkiType($value)
162
    {
163 24
        return $this->_set(2, $value);
164
    }
165
166
    /**
167
     * Check if <pki_data> has a value
168
     *
169
     * @return boolean
170
     */
171
    public function hasPkiData()
172
    {
173
        return $this->_has(3);
174
    }
175
176
    /**
177
     * Clear <pki_data> value
178
     *
179
     * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentRequest
180
     */
181
    public function clearPkiData()
182
    {
183
        return $this->_clear(3);
184
    }
185
186
    /**
187
     * Get <pki_data> value
188
     *
189
     * @return string
190
     */
191 12
    public function getPkiData()
192
    {
193 12
        return $this->_get(3);
194
    }
195
196
    /**
197
     * Set <pki_data> value
198
     *
199
     * @param string $value
200
     * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentRequest
201
     */
202 16
    public function setPkiData($value)
203
    {
204 16
        return $this->_set(3, $value);
205
    }
206
207
    /**
208
     * Check if <serialized_payment_details> has a value
209
     *
210
     * @return boolean
211
     */
212
    public function hasSerializedPaymentDetails()
213
    {
214
        return $this->_has(4);
215
    }
216
217
    /**
218
     * Clear <serialized_payment_details> value
219
     *
220
     * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentRequest
221
     */
222
    public function clearSerializedPaymentDetails()
223
    {
224
        return $this->_clear(4);
225
    }
226
227
    /**
228
     * Get <serialized_payment_details> value
229
     *
230
     * @return string
231
     */
232 28
    public function getSerializedPaymentDetails()
233
    {
234 28
        return $this->_get(4);
235
    }
236
237
    /**
238
     * Set <serialized_payment_details> value
239
     *
240
     * @param string $value
241
     * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentRequest
242
     */
243 20
    public function setSerializedPaymentDetails($value)
244
    {
245 20
        return $this->_set(4, $value);
246
    }
247
248
    /**
249
     * Check if <signature> has a value
250
     *
251
     * @return boolean
252
     */
253
    public function hasSignature()
254
    {
255
        return $this->_has(5);
256
    }
257
258
    /**
259
     * Clear <signature> value
260
     *
261
     * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentRequest
262
     */
263
    public function clearSignature()
264
    {
265
        return $this->_clear(5);
266
    }
267
268
    /**
269
     * Get <signature> value
270
     *
271
     * @return string
272
     */
273 16
    public function getSignature()
274
    {
275 16
        return $this->_get(5);
276
    }
277
278
    /**
279
     * Set <signature> value
280
     *
281
     * @param string $value
282
     * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentRequest
283
     */
284 20
    public function setSignature($value)
285
    {
286 20
        return $this->_set(5, $value);
287
    }
288
}
289