Serializable   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 24
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getInt() 0 3 1
A getHex() 0 3 1
A getBinary() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitWasp\Bitcoin;
6
7
abstract class Serializable implements SerializableInterface
8
{
9
    /**
10
     * @return string
11
     */
12 113
    public function getHex(): string
13
    {
14 113
        return $this->getBuffer()->getHex();
15
    }
16
17
    /**
18
     * @return string
19
     */
20 5443
    public function getBinary(): string
21
    {
22 5443
        return $this->getBuffer()->getBinary();
23
    }
24
25
    /**
26
     * @return int
27
     */
28 40
    public function getInt()
29
    {
30 40
        return $this->getBuffer()->getInt();
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getBuffer()->getInt() also could return the type string which is incompatible with the documented return type integer.
Loading history...
31
    }
32
}
33