Stats   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 28
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getTime() 0 3 1
A getSize() 0 3 1
A process() 0 7 1
A getType() 0 3 1
1
<?php
2
3
namespace kalanis\RemoteRequest\Protocols\Fsp\Answer;
4
5
6
use kalanis\RemoteRequest\Protocols\Fsp;
7
8
9
/**
10
 * Class Stats
11
 * @package kalanis\RemoteRequest\Protocols\Fsp\Answer
12
 * Process stats answer
13
 */
14
class Stats extends AAnswer
15
{
16
    protected int $time = 0;
17
    protected int $size = 0;
18
    protected int $type = 0;
19
20 1
    public function process(): parent
21
    {
22 1
        $data = $this->answer->getContent();
23 1
        $this->time = Fsp\Strings::mb_ord(substr($data, 0, 4));
24 1
        $this->size = Fsp\Strings::mb_ord(substr($data, 4, 4));
25 1
        $this->type = Fsp\Strings::mb_ord($data[8]);
26 1
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type kalanis\RemoteRequest\Protocols\Fsp\Answer\Stats which is incompatible with the type-hinted return parent.
Loading history...
27
    }
28
29 1
    public function getTime(): int
30
    {
31 1
        return $this->time;
32
    }
33
34 1
    public function getSize(): int
35
    {
36 1
        return $this->size;
37
    }
38
39 1
    public function getType(): int
40
    {
41 1
        return $this->type;
42
    }
43
}
44