Passed
Pull Request — master (#776)
by
unknown
40:03
created

ExtraPayload   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getHex() 0 3 1
A getSize() 0 3 1
A getBuffer() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitWasp\Bitcoin\ExtraPayload;
6
7
use BitWasp\Bitcoin\Collection\StaticBufferCollection;
8
use BitWasp\Bitcoin\Serializer\ExtraPayload\ExtraPayloadSerializer;
9
use BitWasp\Buffertools\BufferInterface;
10
11
class ExtraPayload extends StaticBufferCollection implements ExtraPayloadInterface
12
{
13
    /**
14
     * @return \BitWasp\Buffertools\BufferInterface
15
     */
16
    public function getBuffer(): BufferInterface
17
    {
18
        return (new ExtraPayloadSerializer())->getBuffer($this);
19
    }
20
21
    public function getSize(): int
22
    {
23
        return (new ExtraPayloadSerializer())->getBuffer($this)->getSize();
24
    }
25
26
    public function getHex(): string
27
    {
28
        return (new ExtraPayloadSerializer())->getBuffer($this)->getHex();
29
    }
30
}
31