PriorityFrame   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 31
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A serializeBody() 0 4 1
A parseBody() 0 5 1
1
<?php
2
declare(strict_types=1);
3
namespace Hyphper\Frame;
4
5
/**
6
 * The PRIORITY frame specifies the sender-advised priority of a stream. It
7
 * can be sent at any time for an existing stream. This enables
8
 * reprioritisation of existing streams.
9
 *
10
 * @package Hyphper\Frame
11
 */
12
class PriorityFrame extends \Hyphper\Frame implements PriorityInterface
13
{
14
    use PriorityTrait;
15
16
    protected $defined_flags = [];
17
    protected $type = 0x02;
18
    protected $stream_association = self::HAS_STREAM;
19
20
    /**
21
     * @return string
22
     */
23 2
    public function serializeBody(): string
24
    {
25 2
        return $this->serializePriorityData();
26
    }
27
28
    /**
29
     * Given the body of a frame, parses it into frame data. This populates
30
     * the non-header parts of the frame: that is, it does not populate the
31
     * stream ID or flags.
32
     *
33
     * @param string $data
34
     *
35
     * @return void
36
     */
37 2
    public function parseBody(string $data)
38
    {
39 2
        $this->parsePriorityData($data);
40 1
        $this->body_len = strlen($data);
41 1
    }
42
}
43